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

Diff of /trunk/finley/src/Assemble_LumpedSystem.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 149 by jgs, Thu Sep 1 03:31:39 2005 UTC
# Line 52  void Finley_Assemble_PDE(Finley_NodeFile Line 52  void Finley_Assemble_PDE(Finley_NodeFile
52    
53    double *EM_S=NULL,*EM_F=NULL,*V=NULL,*dVdv=NULL,*dSdV=NULL,*Vol=NULL,*dvdV=NULL;    double *EM_S=NULL,*EM_F=NULL,*V=NULL,*dVdv=NULL,*dSdV=NULL,*Vol=NULL,*dvdV=NULL;
54    double time0;    double time0;
55    int dimensions[ESCRIPT_MAX_DATA_RANK],e,q,color;    dim_t dimensions[ESCRIPT_MAX_DATA_RANK],e,q;
56    Assemble_Parameters p;    Assemble_Parameters p;
57    maybelong *index_row=NULL,*index_col=NULL;    index_t *index_row=NULL,*index_col=NULL,color;
58    
59    if (nodes==NULL || elements==NULL) return;    if (nodes==NULL || elements==NULL) return;
60    if (S==NULL && isEmpty(F)) return;    if (S==NULL && isEmpty(F)) return;
# Line 75  void Finley_Assemble_PDE(Finley_NodeFile Line 75  void Finley_Assemble_PDE(Finley_NodeFile
75      return;      return;
76    }    }
77    /*  get a functionspace */    /*  get a functionspace */
78    int funcspace=UNKNOWN;    type_t funcspace=UNKNOWN;
79    updateFunctionSpaceType(funcspace,A);    updateFunctionSpaceType(funcspace,A);
80    updateFunctionSpaceType(funcspace,B);    updateFunctionSpaceType(funcspace,B);
81    updateFunctionSpaceType(funcspace,C);    updateFunctionSpaceType(funcspace,C);
# Line 88  void Finley_Assemble_PDE(Finley_NodeFile Line 88  void Finley_Assemble_PDE(Finley_NodeFile
88    
89    if (! functionSpaceTypeEqual(funcspace,A) ) {    if (! functionSpaceTypeEqual(funcspace,A) ) {
90          Finley_ErrorCode=TYPE_ERROR;          Finley_ErrorCode=TYPE_ERROR;
91          sprintf(Finley_ErrorMsg,"unexpected function space typ for coefficient A");          sprintf(Finley_ErrorMsg,"unexpected function space type for coefficient A");
92    }    }
93    if (! functionSpaceTypeEqual(funcspace,B) ) {    if (! functionSpaceTypeEqual(funcspace,B) ) {
94          Finley_ErrorCode=TYPE_ERROR;          Finley_ErrorCode=TYPE_ERROR;
95          sprintf(Finley_ErrorMsg,"unexpected function space typ for coefficient B");          sprintf(Finley_ErrorMsg,"unexpected function space type for coefficient B");
96    }    }
97    if (! functionSpaceTypeEqual(funcspace,C) ) {    if (! functionSpaceTypeEqual(funcspace,C) ) {
98          Finley_ErrorCode=TYPE_ERROR;          Finley_ErrorCode=TYPE_ERROR;
99          sprintf(Finley_ErrorMsg,"unexpected function space typ for coefficient C");          sprintf(Finley_ErrorMsg,"unexpected function space type for coefficient C");
100    }    }
101    if (! functionSpaceTypeEqual(funcspace,D) ) {    if (! functionSpaceTypeEqual(funcspace,D) ) {
102          Finley_ErrorCode=TYPE_ERROR;          Finley_ErrorCode=TYPE_ERROR;
103          sprintf(Finley_ErrorMsg,"unexpected function space typ for coefficient D");          sprintf(Finley_ErrorMsg,"unexpected function space type for coefficient D");
104    }    }
105    if (! functionSpaceTypeEqual(funcspace,X) ) {    if (! functionSpaceTypeEqual(funcspace,X) ) {
106          Finley_ErrorCode=TYPE_ERROR;          Finley_ErrorCode=TYPE_ERROR;
107          sprintf(Finley_ErrorMsg,"unexpected function space typ for coefficient X");          sprintf(Finley_ErrorMsg,"unexpected function space type for coefficient X");
108    }    }
109    if (! functionSpaceTypeEqual(funcspace,Y) ) {    if (! functionSpaceTypeEqual(funcspace,Y) ) {
110          Finley_ErrorCode=TYPE_ERROR;          Finley_ErrorCode=TYPE_ERROR;
111          sprintf(Finley_ErrorMsg,"unexpected function space typ for coefficient Y");          sprintf(Finley_ErrorMsg,"unexpected function space type for coefficient Y");
112    }    }
113    
114    /* check if all function spaces are the same */    /* check if all function spaces are the same */
# Line 251  void Finley_Assemble_PDE(Finley_NodeFile Line 251  void Finley_Assemble_PDE(Finley_NodeFile
251    
252           /* allocate work arrays: */           /* allocate work arrays: */
253    
254           EM_S=(double*) THREAD_MEMALLOC(p.NN_row*p.NN_col*p.numEqu*p.numComp*sizeof(double));           EM_S=(double*) THREAD_MEMALLOC(p.NN_row*p.NN_col*p.numEqu*p.numComp,double);
255           EM_F=(double*) THREAD_MEMALLOC(p.NN_row*p.numEqu*sizeof(double));           EM_F=(double*) THREAD_MEMALLOC(p.NN_row*p.numEqu,double);
256           V=(double*) THREAD_MEMALLOC(p.NN*p.numDim*sizeof(double));           V=(double*) THREAD_MEMALLOC(p.NN*p.numDim,double);
257           dVdv=(double*) THREAD_MEMALLOC(p.numDim*p.numDim*p.numQuad*sizeof(double));           dVdv=(double*) THREAD_MEMALLOC(p.numDim*p.numDim*p.numQuad,double);
258           dvdV=(double*) THREAD_MEMALLOC(p.numDim*p.numDim*p.numQuad*sizeof(double));           dvdV=(double*) THREAD_MEMALLOC(p.numDim*p.numDim*p.numQuad,double);
259           dSdV=(double*) THREAD_MEMALLOC(p.NS_row*p.numQuad*p.numDim*sizeof(double));           dSdV=(double*) THREAD_MEMALLOC(p.NS_row*p.numQuad*p.numDim,double);
260           Vol=(double*) THREAD_MEMALLOC(p.numQuad*sizeof(double));           Vol=(double*) THREAD_MEMALLOC(p.numQuad,double);
261           index_col=(maybelong*) THREAD_MEMALLOC(p.NN_col*sizeof(maybelong));           index_col=(index_t*) THREAD_MEMALLOC(p.NN_col,index_t);
262           index_row=(maybelong*) THREAD_MEMALLOC(p.NN_row*sizeof(maybelong));           index_row=(index_t*) THREAD_MEMALLOC(p.NN_row,index_t);
263    
264           if (! (Finley_checkPtr(EM_S) || Finley_checkPtr(EM_F) || Finley_checkPtr(V) || Finley_checkPtr(index_col) ||           if (! (Finley_checkPtr(EM_S) || Finley_checkPtr(EM_F) || Finley_checkPtr(V) || Finley_checkPtr(index_col) ||
265                  Finley_checkPtr(index_row) || Finley_checkPtr(dVdv) || Finley_checkPtr(dSdV) || Finley_checkPtr(Vol) ))  {                  Finley_checkPtr(index_row) || Finley_checkPtr(dVdv) || Finley_checkPtr(dSdV) || Finley_checkPtr(Vol) ))  {
266    
267             /*  open loop over all colors: */             /*  open loop over all colors: */
268             for (color=0;color<elements->numColors;color++) {             for (color=elements->minColor;color<=elements->maxColor;color++) {
269                /*  open loop over all elements: */                /*  open loop over all elements: */
270                #pragma omp for private(e) schedule(static)                #pragma omp for private(e) schedule(static)
271                for(e=0;e<elements->numElements;e++){                for(e=0;e<elements->numElements;e++){
# Line 337  void Finley_Assemble_PDE(Finley_NodeFile Line 337  void Finley_Assemble_PDE(Finley_NodeFile
337           THREAD_MEMFREE(index_col);           THREAD_MEMFREE(index_col);
338           THREAD_MEMFREE(index_row);           THREAD_MEMFREE(index_row);
339       }       }
340         #ifdef Finley_TRACE
341       printf("timing: assemblage PDE: %.4e sec\n",Finley_timer()-time0);       printf("timing: assemblage PDE: %.4e sec\n",Finley_timer()-time0);
342         #endif
343    }    }
344  }  }
345  /*  /*
346   * $Log$   * $Log$
347   * Revision 1.1  2004/10/26 06:53:57  jgs   * Revision 1.7  2005/09/01 03:31:35  jgs
348   * Initial revision   * Merge of development branch dev-02 back to main trunk on 2005-09-01
349   *   *
350   * Revision 1.3  2004/07/30 04:37:06  gross   * Revision 1.6  2005/08/12 01:45:42  jgs
351   * escript and finley are linking now and RecMeshTest.py has been passed   * erge of development branch dev-02 back to main trunk on 2005-08-12
352   *   *
353   * Revision 1.2  2004/07/21 05:00:54  gross   * Revision 1.5.2.2  2005/08/24 02:02:18  gross
354   * name changes in DataC   * timing output switched off. solver output can be swiched through getSolution(verbose=True) now.
355     *
356     * Revision 1.5.2.1  2005/08/03 08:54:27  gross
357     * contact element assemblage was called with wrong element table pointer
358     *
359     * Revision 1.5  2005/07/08 04:07:46  jgs
360     * Merge of development branch back to main trunk on 2005-07-08
361     *
362     * Revision 1.4  2004/12/15 07:08:32  jgs
363     * *** empty log message ***
364     * Revision 1.1.1.1.2.2  2005/06/29 02:34:47  gross
365     * some changes towards 64 integers in finley
366     *
367     * Revision 1.1.1.1.2.1  2004/11/24 01:37:12  gross
368     * some changes dealing with the integer overflow in memory allocation. Finley solves 4M unknowns now
369   *   *
  * Revision 1.1  2004/07/02 04:21:13  gross  
  * Finley C code has been included  
370   *   *
371   *   *
372   */   */

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

  ViewVC Help
Powered by ViewVC 1.1.26