/[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 1062 - (hide annotations)
Mon Mar 26 06:17:53 2007 UTC (12 years, 5 months ago) by gross
Original Path: trunk/finley/src/Assemble_CopyElementData.c
File MIME type: text/plain
File size: 3934 byte(s)
reduced integration schemes are implemented now for grad, integrate, etc. Tests still to be added.
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 gross 1062 double *in_array,*out_array;
34 jgs 123 dim_t numComps=getDataPointSize(out);
35 phornby 1030
36 gross 1062 Finley_resetError();
37 phornby 1030 if( elements == NULL )
38     {
39     return;
40     }
41    
42     numElements=elements->numElements;
43 gross 1062 if (Finley_Assemble_reducedIntegrationOrder(in)) {
44     numQuad=elements->ReferenceElementReducedOrder->numQuadNodes;
45     } else {
46     numQuad=elements->ReferenceElement->numQuadNodes;
47     }
48 phornby 1030
49 jgs 82 /* check out and in */
50     if (numComps!=getDataPointSize(in)) {
51 gross 1062 Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyElementData: number of components of input and output Data do not match.");
52 jgs 147 } else if (!numSamplesEqual(in,numQuad,numElements)) {
53 gross 1062 Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyElementData: illegal number of samples of input Data object");
54 jgs 147 } else if (!numSamplesEqual(out,numQuad,numElements)) {
55 gross 1062 Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyElementData: illegal number of samples of output Data object");
56 jgs 82 } else if (!isExpanded(out)) {
57 gross 1062 Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyElementData: expanded Data object is expected for output data.");
58 jgs 82 }
59    
60     /* now we can start */
61    
62 jgs 150 if (Finley_noError()) {
63 jgs 82 if (isExpanded(in)) {
64     # pragma omp parallel for private(n) schedule(static)
65     for (n=0;n<numElements;n++)
66     Finley_copyDouble(numComps*numQuad,getSampleData(in,n),getSampleData(out,n));
67     } else {
68     # pragma omp parallel for private(q,n,out_array,in_array) schedule(static)
69     for (n=0;n<numElements;n++) {
70     in_array=getSampleData(in,n);
71     out_array=getSampleData(out,n);
72     for (q=0;q<numQuad;q++) Finley_copyDouble(numComps,in_array,out_array+q*numComps);
73     }
74     }
75     }
76     return;
77     }
78     /*
79     * $Log$
80 jgs 150 * Revision 1.4 2005/09/15 03:44:21 jgs
81     * Merge of development branch dev-02 back to main trunk on 2005-09-15
82     *
83 jgs 147 * Revision 1.3 2005/08/12 01:45:42 jgs
84     * erge of development branch dev-02 back to main trunk on 2005-08-12
85     *
86 jgs 150 * Revision 1.2.2.2 2005/09/07 06:26:17 gross
87     * the solver from finley are put into the standalone package paso now
88     *
89 jgs 147 * Revision 1.2.2.1 2005/08/02 05:29:11 gross
90     * bug in finley/src/Assemble_CopyElementData fixed
91     *
92 jgs 123 * Revision 1.2 2005/07/08 04:07:45 jgs
93     * Merge of development branch back to main trunk on 2005-07-08
94 jgs 82 *
95 jgs 123 * Revision 1.1.1.1.2.1 2005/06/29 02:34:46 gross
96     * some changes towards 64 integers in finley
97     *
98     * Revision 1.1.1.1 2004/10/26 06:53:56 jgs
99     * initial import of project esys2
100     *
101 jgs 82 * Revision 1.2 2004/07/21 05:00:54 gross
102     * name changes in DataC
103     *
104     * Revision 1.1 2004/07/02 04:21:13 gross
105     * Finley C code has been included
106     *
107     *
108     */

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26