/[escript]/trunk/dudley/src/Assemble_CopyElementData.cpp
ViewVC logotype

Annotation of /trunk/dudley/src/Assemble_CopyElementData.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 147 - (hide annotations)
Fri Aug 12 01:45:47 2005 UTC (14 years, 1 month ago) by jgs
Original Path: trunk/esys2/finley/src/finleyC/Assemble_CopyElementData.c
File MIME type: text/plain
File size: 3076 byte(s)
erge of development branch dev-02 back to main trunk on 2005-08-12

1 jgs 82 /* $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 jgs 123 dim_t n,q;
29     dim_t numElements=elements->numElements;
30     dim_t numQuad=elements->ReferenceElement->numQuadNodes;
31     dim_t numComps=getDataPointSize(out);
32 jgs 82 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 jgs 147 } else if (!numSamplesEqual(in,numQuad,numElements)) {
39 jgs 82 Finley_ErrorCode=TYPE_ERROR;
40 jgs 147 sprintf(Finley_ErrorMsg,"illegal number of samples of input Data object");
41     } else if (!numSamplesEqual(out,numQuad,numElements)) {
42     Finley_ErrorCode=TYPE_ERROR;
43 jgs 82 sprintf(Finley_ErrorMsg,"illegal number of samples of output 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 jgs 147 * Revision 1.3 2005/08/12 01:45:42 jgs
70     * erge of development branch dev-02 back to main trunk on 2005-08-12
71     *
72     * Revision 1.2.2.1 2005/08/02 05:29:11 gross
73     * bug in finley/src/Assemble_CopyElementData fixed
74     *
75 jgs 123 * Revision 1.2 2005/07/08 04:07:45 jgs
76     * Merge of development branch back to main trunk on 2005-07-08
77 jgs 82 *
78 jgs 123 * Revision 1.1.1.1.2.1 2005/06/29 02:34:46 gross
79     * some changes towards 64 integers in finley
80     *
81     * Revision 1.1.1.1 2004/10/26 06:53:56 jgs
82     * initial import of project esys2
83     *
84 jgs 82 * Revision 1.2 2004/07/21 05:00:54 gross
85     * name changes in DataC
86     *
87     * Revision 1.1 2004/07/02 04:21:13 gross
88     * Finley C code has been included
89     *
90     *
91     */

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26