/[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

revision 82 by jgs, Tue Oct 26 06:53:54 2004 UTC revision 123 by jgs, Fri Jul 8 04:08:13 2005 UTC
# Line 28  Line 28 
28    
29  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) {
30    double* local_data=NULL,*S=NULL,*data_array;    double* local_data=NULL,*S=NULL,*data_array;
31    int dof_offset,q,*resort_nodes,type,i,NS_DOF,NN_DOF,numNodes,e;    index_t dof_offset,*resort_nodes;
32      dim_t q,i,NS_DOF,NN_DOF,numNodes,e;
33      type_t type;
34    #define NODES 0    #define NODES 0
35    #define DOF 1    #define DOF 1
36    #define REDUCED_DOF 2    #define REDUCED_DOF 2
37    if (nodes==NULL || elements==NULL) return;    if (nodes==NULL || elements==NULL) return;
38    int NN=elements->ReferenceElement->Type->numNodes;    dim_t NN=elements->ReferenceElement->Type->numNodes;
39    int NS=elements->ReferenceElement->Type->numShapes;    dim_t NS=elements->ReferenceElement->Type->numShapes;
40    int numComps=getDataPointSize(data);    dim_t numComps=getDataPointSize(data);
41    int data_type=getFunctionSpaceType(data);    type_t data_type=getFunctionSpaceType(data);
42    int numQuad=elements->ReferenceElement->numQuadNodes;    dim_t numQuad=elements->ReferenceElement->numQuadNodes;
43    int id[NN];    index_t id[NN];
44    for (i=0;i<NN;i++) id[i]=i;    for (i=0;i<NN;i++) id[i]=i;
45    
46    /* set some parameter */    /* set some parameter */
# Line 98  void Finley_Assemble_interpolate(Finley_ Line 100  void Finley_Assemble_interpolate(Finley_
100         {         {
101            local_data=NULL;            local_data=NULL;
102            /* allocation of work arrays */            /* allocation of work arrays */
103            local_data=(double*) THREAD_MEMALLOC(NS*numComps*sizeof(double));            local_data=THREAD_MEMALLOC(NS*numComps,double);
104            if (! Finley_checkPtr(local_data)) {            if (! Finley_checkPtr(local_data)) {
105    
106          /* open the element loop */          /* open the element loop */
# Line 112  void Finley_Assemble_interpolate(Finley_ Line 114  void Finley_Assemble_interpolate(Finley_
114                             i=elements->Nodes[INDEX2(resort_nodes[dof_offset+q],e,NN)];                             i=elements->Nodes[INDEX2(resort_nodes[dof_offset+q],e,NN)];
115                             data_array=getSampleData(data,i);                             data_array=getSampleData(data,i);
116                             Finley_copyDouble(numComps,data_array,local_data+q*numComps);                             Finley_copyDouble(numComps,data_array,local_data+q*numComps);
117                            }
118                          break;                          break;
119                   case DOF:                   case DOF:
120                          for (q=0;q<NS_DOF;q++) {                          for (q=0;q<NS_DOF;q++) {
# Line 137  void Finley_Assemble_interpolate(Finley_ Line 140  void Finley_Assemble_interpolate(Finley_
140    
141            }            }
142        THREAD_MEMFREE(local_data);        THREAD_MEMFREE(local_data);
143          }       } /* end of parallel region */
       }  
144    }    }
145    #undef NODES    #undef NODES
146    #undef DOF    #undef DOF
# Line 146  void Finley_Assemble_interpolate(Finley_ Line 148  void Finley_Assemble_interpolate(Finley_
148  }  }
149  /*  /*
150   * $Log$   * $Log$
151   * Revision 1.1  2004/10/26 06:53:57  jgs   * Revision 1.5  2005/07/08 04:07:48  jgs
152   * Initial revision   * Merge of development branch back to main trunk on 2005-07-08
153     *
154     * Revision 1.4  2004/12/15 07:08:32  jgs
155     * *** empty log message ***
156     * Revision 1.1.1.1.2.3  2005/06/29 02:34:48  gross
157     * some changes towards 64 integers in finley
158   *   *
159   * Revision 1.2  2004/07/21 05:00:54  gross   * Revision 1.1.1.1.2.2  2004/11/24 01:37:12  gross
160   * name changes in DataC   * some changes dealing with the integer overflow in memory allocation. Finley solves 4M unknowns now
161   *   *
  * Revision 1.1  2004/07/02 04:21:13  gross  
  * Finley C code has been included  
162   *   *
163   *   *
164   */   */

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

  ViewVC Help
Powered by ViewVC 1.1.26