/[escript]/trunk/dudley/src/Assemble_CopyElementData.cpp
ViewVC logotype

Diff of /trunk/dudley/src/Assemble_CopyElementData.cpp

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

trunk/esys2/finley/src/finleyC/Assemble_CopyElementData.c revision 123 by jgs, Fri Jul 8 04:08:13 2005 UTC trunk/finley/src/Assemble_CopyElementData.c revision 1028 by gross, Wed Mar 14 00:15:24 2007 UTC
# Line 1  Line 1 
1  /* $Id$ */  /*
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       */  /*    assemblage routines: copies data between elements       */
15    
16  /**************************************************************/  /**************************************************************/
17    
 /*   Copyrights by ACcESS Australia, 2003,2004 */  
18  /*   author: gross@access.edu.au */  /*   author: gross@access.edu.au */
19  /*   Version: $Id$ */  /*   Version: $Id$ */
20    
21  /**************************************************************/  /**************************************************************/
22    
 #include "escript/Data/DataC.h"  
 #include "Util.h"  
 #include "Finley.h"  
23  #include "Assemble.h"  #include "Assemble.h"
24  #include "ElementFile.h"  #include "Util.h"
25  #ifdef _OPENMP  #ifdef _OPENMP
26  #include <omp.h>  #include <omp.h>
27  #endif  #endif
# Line 24  Line 29 
29    
30    
31  void Finley_Assemble_CopyElementData(Finley_ElementFile* elements,escriptDataC* out,escriptDataC* in) {  void Finley_Assemble_CopyElementData(Finley_ElementFile* elements,escriptDataC* out,escriptDataC* in) {
32      if (elements==NULL) return;      dim_t n,q, numElements, numQuad;
     dim_t n,q;  
     dim_t numElements=elements->numElements;  
     dim_t numQuad=elements->ReferenceElement->numQuadNodes;  
33      dim_t numComps=getDataPointSize(out);      dim_t numComps=getDataPointSize(out);
34      double *in_array,*out_array;      double *in_array,*out_array;
35        Finley_resetError();
36    
37        if (elements==NULL) return;
38        numElements=elements->numElements;
39        numQuad=elements->ReferenceElement->numQuadNodes;
40    
41      /* check out and in */      /* check out and in */
42      if (numComps!=getDataPointSize(in)) {      if (numComps!=getDataPointSize(in)) {
43         Finley_ErrorCode=TYPE_ERROR;         Finley_setError(TYPE_ERROR,"__FILE__: number of components of input and output Data do not match.");
44         sprintf(Finley_ErrorMsg,"number of components of input and output Data do not match.");      } else if (!numSamplesEqual(in,numQuad,numElements)) {
45      } else if (numSamplesEqual(out,numQuad,numElements)) {         Finley_setError(TYPE_ERROR,"__FILE__: illegal number of samples of input Data object");
46         Finley_ErrorCode=TYPE_ERROR;      } else if (!numSamplesEqual(out,numQuad,numElements)) {
47         sprintf(Finley_ErrorMsg,"illegal number of samples of output Data object");         Finley_setError(TYPE_ERROR,"__FILE__: illegal number of samples of output Data object");
     } else if (numSamplesEqual(in,numQuad,numElements)) {  
        Finley_ErrorCode=TYPE_ERROR;  
        sprintf(Finley_ErrorMsg,"illegal number of samples of input Data object");  
48      } else if (!isExpanded(out)) {      } else if (!isExpanded(out)) {
49         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.");  
50      }      }
51    
52      /* now we can start */      /* now we can start */
53    
54      if (Finley_ErrorCode==NO_ERROR) {      if (Finley_noError()) {
55           if (isExpanded(in)) {           if (isExpanded(in)) {
56               # pragma omp parallel for private(n) schedule(static)               # pragma omp parallel for private(n) schedule(static)
57               for (n=0;n<numElements;n++)               for (n=0;n<numElements;n++)
# Line 66  void Finley_Assemble_CopyElementData(Fin Line 69  void Finley_Assemble_CopyElementData(Fin
69  }  }
70  /*  /*
71   * $Log$   * $Log$
72     * Revision 1.4  2005/09/15 03:44:21  jgs
73     * Merge of development branch dev-02 back to main trunk on 2005-09-15
74     *
75     * Revision 1.3  2005/08/12 01:45:42  jgs
76     * erge of development branch dev-02 back to main trunk on 2005-08-12
77     *
78     * Revision 1.2.2.2  2005/09/07 06:26:17  gross
79     * the solver from finley are put into the standalone package paso now
80     *
81     * Revision 1.2.2.1  2005/08/02 05:29:11  gross
82     * bug in finley/src/Assemble_CopyElementData fixed
83     *
84   * Revision 1.2  2005/07/08 04:07:45  jgs   * Revision 1.2  2005/07/08 04:07:45  jgs
85   * Merge of development branch back to main trunk on 2005-07-08   * Merge of development branch back to main trunk on 2005-07-08
86   *   *

Legend:
Removed from v.123  
changed lines
  Added in v.1028

  ViewVC Help
Powered by ViewVC 1.1.26