/[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 616 - (show annotations)
Wed Mar 22 02:46:56 2006 UTC (13 years, 7 months ago) by elspeth
File MIME type: text/plain
File size: 3662 byte(s)
Copyright added to more source files.

1 /*
2 ************************************************************
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 */
12 /**************************************************************/
13
14 /* assemblage routines: copies data between elements */
15
16 /**************************************************************/
17
18 /* author: gross@access.edu.au */
19 /* Version: $Id$ */
20
21 /**************************************************************/
22
23 #include "Assemble.h"
24 #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 if (elements==NULL) return;
33 dim_t n,q;
34 dim_t numElements=elements->numElements;
35 dim_t numQuad=elements->ReferenceElement->numQuadNodes;
36 dim_t numComps=getDataPointSize(out);
37 double *in_array,*out_array;
38 Finley_resetError();
39
40 /* check out and in */
41 if (numComps!=getDataPointSize(in)) {
42 Finley_setError(TYPE_ERROR,"__FILE__: number of components of input and output Data do not match.");
43 } else if (!numSamplesEqual(in,numQuad,numElements)) {
44 Finley_setError(TYPE_ERROR,"__FILE__: illegal number of samples of input Data object");
45 } else if (!numSamplesEqual(out,numQuad,numElements)) {
46 Finley_setError(TYPE_ERROR,"__FILE__: illegal number of samples of output Data object");
47 } else if (!isExpanded(out)) {
48 Finley_setError(TYPE_ERROR,"__FILE__: expanded Data object is expected for output data.");
49 }
50
51 /* now we can start */
52
53 if (Finley_noError()) {
54 if (isExpanded(in)) {
55 # pragma omp parallel for private(n) schedule(static)
56 for (n=0;n<numElements;n++)
57 Finley_copyDouble(numComps*numQuad,getSampleData(in,n),getSampleData(out,n));
58 } else {
59 # pragma omp parallel for private(q,n,out_array,in_array) schedule(static)
60 for (n=0;n<numElements;n++) {
61 in_array=getSampleData(in,n);
62 out_array=getSampleData(out,n);
63 for (q=0;q<numQuad;q++) Finley_copyDouble(numComps,in_array,out_array+q*numComps);
64 }
65 }
66 }
67 return;
68 }
69 /*
70 * $Log$
71 * Revision 1.4 2005/09/15 03:44:21 jgs
72 * Merge of development branch dev-02 back to main trunk on 2005-09-15
73 *
74 * Revision 1.3 2005/08/12 01:45:42 jgs
75 * erge of development branch dev-02 back to main trunk on 2005-08-12
76 *
77 * Revision 1.2.2.2 2005/09/07 06:26:17 gross
78 * the solver from finley are put into the standalone package paso now
79 *
80 * Revision 1.2.2.1 2005/08/02 05:29:11 gross
81 * bug in finley/src/Assemble_CopyElementData fixed
82 *
83 * Revision 1.2 2005/07/08 04:07:45 jgs
84 * Merge of development branch back to main trunk on 2005-07-08
85 *
86 * Revision 1.1.1.1.2.1 2005/06/29 02:34:46 gross
87 * some changes towards 64 integers in finley
88 *
89 * Revision 1.1.1.1 2004/10/26 06:53:56 jgs
90 * initial import of project esys2
91 *
92 * Revision 1.2 2004/07/21 05:00:54 gross
93 * name changes in DataC
94 *
95 * Revision 1.1 2004/07/02 04:21:13 gross
96 * Finley C code has been included
97 *
98 *
99 */

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26