/[escript]/trunk/finley/src/Assemble_CopyElementData.c
ViewVC logotype

Contents of /trunk/finley/src/Assemble_CopyElementData.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 123 - (show annotations)
Fri Jul 8 04:08:13 2005 UTC (14 years, 3 months ago) by jgs
Original Path: trunk/esys2/finley/src/finleyC/Assemble_CopyElementData.c
File MIME type: text/plain
File size: 2856 byte(s)
Merge of development branch back to main trunk on 2005-07-08

1 /* $Id$ */
2
3 /**************************************************************/
4
5 /* assemblage routines: copies data between elements */
6
7 /**************************************************************/
8
9 /* Copyrights by ACcESS Australia, 2003,2004 */
10 /* author: gross@access.edu.au */
11 /* Version: $Id$ */
12
13 /**************************************************************/
14
15 #include "escript/Data/DataC.h"
16 #include "Util.h"
17 #include "Finley.h"
18 #include "Assemble.h"
19 #include "ElementFile.h"
20 #ifdef _OPENMP
21 #include <omp.h>
22 #endif
23 /******************************************************************************************************/
24
25
26 void Finley_Assemble_CopyElementData(Finley_ElementFile* elements,escriptDataC* out,escriptDataC* in) {
27 if (elements==NULL) return;
28 dim_t n,q;
29 dim_t numElements=elements->numElements;
30 dim_t numQuad=elements->ReferenceElement->numQuadNodes;
31 dim_t numComps=getDataPointSize(out);
32 double *in_array,*out_array;
33
34 /* check out and in */
35 if (numComps!=getDataPointSize(in)) {
36 Finley_ErrorCode=TYPE_ERROR;
37 sprintf(Finley_ErrorMsg,"number of components of input and output Data do not match.");
38 } else if (numSamplesEqual(out,numQuad,numElements)) {
39 Finley_ErrorCode=TYPE_ERROR;
40 sprintf(Finley_ErrorMsg,"illegal number of samples of output Data object");
41 } else if (numSamplesEqual(in,numQuad,numElements)) {
42 Finley_ErrorCode=TYPE_ERROR;
43 sprintf(Finley_ErrorMsg,"illegal number of samples of input Data object");
44 } else if (!isExpanded(out)) {
45 Finley_ErrorCode=TYPE_ERROR;
46 sprintf(Finley_ErrorMsg,"expanded Data object is expected for output data.");
47 }
48
49 /* now we can start */
50
51 if (Finley_ErrorCode==NO_ERROR) {
52 if (isExpanded(in)) {
53 # pragma omp parallel for private(n) schedule(static)
54 for (n=0;n<numElements;n++)
55 Finley_copyDouble(numComps*numQuad,getSampleData(in,n),getSampleData(out,n));
56 } else {
57 # pragma omp parallel for private(q,n,out_array,in_array) schedule(static)
58 for (n=0;n<numElements;n++) {
59 in_array=getSampleData(in,n);
60 out_array=getSampleData(out,n);
61 for (q=0;q<numQuad;q++) Finley_copyDouble(numComps,in_array,out_array+q*numComps);
62 }
63 }
64 }
65 return;
66 }
67 /*
68 * $Log$
69 * Revision 1.2 2005/07/08 04:07:45 jgs
70 * Merge of development branch back to main trunk on 2005-07-08
71 *
72 * Revision 1.1.1.1.2.1 2005/06/29 02:34:46 gross
73 * some changes towards 64 integers in finley
74 *
75 * Revision 1.1.1.1 2004/10/26 06:53:56 jgs
76 * initial import of project esys2
77 *
78 * Revision 1.2 2004/07/21 05:00:54 gross
79 * name changes in DataC
80 *
81 * Revision 1.1 2004/07/02 04:21:13 gross
82 * Finley C code has been included
83 *
84 *
85 */

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26