/[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 201 - (hide annotations)
Wed Nov 23 04:10:21 2005 UTC (13 years, 10 months ago) by jgs
Original Path: trunk/finley/src/finley/Assemble_CopyElementData.c
File MIME type: text/plain
File size: 3984 byte(s)
copy finleyC and CPPAdapter to finley and finley/CPPAdapter to
facilitate scons builds

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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26