/[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 149 by jgs, Fri Aug 12 01:45:47 2005 UTC revision 150 by jgs, Thu Sep 15 03:44:45 2005 UTC
# Line 1  Line 1 
1  /* $Id$ */  /*
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 different types nodal representation   */  /*    assemblage routines: copies data between different types nodal representation   */
17    
18  /**************************************************************/  /**************************************************************/
19    
 /*   Copyrights by ACcESS Australia, 2003,2004 */  
20  /*   author: gross@access.edu.au */  /*   author: gross@access.edu.au */
21  /*   Version: $Id$ */  /*   Version: $Id$ */
22    
23  /**************************************************************/  /**************************************************************/
24    
 #include "escript/Data/DataC.h"  
 #include "Finley.h"  
25  #include "Util.h"  #include "Util.h"
26  #include "Assemble.h"  #include "Assemble.h"
 #include "NodeFile.h"  
27  #ifdef _OPENMP  #ifdef _OPENMP
28  #include <omp.h>  #include <omp.h>
29  #endif  #endif
# Line 30  void Finley_Assemble_CopyNodalData(Finle Line 37  void Finley_Assemble_CopyNodalData(Finle
37      dim_t numComps=getDataPointSize(out);      dim_t numComps=getDataPointSize(out);
38      type_t in_data_type=getFunctionSpaceType(in);      type_t in_data_type=getFunctionSpaceType(in);
39      type_t out_data_type=getFunctionSpaceType(out);      type_t out_data_type=getFunctionSpaceType(out);
40        Finley_resetError();
41    
42      /* check out and in */      /* check out and in */
43      if (numComps!=getDataPointSize(in)) {      if (numComps!=getDataPointSize(in)) {
44         Finley_ErrorCode=TYPE_ERROR;         Finley_setError(TYPE_ERROR,"__FILE__: number of components of input and output Data do not match.");
        sprintf(Finley_ErrorMsg,"number of components of input and output Data do not match.");  
45      } else if (!isExpanded(out)) {      } else if (!isExpanded(out)) {
46         Finley_ErrorCode=TYPE_ERROR;         Finley_setError(TYPE_ERROR,"__FILE__: expanded Data object is expected for output data.");
        sprintf(Finley_ErrorMsg,"expanded Data object is expected for output data.");  
47      }      }
48    
49      if (in_data_type == FINLEY_NODES) {      if (in_data_type == FINLEY_NODES) {
50          if (! numSamplesEqual(in,1,nodes->numNodes)) {          if (! numSamplesEqual(in,1,nodes->numNodes)) {
51                 Finley_ErrorCode=TYPE_ERROR;                 Finley_setError(TYPE_ERROR,"__FILE__: illegal number of samples of input Data object");
                sprintf(Finley_ErrorMsg,"illegal number of samples of input Data object");  
52         }         }
53      } else if (in_data_type == FINLEY_DEGREES_OF_FREEDOM) {      } else if (in_data_type == FINLEY_DEGREES_OF_FREEDOM) {
54          if (! numSamplesEqual(in,1,nodes->numDegreesOfFreedom)) {          if (! numSamplesEqual(in,1,nodes->numDegreesOfFreedom)) {
55                 Finley_ErrorCode=TYPE_ERROR;                 Finley_setError(TYPE_ERROR,"__FILE__: illegal number of samples of input Data object");
                sprintf(Finley_ErrorMsg,"illegal number of samples of input Data object");  
56         }         }
57      } else if (in_data_type == FINLEY_REDUCED_DEGREES_OF_FREEDOM) {      } else if (in_data_type == FINLEY_REDUCED_DEGREES_OF_FREEDOM) {
58          if (! numSamplesEqual(in,1,nodes->reducedNumDegreesOfFreedom)) {          if (! numSamplesEqual(in,1,nodes->reducedNumDegreesOfFreedom)) {
59                 Finley_ErrorCode=TYPE_ERROR;                 Finley_setError(TYPE_ERROR,"__FILE__: illegal number of samples of input Data object");
                sprintf(Finley_ErrorMsg,"illegal number of samples of input Data object");  
60         }         }
61      } else {      } else {
62         Finley_ErrorCode=TYPE_ERROR;         Finley_setError(TYPE_ERROR,"__FILE__: illegal function space type for target object");
        sprintf(Finley_ErrorMsg,"illegal function space type for target object");  
63      }      }
64            
65      if (out_data_type == FINLEY_NODES) {      if (out_data_type == FINLEY_NODES) {
66          if (! numSamplesEqual(out,1,nodes->numNodes)) {          if (! numSamplesEqual(out,1,nodes->numNodes)) {
67                 Finley_ErrorCode=TYPE_ERROR;                 Finley_setError(TYPE_ERROR,"__FILE__: illegal number of samples of output Data object");
                sprintf(Finley_ErrorMsg,"illegal number of samples of output Data object");  
68         }         }
69      } else if (out_data_type == FINLEY_DEGREES_OF_FREEDOM) {      } else if (out_data_type == FINLEY_DEGREES_OF_FREEDOM) {
70          if (! numSamplesEqual(out,1,nodes->numDegreesOfFreedom)) {          if (! numSamplesEqual(out,1,nodes->numDegreesOfFreedom)) {
71                 Finley_ErrorCode=TYPE_ERROR;                 Finley_setError(TYPE_ERROR,"__FILE__: illegal number of samples of output Data object");
                sprintf(Finley_ErrorMsg,"illegal number of samples of output Data object");  
72         }         }
73      } else if (out_data_type == FINLEY_REDUCED_DEGREES_OF_FREEDOM) {      } else if (out_data_type == FINLEY_REDUCED_DEGREES_OF_FREEDOM) {
74          if (! numSamplesEqual(out,1,nodes->reducedNumDegreesOfFreedom)) {          if (! numSamplesEqual(out,1,nodes->reducedNumDegreesOfFreedom)) {
75                 Finley_ErrorCode=TYPE_ERROR;                 Finley_setError(TYPE_ERROR,"__FILE__: illegal number of samples of output Data object");
                sprintf(Finley_ErrorMsg,"illegal number of samples of output Data object");  
76         }         }
77      } else {      } else {
78         Finley_ErrorCode=TYPE_ERROR;         Finley_setError(TYPE_ERROR,"__FILE__: illegal function space type for source object");
        sprintf(Finley_ErrorMsg,"illegal function space type for source object");  
79      }      }
80    
81      /* now we can start */      /* now we can start */
82    
83      if (Finley_ErrorCode==NO_ERROR) {      if (Finley_noError()) {
84          if (in_data_type == FINLEY_NODES) {          if (in_data_type == FINLEY_NODES) {
85             if  (out_data_type == FINLEY_NODES) {             if  (out_data_type == FINLEY_NODES) {
86                #pragma omp parallel for private(n) schedule(static)                #pragma omp parallel for private(n) schedule(static)
# Line 133  void Finley_Assemble_CopyNodalData(Finle Line 131  void Finley_Assemble_CopyNodalData(Finle
131                    if (n>=0) Finley_copyDouble(numComps,getSampleData(in,n),getSampleData(out,i));                    if (n>=0) Finley_copyDouble(numComps,getSampleData(in,n),getSampleData(out,i));
132                }                }
133             } else {             } else {
134               Finley_ErrorCode=TYPE_ERROR;               Finley_setError(TYPE_ERROR,"__FILE__: cannot copy from data on reduced degrees of freedom");
              sprintf(Finley_ErrorMsg,"cannot copy from data on reduced degrees of freedom");  
135             }             }
136          }          }
137     }     }
# Line 142  void Finley_Assemble_CopyNodalData(Finle Line 139  void Finley_Assemble_CopyNodalData(Finle
139  }  }
140  /*  /*
141   * $Log$   * $Log$
142     * 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   * Revision 1.3  2005/08/12 01:45:42  jgs   * 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   * erge of development branch dev-02 back to main trunk on 2005-08-12
147   *   *
148     * 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   * Revision 1.2.2.2  2005/08/09 02:23:12  gross   * Revision 1.2.2.2  2005/08/09 02:23:12  gross
152   * print statement removed   * print statement removed
153   *   *

Legend:
Removed from v.149  
changed lines
  Added in v.150

  ViewVC Help
Powered by ViewVC 1.1.26