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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1061 by gross, Wed Mar 14 00:15:24 2007 UTC revision 1062 by gross, Mon Mar 26 06:17:53 2007 UTC
# Line 106  void Finley_Assemble_CopyNodalData(Finle Line 106  void Finley_Assemble_CopyNodalData(Finle
106    
107      /* check out and in */      /* check out and in */
108      if (numComps!=getDataPointSize(in)) {      if (numComps!=getDataPointSize(in)) {
109         Finley_setError(TYPE_ERROR,"__FILE__: number of components of input and output Data do not match.");         Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: number of components of input and output Data do not match.");
110      } else if (!isExpanded(out)) {      } else if (!isExpanded(out)) {
111         Finley_setError(TYPE_ERROR,"__FILE__: expanded Data object is expected for output data.");         Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: expanded Data object is expected for output data.");
112      }      }
113    
114      /* TODO */      /* TODO */
115      /* more sophisticated test needed for overlapping node/DOF counts */      /* more sophisticated test needed for overlapping node/DOF counts */
116      if (in_data_type == FINLEY_NODES) {      if (in_data_type == FINLEY_NODES) {
117          if (! numSamplesEqual(in,1,nodes->numNodes)) {          if (! numSamplesEqual(in,1,nodes->numNodes)) {
118                 Finley_setError(TYPE_ERROR,"__FILE__: illegal number of samples of input Data object");                 Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: illegal number of samples of input Data object");
119         }         }
120        } else if (in_data_type == FINLEY_REDUCED_NODES) {
121           /* TODO */
122           Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: reduced nodes is not supported yet.");
123      } else if (in_data_type == FINLEY_DEGREES_OF_FREEDOM) {      } else if (in_data_type == FINLEY_DEGREES_OF_FREEDOM) {
124  #ifdef PASO_MPI  #ifdef PASO_MPI
125          if (! numSamplesEqual(in,1,nodes->degreeOfFreedomDistribution->numLocal)) {          if (! numSamplesEqual(in,1,nodes->degreeOfFreedomDistribution->numLocal)) {
126  #else  #else
127          if (! numSamplesEqual(in,1,nodes->numDegreesOfFreedom)) {          if (! numSamplesEqual(in,1,nodes->numDegreesOfFreedom)) {
128  #endif  #endif
129                 Finley_setError(TYPE_ERROR,"__FILE__: illegal number of samples of input Data object");                 Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: illegal number of samples of input Data object");
130         }         }
131      } else if (in_data_type == FINLEY_REDUCED_DEGREES_OF_FREEDOM) {      } else if (in_data_type == FINLEY_REDUCED_DEGREES_OF_FREEDOM) {
132  #ifdef PASO_MPI  #ifdef PASO_MPI
# Line 131  void Finley_Assemble_CopyNodalData(Finle Line 134  void Finley_Assemble_CopyNodalData(Finle
134  #else  #else
135          if (! numSamplesEqual(in,1,nodes->reducedNumDegreesOfFreedom)) {          if (! numSamplesEqual(in,1,nodes->reducedNumDegreesOfFreedom)) {
136  #endif  #endif
137                 Finley_setError(TYPE_ERROR,"__FILE__: illegal number of samples of input Data object");                 Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: illegal number of samples of input Data object");
138         }         }
139      } else {      } else {
140         Finley_setError(TYPE_ERROR,"__FILE__: illegal function space type for target object");         Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: illegal function space type for target object");
141      }      }
142            
143      if (out_data_type == FINLEY_NODES) {      if (out_data_type == FINLEY_NODES) {
144          if (! numSamplesEqual(out,1,nodes->numNodes)) {          if (! numSamplesEqual(out,1,nodes->numNodes)) {
145                 Finley_setError(TYPE_ERROR,"__FILE__: illegal number of samples of output Data object");                 Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: illegal number of samples of output Data object");
146         }         }
147        } else if (out_data_type == FINLEY_REDUCED_NODES) {
148           /* TODO */
149           Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: reduced nodes is not supported yet.");
150      } else if (out_data_type == FINLEY_DEGREES_OF_FREEDOM) {      } else if (out_data_type == FINLEY_DEGREES_OF_FREEDOM) {
151  #ifdef PASO_MPI  #ifdef PASO_MPI
152          if (! numSamplesEqual(out,1,nodes->degreeOfFreedomDistribution->numLocal)) {          if (! numSamplesEqual(out,1,nodes->degreeOfFreedomDistribution->numLocal)) {
153  #else  #else
154          if (! numSamplesEqual(out,1,nodes->numDegreesOfFreedom)) {          if (! numSamplesEqual(out,1,nodes->numDegreesOfFreedom)) {
155  #endif  #endif
156                 Finley_setError(TYPE_ERROR,"__FILE__: illegal number of samples of output Data object");                 Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: illegal number of samples of output Data object");
157         }         }
158      } else if (out_data_type == FINLEY_REDUCED_DEGREES_OF_FREEDOM) {      } else if (out_data_type == FINLEY_REDUCED_DEGREES_OF_FREEDOM) {
159  #ifdef PASO_MPI  #ifdef PASO_MPI
# Line 155  void Finley_Assemble_CopyNodalData(Finle Line 161  void Finley_Assemble_CopyNodalData(Finle
161  #else  #else
162          if (! numSamplesEqual(out,1,nodes->reducedNumDegreesOfFreedom)) {          if (! numSamplesEqual(out,1,nodes->reducedNumDegreesOfFreedom)) {
163  #endif  #endif
164                 Finley_setError(TYPE_ERROR,"__FILE__: illegal number of samples of output Data object");                 Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: illegal number of samples of output Data object");
165         }         }
166      } else {      } else {
167         Finley_setError(TYPE_ERROR,"__FILE__: illegal function space type for source object");         Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: illegal function space type for source object");
168      }      }
169    
170      /* now we can start */      /* now we can start */
# Line 176  void Finley_Assemble_CopyNodalData(Finle Line 182  void Finley_Assemble_CopyNodalData(Finle
182                #pragma omp parallel for private(n) schedule(static)                #pragma omp parallel for private(n) schedule(static)
183                for (n=0;n<nodes->numNodes;n++)                for (n=0;n<nodes->numNodes;n++)
184                     Finley_copyDouble(numComps,getSampleData(in,n),getSampleData(out,n));                     Finley_copyDouble(numComps,getSampleData(in,n),getSampleData(out,n));
185               } else if (in_data_type == FINLEY_REDUCED_NODES) { /* TODO */
186                 Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: cannot copy from nodes to reduced nodes.");
187             } else if (out_data_type == FINLEY_DEGREES_OF_FREEDOM) {             } else if (out_data_type == FINLEY_DEGREES_OF_FREEDOM) {
188                #pragma omp parallel for private(n) schedule(static)                #pragma omp parallel for private(n) schedule(static)
189                for (n=0;n<nodes->numNodes;n++)                for (n=0;n<nodes->numNodes;n++)
# Line 195  void Finley_Assemble_CopyNodalData(Finle Line 203  void Finley_Assemble_CopyNodalData(Finle
203                    Finley_copyDouble(numComps,getSampleData(in,i),getSampleData(out,n));                    Finley_copyDouble(numComps,getSampleData(in,i),getSampleData(out,n));
204                }                }
205             }             }
206            } else if (in_data_type == FINLEY_REDUCED_NODES) {
207               if  (out_data_type == FINLEY_NODES) {
208                 Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: cannot copy from reduced nodes to nodes.");
209               } else if (in_data_type == FINLEY_REDUCED_NODES) { /* TODO */
210                 Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: cannot copy from reduced nodes to reduced nodes.");
211               } else if (out_data_type == FINLEY_DEGREES_OF_FREEDOM) {
212                 Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: cannot copy from reduced nodes to degrees of freedom.");
213               } else if (out_data_type == FINLEY_REDUCED_DEGREES_OF_FREEDOM) {
214                 Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: cannot copy from reduced nodes to reduced degrees of freedom.");
215               }
216          } else if (in_data_type == FINLEY_DEGREES_OF_FREEDOM) {          } else if (in_data_type == FINLEY_DEGREES_OF_FREEDOM) {
217              if  (out_data_type == FINLEY_NODES)              if  (out_data_type == FINLEY_NODES)
218              {              {
# Line 230  void Finley_Assemble_CopyNodalData(Finle Line 248  void Finley_Assemble_CopyNodalData(Finle
248                     Finley_copyDouble(numComps,getSampleData(in,nodes->degreeOfFreedom[i]),getSampleData(out,n));                     Finley_copyDouble(numComps,getSampleData(in,nodes->degreeOfFreedom[i]),getSampleData(out,n));
249                }                }
250             }             }
251          }          } else if (in_data_type == FINLEY_REDUCED_DEGREES_OF_FREEDOM) {
         else if (in_data_type == FINLEY_REDUCED_DEGREES_OF_FREEDOM) {  
252             if (out_data_type == FINLEY_REDUCED_DEGREES_OF_FREEDOM) {             if (out_data_type == FINLEY_REDUCED_DEGREES_OF_FREEDOM) {
253                #pragma omp parallel for private(n) schedule(static)                #pragma omp parallel for private(n) schedule(static)
254                for (n=0;n<nodes->reducedNumDegreesOfFreedom;n++)                for (n=0;n<nodes->reducedNumDegreesOfFreedom;n++)
# Line 271  void Finley_Assemble_CopyNodalData(Finle Line 288  void Finley_Assemble_CopyNodalData(Finle
288                }                }
289  #endif  #endif
290             } else {             } else {
291               Finley_setError(TYPE_ERROR,"__FILE__: cannot copy from data on reduced degrees of freedom");               Finley_setError(TYPE_ERROR,"Finley_Assemble_CopyNodalData: cannot copy from data on reduced degrees of freedom");
292             }             }
293          }          }
294     }     }

Legend:
Removed from v.1061  
changed lines
  Added in v.1062

  ViewVC Help
Powered by ViewVC 1.1.26