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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1030 - (hide annotations)
Wed Mar 14 05:14:44 2007 UTC (12 years, 8 months ago) by phornby
File MIME type: text/plain
File size: 3823 byte(s)
Assemble_CopyElementData.c - resolve with my local edits.
Mesh_saveVTK.c - remove debug print.
DataArrayView.h - remove dllim/export declarations on template functions.


1 jgs 150 /*
2 elspeth 616 ************************************************************
3     * Copyright 2006 by ACcESS MNRF *
4     * *
5     * http://www.access.edu.au *
6     * Primary Business: Queensland, Australia *
7     * Licensed under the Open Software License version 3.0 *
8     * http://www.opensource.org/licenses/osl-3.0.php *
9     * *
10     ************************************************************
11 jgs 150 */
12 jgs 82 /**************************************************************/
13    
14     /* assemblage routines: copies data between elements */
15    
16     /**************************************************************/
17    
18     /* author: gross@access.edu.au */
19     /* Version: $Id$ */
20    
21     /**************************************************************/
22    
23 jgs 150 #include "Assemble.h"
24 jgs 82 #include "Util.h"
25     #ifdef _OPENMP
26     #include <omp.h>
27     #endif
28     /******************************************************************************************************/
29    
30    
31     void Finley_Assemble_CopyElementData(Finley_ElementFile* elements,escriptDataC* out,escriptDataC* in) {
32 gross 1028 dim_t n,q, numElements, numQuad;
33 jgs 123 dim_t numComps=getDataPointSize(out);
34 jgs 82 double *in_array,*out_array;
35 phornby 1030
36     if( elements == NULL )
37     {
38     return;
39     }
40    
41     numElements=elements->numElements;
42     numQuad=elements->ReferenceElement->numQuadNodes;
43    
44 jgs 150 Finley_resetError();
45 jgs 82
46 gross 1028 if (elements==NULL) return;
47     numElements=elements->numElements;
48     numQuad=elements->ReferenceElement->numQuadNodes;
49    
50 jgs 82 /* check out and in */
51     if (numComps!=getDataPointSize(in)) {
52 jgs 150 Finley_setError(TYPE_ERROR,"__FILE__: number of components of input and output Data do not match.");
53 jgs 147 } else if (!numSamplesEqual(in,numQuad,numElements)) {
54 jgs 150 Finley_setError(TYPE_ERROR,"__FILE__: illegal number of samples of input Data object");
55 jgs 147 } else if (!numSamplesEqual(out,numQuad,numElements)) {
56 jgs 150 Finley_setError(TYPE_ERROR,"__FILE__: illegal number of samples of output Data object");
57 jgs 82 } else if (!isExpanded(out)) {
58 jgs 150 Finley_setError(TYPE_ERROR,"__FILE__: expanded Data object is expected for output data.");
59 jgs 82 }
60    
61     /* now we can start */
62    
63 jgs 150 if (Finley_noError()) {
64 jgs 82 if (isExpanded(in)) {
65     # pragma omp parallel for private(n) schedule(static)
66     for (n=0;n<numElements;n++)
67     Finley_copyDouble(numComps*numQuad,getSampleData(in,n),getSampleData(out,n));
68     } else {
69     # pragma omp parallel for private(q,n,out_array,in_array) schedule(static)
70     for (n=0;n<numElements;n++) {
71     in_array=getSampleData(in,n);
72     out_array=getSampleData(out,n);
73     for (q=0;q<numQuad;q++) Finley_copyDouble(numComps,in_array,out_array+q*numComps);
74     }
75     }
76     }
77     return;
78     }
79     /*
80     * $Log$
81 jgs 150 * Revision 1.4 2005/09/15 03:44:21 jgs
82     * Merge of development branch dev-02 back to main trunk on 2005-09-15
83     *
84 jgs 147 * Revision 1.3 2005/08/12 01:45:42 jgs
85     * erge of development branch dev-02 back to main trunk on 2005-08-12
86     *
87 jgs 150 * Revision 1.2.2.2 2005/09/07 06:26:17 gross
88     * the solver from finley are put into the standalone package paso now
89     *
90 jgs 147 * Revision 1.2.2.1 2005/08/02 05:29:11 gross
91     * bug in finley/src/Assemble_CopyElementData fixed
92     *
93 jgs 123 * Revision 1.2 2005/07/08 04:07:45 jgs
94     * Merge of development branch back to main trunk on 2005-07-08
95 jgs 82 *
96 jgs 123 * Revision 1.1.1.1.2.1 2005/06/29 02:34:46 gross
97     * some changes towards 64 integers in finley
98     *
99     * Revision 1.1.1.1 2004/10/26 06:53:56 jgs
100     * initial import of project esys2
101     *
102 jgs 82 * Revision 1.2 2004/07/21 05:00:54 gross
103     * name changes in DataC
104     *
105     * Revision 1.1 2004/07/02 04:21:13 gross
106     * Finley C code has been included
107     *
108     *
109     */

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26