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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 155 - (hide annotations)
Wed Nov 9 02:02:19 2005 UTC (13 years, 11 months ago) by jgs
Original Path: trunk/finley/src/finleyC/Assemble_CopyNodalData.c
File MIME type: text/plain
File size: 8084 byte(s)
move all directories from trunk/esys2 into trunk and remove esys2

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 different types nodal representation */
17    
18     /**************************************************************/
19    
20     /* author: gross@access.edu.au */
21     /* Version: $Id$ */
22    
23     /**************************************************************/
24    
25     #include "Util.h"
26     #include "Assemble.h"
27     #ifdef _OPENMP
28     #include <omp.h>
29     #endif
30    
31     /******************************************************************************************************/
32    
33    
34     void Finley_Assemble_CopyNodalData(Finley_NodeFile* nodes,escriptDataC* out,escriptDataC* in) {
35     if (nodes==NULL) return;
36 jgs 123 dim_t n,i;
37     dim_t numComps=getDataPointSize(out);
38     type_t in_data_type=getFunctionSpaceType(in);
39     type_t out_data_type=getFunctionSpaceType(out);
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 82 } else if (!isExpanded(out)) {
46 jgs 150 Finley_setError(TYPE_ERROR,"__FILE__: expanded Data object is expected for output data.");
47 jgs 82 }
48    
49     if (in_data_type == FINLEY_NODES) {
50     if (! numSamplesEqual(in,1,nodes->numNodes)) {
51 jgs 150 Finley_setError(TYPE_ERROR,"__FILE__: illegal number of samples of input Data object");
52 jgs 82 }
53     } else if (in_data_type == FINLEY_DEGREES_OF_FREEDOM) {
54     if (! numSamplesEqual(in,1,nodes->numDegreesOfFreedom)) {
55 jgs 150 Finley_setError(TYPE_ERROR,"__FILE__: illegal number of samples of input Data object");
56 jgs 82 }
57     } else if (in_data_type == FINLEY_REDUCED_DEGREES_OF_FREEDOM) {
58     if (! numSamplesEqual(in,1,nodes->reducedNumDegreesOfFreedom)) {
59 jgs 150 Finley_setError(TYPE_ERROR,"__FILE__: illegal number of samples of input Data object");
60 jgs 82 }
61     } else {
62 jgs 150 Finley_setError(TYPE_ERROR,"__FILE__: illegal function space type for target object");
63 jgs 82 }
64    
65     if (out_data_type == FINLEY_NODES) {
66     if (! numSamplesEqual(out,1,nodes->numNodes)) {
67 jgs 150 Finley_setError(TYPE_ERROR,"__FILE__: illegal number of samples of output Data object");
68 jgs 82 }
69     } else if (out_data_type == FINLEY_DEGREES_OF_FREEDOM) {
70     if (! numSamplesEqual(out,1,nodes->numDegreesOfFreedom)) {
71 jgs 150 Finley_setError(TYPE_ERROR,"__FILE__: illegal number of samples of output Data object");
72 jgs 82 }
73     } else if (out_data_type == FINLEY_REDUCED_DEGREES_OF_FREEDOM) {
74     if (! numSamplesEqual(out,1,nodes->reducedNumDegreesOfFreedom)) {
75 jgs 150 Finley_setError(TYPE_ERROR,"__FILE__: illegal number of samples of output Data object");
76 jgs 82 }
77     } else {
78 jgs 150 Finley_setError(TYPE_ERROR,"__FILE__: illegal function space type for source object");
79 jgs 82 }
80    
81     /* now we can start */
82    
83 jgs 150 if (Finley_noError()) {
84 jgs 82 if (in_data_type == FINLEY_NODES) {
85     if (out_data_type == FINLEY_NODES) {
86     #pragma omp parallel for private(n) schedule(static)
87     for (n=0;n<nodes->numNodes;n++)
88     Finley_copyDouble(numComps,getSampleData(in,n),getSampleData(out,n));
89     } else if (out_data_type == FINLEY_DEGREES_OF_FREEDOM) {
90     #pragma omp parallel for private(n) schedule(static)
91     for (n=0;n<nodes->numNodes;n++)
92     Finley_copyDouble(numComps,getSampleData(in,n),getSampleData(out,nodes->degreeOfFreedom[n]));
93     } else if (out_data_type == FINLEY_REDUCED_DEGREES_OF_FREEDOM) {
94     #pragma omp parallel for private(n,i) schedule(static)
95     for (i=0;i<nodes->numNodes;i++) {
96     n=nodes->reducedDegreeOfFreedom[i];
97     if (n>=0) Finley_copyDouble(numComps,getSampleData(in,i),getSampleData(out,n));
98     }
99     }
100     } else if (in_data_type == FINLEY_DEGREES_OF_FREEDOM) {
101     if (out_data_type == FINLEY_NODES) {
102     #pragma omp parallel for private(n) schedule(static)
103     for (n=0;n<nodes->numNodes;n++)
104     Finley_copyDouble(numComps,getSampleData(in,nodes->degreeOfFreedom[n]),getSampleData(out,n));
105     } else if (out_data_type == FINLEY_DEGREES_OF_FREEDOM) {
106     #pragma omp parallel for private(n) schedule(static)
107     for (n=0;n<nodes->numDegreesOfFreedom;n++)
108     Finley_copyDouble(numComps,getSampleData(in,n),getSampleData(out,n));
109     } else if (out_data_type == FINLEY_REDUCED_DEGREES_OF_FREEDOM) {
110     #pragma omp parallel for private(n,i) schedule(static)
111     for (i=0;i<nodes->numNodes;i++) {
112     n=nodes->reducedDegreeOfFreedom[i];
113     if (n>=0) Finley_copyDouble(numComps,getSampleData(in,nodes->degreeOfFreedom[i]),getSampleData(out,n));
114     }
115     }
116 jgs 147 } else if (in_data_type == FINLEY_REDUCED_DEGREES_OF_FREEDOM) {
117 jgs 82 if (out_data_type == FINLEY_REDUCED_DEGREES_OF_FREEDOM) {
118     #pragma omp parallel for private(n) schedule(static)
119     for (n=0;n<nodes->reducedNumDegreesOfFreedom;n++)
120     Finley_copyDouble(numComps,getSampleData(in,n),getSampleData(out,n));
121 jgs 147 } else if (out_data_type == FINLEY_DEGREES_OF_FREEDOM && numSamplesEqual(out,1,nodes->reducedNumDegreesOfFreedom)) {
122     #pragma omp parallel for private(n) schedule(static)
123     for (i=0;i<nodes->numNodes;i++) {
124     n=nodes->reducedDegreeOfFreedom[i];
125     if (n>=0) Finley_copyDouble(numComps,getSampleData(in,n),getSampleData(out,nodes->degreeOfFreedom[i]));
126     }
127     } else if (out_data_type == FINLEY_NODES && numSamplesEqual(out,1,nodes->reducedNumDegreesOfFreedom)) {
128     #pragma omp parallel for private(n) schedule(static)
129     for (i=0;i<nodes->numNodes;i++) {
130     n=nodes->reducedDegreeOfFreedom[i];
131     if (n>=0) Finley_copyDouble(numComps,getSampleData(in,n),getSampleData(out,i));
132     }
133 jgs 82 } else {
134 jgs 150 Finley_setError(TYPE_ERROR,"__FILE__: cannot copy from data on reduced degrees of freedom");
135 jgs 82 }
136 jgs 147 }
137 jgs 82 }
138     return;
139     }
140     /*
141     * $Log$
142 jgs 150 * Revision 1.4 2005/09/15 03:44:21 jgs
143     * Merge of development branch dev-02 back to main trunk on 2005-09-15
144     *
145 jgs 147 * Revision 1.3 2005/08/12 01:45:42 jgs
146     * erge of development branch dev-02 back to main trunk on 2005-08-12
147     *
148 jgs 150 * Revision 1.2.2.3 2005/09/07 06:26:17 gross
149     * the solver from finley are put into the standalone package paso now
150     *
151 jgs 147 * Revision 1.2.2.2 2005/08/09 02:23:12 gross
152     * print statement removed
153     *
154     * Revision 1.2.2.1 2005/08/03 09:55:33 gross
155     * ContactTest is passing now./mk install!
156     *
157 jgs 123 * Revision 1.2 2005/07/08 04:07:45 jgs
158     * Merge of development branch back to main trunk on 2005-07-08
159 jgs 82 *
160 jgs 123 * Revision 1.1.1.1.2.1 2005/06/29 02:34:46 gross
161     * some changes towards 64 integers in finley
162     *
163     * Revision 1.1.1.1 2004/10/26 06:53:56 jgs
164     * initial import of project esys2
165     *
166 jgs 82 * Revision 1.2 2004/07/21 05:00:54 gross
167     * name changes in DataC
168     *
169     * Revision 1.1 2004/07/02 04:21:13 gross
170     * Finley C code has been included
171     *
172     *
173     */

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26