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

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

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

trunk/esys2/finley/src/finleyC/Assemble_interpolate.c revision 123 by jgs, Fri Jul 8 04:08:13 2005 UTC trunk/finley/src/Assemble_interpolate.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    
# Line 6  Line 16 
16    
17  /**************************************************************/  /**************************************************************/
18    
19  /*   Copyrights by ACcESS Australia, 2003,2004 */  /*  Author: gross@access.edu.au */
20  /*   author: gross@access.edu.au */  /*  Version: $Id$ */
 /*   Version: $Id$ */  
21    
22  /**************************************************************/  /**************************************************************/
23    
 #include "Common.h"  
 #include "escript/Data/DataC.h"  
 #include "Finley.h"  
24  #include "Assemble.h"  #include "Assemble.h"
 #include "NodeFile.h"  
 #include "ElementFile.h"  
25  #include "Util.h"  #include "Util.h"
26  #ifdef _OPENMP  #ifdef _OPENMP
27  #include <omp.h>  #include <omp.h>
# Line 28  Line 32 
32    
33  void Finley_Assemble_interpolate(Finley_NodeFile *nodes, Finley_ElementFile* elements,escriptDataC* data,escriptDataC* interpolated_data) {  void Finley_Assemble_interpolate(Finley_NodeFile *nodes, Finley_ElementFile* elements,escriptDataC* data,escriptDataC* interpolated_data) {
34    double* local_data=NULL,*S=NULL,*data_array;    double* local_data=NULL,*S=NULL,*data_array;
35    index_t dof_offset,*resort_nodes;    index_t dof_offset,*resort_nodesi, NN, NS;
36    dim_t q,i,NS_DOF,NN_DOF,numNodes,e;    dim_t q,i,NS_DOF,NN_DOF,numNodes,e, numQuad;
37      dim_t numComps=getDataPointSize(data);
38      index_t id[MAX_numNodes], *resort_nodes;
39      type_t data_type=getFunctionSpaceType(data);
40    type_t type;    type_t type;
41      Finley_resetError();
42    #define NODES 0    #define NODES 0
43    #define DOF 1    #define DOF 1
44    #define REDUCED_DOF 2    #define REDUCED_DOF 2
45    if (nodes==NULL || elements==NULL) return;    if (nodes==NULL || elements==NULL) return;
46    dim_t NN=elements->ReferenceElement->Type->numNodes;    NN=elements->ReferenceElement->Type->numNodes;
47    dim_t NS=elements->ReferenceElement->Type->numShapes;    NS=elements->ReferenceElement->Type->numShapes;
48    dim_t numComps=getDataPointSize(data);    numQuad=elements->ReferenceElement->numQuadNodes;
   type_t data_type=getFunctionSpaceType(data);  
   dim_t numQuad=elements->ReferenceElement->numQuadNodes;  
   index_t id[NN];  
49    for (i=0;i<NN;i++) id[i]=i;    for (i=0;i<NN;i++) id[i]=i;
50    
51    /* set some parameter */    /* set some parameter */
# Line 67  void Finley_Assemble_interpolate(Finley_ Line 72  void Finley_Assemble_interpolate(Finley_
72         S=elements->LinearReferenceElement->S;         S=elements->LinearReferenceElement->S;
73         numNodes=nodes->reducedNumDegreesOfFreedom;         numNodes=nodes->reducedNumDegreesOfFreedom;
74     } else {     } else {
75         Finley_ErrorCode=TYPE_ERROR;         Finley_setError(TYPE_ERROR,"__FILE__: Cannot interpolate data");
        sprintf(Finley_ErrorMsg,"Cannot interpolate data");  
76    }    }
77    
78    if (getFunctionSpaceType(interpolated_data)==FINLEY_CONTACT_ELEMENTS_2) {    if (getFunctionSpaceType(interpolated_data)==FINLEY_CONTACT_ELEMENTS_2) {
# Line 80  void Finley_Assemble_interpolate(Finley_ Line 84  void Finley_Assemble_interpolate(Finley_
84    /* check the dimensions of interpolated_data and data */    /* check the dimensions of interpolated_data and data */
85    
86    if (! numSamplesEqual(interpolated_data,numQuad,elements->numElements)) {    if (! numSamplesEqual(interpolated_data,numQuad,elements->numElements)) {
87         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");  
88    } else if (! numSamplesEqual(data,1,numNodes)) {    } else if (! numSamplesEqual(data,1,numNodes)) {
89         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");  
90    } else if (numComps!=getDataPointSize(interpolated_data)) {    } else if (numComps!=getDataPointSize(interpolated_data)) {
91         Finley_ErrorCode=TYPE_ERROR;         Finley_setError(TYPE_ERROR,"__FILE__: number of components of input and interpolated Data do not match.");
        sprintf(Finley_ErrorMsg,"number of components of input and interpolated Data do not match.");  
92    }  else if (!isExpanded(interpolated_data)) {    }  else if (!isExpanded(interpolated_data)) {
93         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.");  
94    }    }
95    
96    /* now we can start */    /* now we can start */
97    
98    if (Finley_ErrorCode==NO_ERROR) {    if (Finley_noError()) {
99         #pragma omp parallel private(local_data)         #pragma omp parallel private(local_data)
100         {         {
101            local_data=NULL;            local_data=NULL;
# Line 148  void Finley_Assemble_interpolate(Finley_ Line 148  void Finley_Assemble_interpolate(Finley_
148  }  }
149  /*  /*
150   * $Log$   * $Log$
151     * Revision 1.6  2005/09/15 03:44:21  jgs
152     * Merge of development branch dev-02 back to main trunk on 2005-09-15
153     *
154     * Revision 1.5.2.1  2005/09/07 06:26:18  gross
155     * the solver from finley are put into the standalone package paso now
156     *
157   * Revision 1.5  2005/07/08 04:07:48  jgs   * Revision 1.5  2005/07/08 04:07:48  jgs
158   * Merge of development branch back to main trunk on 2005-07-08   * Merge of development branch back to main trunk on 2005-07-08
159   *   *

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

  ViewVC Help
Powered by ViewVC 1.1.26