/[escript]/branches/arrayview_from_1695_trunk/finley/src/Assemble_AverageElementData.c
ViewVC logotype

Contents of /branches/arrayview_from_1695_trunk/finley/src/Assemble_AverageElementData.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 471 - (show annotations)
Fri Jan 27 01:33:02 2006 UTC (13 years, 7 months ago) by jgs
Original Path: trunk/finley/src/Assemble_CopyElementData.c
File MIME type: text/plain
File size: 3984 byte(s)
reorganise finley src tree to remove inc dir and src/finley directory

1 /*
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 /**************************************************************/
15
16 /* assemblage routines: copies data between elements */
17
18 /**************************************************************/
19
20 /* author: gross@access.edu.au */
21 /* Version: $Id$ */
22
23 /**************************************************************/
24
25 #include "Assemble.h"
26 #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 dim_t n,q;
36 dim_t numElements=elements->numElements;
37 dim_t numQuad=elements->ReferenceElement->numQuadNodes;
38 dim_t numComps=getDataPointSize(out);
39 double *in_array,*out_array;
40 Finley_resetError();
41
42 /* check out and in */
43 if (numComps!=getDataPointSize(in)) {
44 Finley_setError(TYPE_ERROR,"__FILE__: number of components of input and output Data do not match.");
45 } else if (!numSamplesEqual(in,numQuad,numElements)) {
46 Finley_setError(TYPE_ERROR,"__FILE__: illegal number of samples of input Data object");
47 } else if (!numSamplesEqual(out,numQuad,numElements)) {
48 Finley_setError(TYPE_ERROR,"__FILE__: illegal number of samples of output Data object");
49 } else if (!isExpanded(out)) {
50 Finley_setError(TYPE_ERROR,"__FILE__: expanded Data object is expected for output data.");
51 }
52
53 /* now we can start */
54
55 if (Finley_noError()) {
56 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 * 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 * 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 * 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 * Revision 1.2.2.1 2005/08/02 05:29:11 gross
83 * bug in finley/src/Assemble_CopyElementData fixed
84 *
85 * Revision 1.2 2005/07/08 04:07:45 jgs
86 * Merge of development branch back to main trunk on 2005-07-08
87 *
88 * 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 * 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