/[escript]/temp/finley/src/Assemble_jacobeans.c
ViewVC logotype

Diff of /temp/finley/src/Assemble_jacobeans.c

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

trunk/esys2/finley/src/finleyC/Assemble_PDE.c revision 82 by jgs, Tue Oct 26 06:53:54 2004 UTC trunk/finley/src/Assemble_PDE.c revision 616 by elspeth, Wed Mar 22 02:46:56 2006 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  /**************************************************************/  /**************************************************************/
15    
# Line 28  Line 39 
39    
40  /**************************************************************/  /**************************************************************/
41    
42  /*   Copyrights by ACcESS Australia, 2003,2004 */  /*  Author: gross@access.edu.au */
43  /*   author: gross@access.edu.au */  /*  Version: $Id$ */
 /*   Version: $Id$ */  
44    
45  /**************************************************************/  /**************************************************************/
46    
 #include "escript/Data/DataC.h"  
 #include "Finley.h"  
47  #include "Assemble.h"  #include "Assemble.h"
 #include "NodeFile.h"  
 #include "ElementFile.h"  
48  #include "Util.h"  #include "Util.h"
49  #ifdef _OPENMP  #ifdef _OPENMP
50  #include <omp.h>  #include <omp.h>
# Line 47  Line 53 
53    
54  /**************************************************************/  /**************************************************************/
55    
56  void Finley_Assemble_PDE(Finley_NodeFile* nodes,Finley_ElementFile* elements,Finley_SystemMatrix* S, escriptDataC* F,  void Finley_Assemble_PDE(Finley_NodeFile* nodes,Finley_ElementFile* elements,Paso_SystemMatrix* S, escriptDataC* F,
57               escriptDataC* A, escriptDataC* B, escriptDataC* C, escriptDataC* D, escriptDataC* X, escriptDataC* Y ) {               escriptDataC* A, escriptDataC* B, escriptDataC* C, escriptDataC* D, escriptDataC* X, escriptDataC* Y ) {
58    
59      char error_msg[LenErrorMsg_MAX];
60    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;
61    double time0;    double time0;
62    int dimensions[ESCRIPT_MAX_DATA_RANK],e,q,color;    dim_t dimensions[ESCRIPT_MAX_DATA_RANK],e,q;
63    Assemble_Parameters p;    Assemble_Parameters p;
64    maybelong *index_row=NULL,*index_col=NULL;    index_t *index_row=NULL,*index_col=NULL,color;
65      Finley_resetError();
66    
67    if (nodes==NULL || elements==NULL) return;    if (nodes==NULL || elements==NULL) return;
68    if (S==NULL && isEmpty(F)) return;    if (S==NULL && isEmpty(F)) return;
69    
70    /* set all parameters in p*/    /* set all parameters in p*/
71    Assemble_getAssembleParameters(nodes,elements,S,F,&p);    Assemble_getAssembleParameters(nodes,elements,S,F,&p);
72    if (Finley_ErrorCode!=NO_ERROR) return;    if (! Finley_noError()) return;
73    
74    /*  this function assumes NS=NN */    /*  this function assumes NS=NN */
75    if (p.NN!=p.NS) {    if (p.NN!=p.NS) {
76      Finley_ErrorCode=SYSTEM_ERROR;      Finley_setError(SYSTEM_ERROR,"Finley_Assemble_PDE: for Finley_Assemble_PDE numNodes and numShapes have to be identical.");
     sprintf(Finley_ErrorMsg,"for Finley_Assemble_PDE numNodes and numShapes have to be identical.");  
77      return;      return;
78    }    }
79    if (p.numDim!=p.numElementDim) {    if (p.numDim!=p.numElementDim) {
80      Finley_ErrorCode=SYSTEM_ERROR;      Finley_setError(SYSTEM_ERROR,"Finley_Assemble_PDE: Finley_Assemble_PDE accepts volume elements only.");
     sprintf(Finley_ErrorMsg,"Finley_Assemble_PDE accepts volume elements only.");  
81      return;      return;
82    }    }
83    /*  get a functionspace */    /*  get a functionspace */
84    int funcspace=UNKNOWN;    type_t funcspace=UNKNOWN;
85    updateFunctionSpaceType(funcspace,A);    updateFunctionSpaceType(funcspace,A);
86    updateFunctionSpaceType(funcspace,B);    updateFunctionSpaceType(funcspace,B);
87    updateFunctionSpaceType(funcspace,C);    updateFunctionSpaceType(funcspace,C);
# Line 87  void Finley_Assemble_PDE(Finley_NodeFile Line 93  void Finley_Assemble_PDE(Finley_NodeFile
93    /* check if all function spaces are the same */    /* check if all function spaces are the same */
94    
95    if (! functionSpaceTypeEqual(funcspace,A) ) {    if (! functionSpaceTypeEqual(funcspace,A) ) {
96          Finley_ErrorCode=TYPE_ERROR;          Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE: unexpected function space type for coefficient A");
         sprintf(Finley_ErrorMsg,"unexpected function space typ for coefficient A");  
97    }    }
98    if (! functionSpaceTypeEqual(funcspace,B) ) {    if (! functionSpaceTypeEqual(funcspace,B) ) {
99          Finley_ErrorCode=TYPE_ERROR;          Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE: unexpected function space type for coefficient B");
         sprintf(Finley_ErrorMsg,"unexpected function space typ for coefficient B");  
100    }    }
101    if (! functionSpaceTypeEqual(funcspace,C) ) {    if (! functionSpaceTypeEqual(funcspace,C) ) {
102          Finley_ErrorCode=TYPE_ERROR;          Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE: unexpected function space type for coefficient C");
         sprintf(Finley_ErrorMsg,"unexpected function space typ for coefficient C");  
103    }    }
104    if (! functionSpaceTypeEqual(funcspace,D) ) {    if (! functionSpaceTypeEqual(funcspace,D) ) {
105          Finley_ErrorCode=TYPE_ERROR;          Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE: unexpected function space type for coefficient D");
         sprintf(Finley_ErrorMsg,"unexpected function space typ for coefficient D");  
106    }    }
107    if (! functionSpaceTypeEqual(funcspace,X) ) {    if (! functionSpaceTypeEqual(funcspace,X) ) {
108          Finley_ErrorCode=TYPE_ERROR;          Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE: unexpected function space type for coefficient X");
         sprintf(Finley_ErrorMsg,"unexpected function space typ for coefficient X");  
109    }    }
110    if (! functionSpaceTypeEqual(funcspace,Y) ) {    if (! functionSpaceTypeEqual(funcspace,Y) ) {
111          Finley_ErrorCode=TYPE_ERROR;          Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE: unexpected function space type for coefficient Y");
         sprintf(Finley_ErrorMsg,"unexpected function space typ for coefficient Y");  
112    }    }
113    
114    /* check if all function spaces are the same */    /* check if all function spaces are the same */
115    
116    if (! numSamplesEqual(A,p.numQuad,elements->numElements) ) {    if (! numSamplesEqual(A,p.numQuad,elements->numElements) ) {
117          Finley_ErrorCode=TYPE_ERROR;          sprintf(error_msg,"Finley_Assemble_PDE: sample points of coefficient A don't match (%d,%d)",p.numQuad,elements->numElements);
118          sprintf(Finley_ErrorMsg,"sample points of coefficient A don't match (%d,%d)",p.numQuad,elements->numElements);          Finley_setError(TYPE_ERROR,error_msg);
119    }    }
120    
121    if (! numSamplesEqual(B,p.numQuad,elements->numElements) ) {    if (! numSamplesEqual(B,p.numQuad,elements->numElements) ) {
122          Finley_ErrorCode=TYPE_ERROR;          sprintf(error_msg,"Finley_Assemble_PDE: sample points of coefficient B don't match (%d,%d)",p.numQuad,elements->numElements);
123          sprintf(Finley_ErrorMsg,"sample points of coefficient B don't match (%d,%d)",p.numQuad,elements->numElements);          Finley_setError(TYPE_ERROR,error_msg);
124    }    }
125    
126    if (! numSamplesEqual(C,p.numQuad,elements->numElements) ) {    if (! numSamplesEqual(C,p.numQuad,elements->numElements) ) {
127          Finley_ErrorCode=TYPE_ERROR;          sprintf(error_msg,"Finley_Assemble_PDE: sample points of coefficient C don't match (%d,%d)",p.numQuad,elements->numElements);
128          sprintf(Finley_ErrorMsg,"sample points of coefficient C don't match (%d,%d)",p.numQuad,elements->numElements);          Finley_setError(TYPE_ERROR,error_msg);
129    }    }
130    
131    if (! numSamplesEqual(D,p.numQuad,elements->numElements) ) {    if (! numSamplesEqual(D,p.numQuad,elements->numElements) ) {
132          Finley_ErrorCode=TYPE_ERROR;          sprintf(error_msg,"Finley_Assemble_PDE: sample points of coefficient D don't match (%d,%d)",p.numQuad,elements->numElements);
133          sprintf(Finley_ErrorMsg,"sample points of coefficient D don't match (%d,%d)",p.numQuad,elements->numElements);          Finley_setError(TYPE_ERROR,error_msg);
134    }    }
135    
136    if (! numSamplesEqual(X,p.numQuad,elements->numElements) ) {    if (! numSamplesEqual(X,p.numQuad,elements->numElements) ) {
137          Finley_ErrorCode=TYPE_ERROR;          sprintf(error_msg,"Finley_Assemble_PDE: sample points of coefficient X don't match (%d,%d)",p.numQuad,elements->numElements);
138          sprintf(Finley_ErrorMsg,"sample points of coefficient X don't match (%d,%d)",p.numQuad,elements->numElements);          Finley_setError(TYPE_ERROR,error_msg);
139    }    }
140    
141    if (! numSamplesEqual(Y,p.numQuad,elements->numElements) ) {    if (! numSamplesEqual(Y,p.numQuad,elements->numElements) ) {
142          Finley_ErrorCode=TYPE_ERROR;          sprintf(error_msg,"Finley_Assemble_PDE: sample points of coefficient Y don't match (%d,%d)",p.numQuad,elements->numElements);
143          sprintf(Finley_ErrorMsg,"sample points of coefficient Y don't match (%d,%d)",p.numQuad,elements->numElements);          Finley_setError(TYPE_ERROR,error_msg);
144    }    }
145    
146    /*  check the dimensions: */    /*  check the dimensions: */
# Line 150  void Finley_Assemble_PDE(Finley_NodeFile Line 150  void Finley_Assemble_PDE(Finley_NodeFile
150        dimensions[0]=p.numDim;        dimensions[0]=p.numDim;
151        dimensions[1]=p.numDim;        dimensions[1]=p.numDim;
152        if (!isDataPointShapeEqual(A,2,dimensions)) {        if (!isDataPointShapeEqual(A,2,dimensions)) {
153            Finley_ErrorCode=TYPE_ERROR;            sprintf(error_msg,"Finley_Assemble_PDE: coefficient A: illegal shape, expected shape (%d,%d)",dimensions[0],dimensions[1]);
154            sprintf(Finley_ErrorMsg,"coefficient A: illegal shape, expected shape (%d,%d)",dimensions[0],dimensions[1]);            Finley_setError(TYPE_ERROR,error_msg);
155        }        }
156      }      }
157      if (!isEmpty(B)) {      if (!isEmpty(B)) {
158         dimensions[0]=p.numDim;         dimensions[0]=p.numDim;
159         if (!isDataPointShapeEqual(B,1,dimensions)) {         if (!isDataPointShapeEqual(B,1,dimensions)) {
160            Finley_ErrorCode=TYPE_ERROR;            sprintf(error_msg,"Finley_Assemble_PDE: coefficient B: illegal shape (%d,)",dimensions[0]);
161            sprintf(Finley_ErrorMsg,"coefficient B: illegal shape (%d,)",dimensions[0]);            Finley_setError(TYPE_ERROR,error_msg);
162         }         }
163      }      }
164      if (!isEmpty(C)) {      if (!isEmpty(C)) {
165         dimensions[0]=p.numDim;         dimensions[0]=p.numDim;
166         if (!isDataPointShapeEqual(C,1,dimensions)) {         if (!isDataPointShapeEqual(C,1,dimensions)) {
167            Finley_ErrorCode=TYPE_ERROR;            sprintf(error_msg,"Finley_Assemble_PDE: coefficient C, expected shape (%d,)",dimensions[0]);
168            sprintf(Finley_ErrorMsg,"coefficient C, expected shape (%d,)",dimensions[0]);            Finley_setError(TYPE_ERROR,error_msg);
169         }         }
170      }      }
171      if (!isEmpty(D)) {      if (!isEmpty(D)) {
172         if (!isDataPointShapeEqual(D,0,dimensions)) {         if (!isDataPointShapeEqual(D,0,dimensions)) {
173            Finley_ErrorCode=TYPE_ERROR;            Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE: coefficient D, rank 0 expected.");
           sprintf(Finley_ErrorMsg,"coefficient D, rank 0 expected.");  
174         }         }
175      }      }
176      if (!isEmpty(X)) {      if (!isEmpty(X)) {
177         dimensions[0]=p.numDim;         dimensions[0]=p.numDim;
178         if (!isDataPointShapeEqual(X,1,dimensions)) {         if (!isDataPointShapeEqual(X,1,dimensions)) {
179            Finley_ErrorCode=TYPE_ERROR;            sprintf(error_msg,"Finley_Assemble_PDE: coefficient X, expected shape (%d,",dimensions[0]);
180            sprintf(Finley_ErrorMsg,"coefficient X, expected shape (%d,",dimensions[0]);            Finley_setError(TYPE_ERROR,error_msg);
181         }         }
182      }      }
183      if (!isEmpty(Y)) {      if (!isEmpty(Y)) {
184         if (!isDataPointShapeEqual(Y,0,dimensions)) {         if (!isDataPointShapeEqual(Y,0,dimensions)) {
185            Finley_ErrorCode=TYPE_ERROR;            Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE: coefficient Y, rank 0 expected.");
           sprintf(Finley_ErrorMsg,"coefficient Y, rank 0 expected.");  
186         }         }
187      }      }
188    } else {    } else {
# Line 194  void Finley_Assemble_PDE(Finley_NodeFile Line 192  void Finley_Assemble_PDE(Finley_NodeFile
192        dimensions[2]=p.numComp;        dimensions[2]=p.numComp;
193        dimensions[3]=p.numDim;        dimensions[3]=p.numDim;
194        if (!isDataPointShapeEqual(A,4,dimensions)) {        if (!isDataPointShapeEqual(A,4,dimensions)) {
195            Finley_ErrorCode=TYPE_ERROR;            sprintf(error_msg,"Finley_Assemble_PDE: coefficient A, expected shape (%d,%d,%d,%d)",dimensions[0],dimensions[1],dimensions[2],dimensions[3]);
196            sprintf(Finley_ErrorMsg,"coefficient A, expected shape (%d,%d,%d,%d)",dimensions[0],dimensions[1],dimensions[2],dimensions[3]);            Finley_setError(TYPE_ERROR,error_msg);
197        }        }
198      }      }
199      if (!isEmpty(B)) {      if (!isEmpty(B)) {
# Line 203  void Finley_Assemble_PDE(Finley_NodeFile Line 201  void Finley_Assemble_PDE(Finley_NodeFile
201        dimensions[1]=p.numDim;        dimensions[1]=p.numDim;
202        dimensions[2]=p.numComp;        dimensions[2]=p.numComp;
203        if (!isDataPointShapeEqual(B,3,dimensions)) {        if (!isDataPointShapeEqual(B,3,dimensions)) {
204            Finley_ErrorCode=TYPE_ERROR;            sprintf(error_msg,"Finley_Assemble_PDE: coefficient B, expected shape (%d,%d,%d)",dimensions[0],dimensions[1],dimensions[2]);
205            sprintf(Finley_ErrorMsg,"coefficient B, expected shape (%d,%d,%d)",dimensions[0],dimensions[1],dimensions[2]);            Finley_setError(TYPE_ERROR,error_msg);
206        }        }
207      }      }
208      if (!isEmpty(C)) {      if (!isEmpty(C)) {
# Line 212  void Finley_Assemble_PDE(Finley_NodeFile Line 210  void Finley_Assemble_PDE(Finley_NodeFile
210        dimensions[1]=p.numComp;        dimensions[1]=p.numComp;
211        dimensions[2]=p.numDim;        dimensions[2]=p.numDim;
212        if (!isDataPointShapeEqual(C,3,dimensions)) {        if (!isDataPointShapeEqual(C,3,dimensions)) {
213             Finley_ErrorCode=TYPE_ERROR;            sprintf(error_msg,"Finley_Assemble_PDE: coefficient C, expected shape (%d,%d,%d)",dimensions[0],dimensions[1],dimensions[2]);
214            sprintf(Finley_ErrorMsg,"coefficient C, expected shape (%d,%d,%d)",dimensions[0],dimensions[1],dimensions[2]);            Finley_setError(TYPE_ERROR,error_msg);
215        }        }
216      }      }
217      if (!isEmpty(D)) {      if (!isEmpty(D)) {
218        dimensions[0]=p.numEqu;        dimensions[0]=p.numEqu;
219        dimensions[1]=p.numComp;        dimensions[1]=p.numComp;
220        if (!isDataPointShapeEqual(D,2,dimensions)) {        if (!isDataPointShapeEqual(D,2,dimensions)) {
221            Finley_ErrorCode=TYPE_ERROR;            sprintf(error_msg,"Finley_Assemble_PDE: coefficient D, expected shape (%d,%d)",dimensions[0],dimensions[1]);
222            sprintf(Finley_ErrorMsg,"coefficient D, expected shape (%d,%d)",dimensions[0],dimensions[1]);            Finley_setError(TYPE_ERROR,error_msg);
223        }        }
224      }      }
225      if (!isEmpty(X)) {      if (!isEmpty(X)) {
226        dimensions[0]=p.numEqu;        dimensions[0]=p.numEqu;
227        dimensions[1]=p.numDim;        dimensions[1]=p.numDim;
228        if (!isDataPointShapeEqual(X,2,dimensions)) {        if (!isDataPointShapeEqual(X,2,dimensions)) {
229             Finley_ErrorCode=TYPE_ERROR;            sprintf(error_msg,"Finley_Assemble_PDE: coefficient X, expected shape (%d,%d)",dimensions[0],dimensions[1]);
230            sprintf(Finley_ErrorMsg,"coefficient X, expected shape (%d,%d)",dimensions[0],dimensions[1]);            Finley_setError(TYPE_ERROR,error_msg);
231        }        }
232      }      }
233      if (!isEmpty(Y)) {      if (!isEmpty(Y)) {
234        dimensions[0]=p.numEqu;        dimensions[0]=p.numEqu;
235        if (!isDataPointShapeEqual(Y,1,dimensions)) {        if (!isDataPointShapeEqual(Y,1,dimensions)) {
236             Finley_ErrorCode=TYPE_ERROR;            sprintf(error_msg,"Finley_Assemble_PDE: coefficient Y, expected shape (%d,)",dimensions[0]);
237            sprintf(Finley_ErrorMsg,"coefficient Y, expected shape (%d,)",dimensions[0]);            Finley_setError(TYPE_ERROR,error_msg);
238        }        }
239      }      }
240    }    }
241    
242    if (Finley_ErrorCode==NO_ERROR) {    if (Finley_noError()) {
243       time0=Finley_timer();       time0=Finley_timer();
244       #pragma omp parallel private(index_col,index_row,EM_S,EM_F,V,dVdv,dSdV,Vol,dvdV,color,q) \       #pragma omp parallel private(index_col,index_row,EM_S,EM_F,V,dVdv,dSdV,Vol,dvdV,color,q) \
245              firstprivate(elements,nodes,S,F,A,B,C,D,X,Y)              firstprivate(elements,nodes,S,F,A,B,C,D,X,Y)
# Line 251  void Finley_Assemble_PDE(Finley_NodeFile Line 249  void Finley_Assemble_PDE(Finley_NodeFile
249    
250           /* allocate work arrays: */           /* allocate work arrays: */
251    
252           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);
253           EM_F=(double*) THREAD_MEMALLOC(p.NN_row*p.numEqu*sizeof(double));           EM_F=(double*) THREAD_MEMALLOC(p.NN_row*p.numEqu,double);
254           V=(double*) THREAD_MEMALLOC(p.NN*p.numDim*sizeof(double));           V=(double*) THREAD_MEMALLOC(p.NN*p.numDim,double);
255           dVdv=(double*) THREAD_MEMALLOC(p.numDim*p.numDim*p.numQuad*sizeof(double));           dVdv=(double*) THREAD_MEMALLOC(p.numDim*p.numDim*p.numQuad,double);
256           dvdV=(double*) THREAD_MEMALLOC(p.numDim*p.numDim*p.numQuad*sizeof(double));           dvdV=(double*) THREAD_MEMALLOC(p.numDim*p.numDim*p.numQuad,double);
257           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);
258           Vol=(double*) THREAD_MEMALLOC(p.numQuad*sizeof(double));           Vol=(double*) THREAD_MEMALLOC(p.numQuad,double);
259           index_col=(maybelong*) THREAD_MEMALLOC(p.NN_col*sizeof(maybelong));           index_col=(index_t*) THREAD_MEMALLOC(p.NN_col,index_t);
260           index_row=(maybelong*) THREAD_MEMALLOC(p.NN_row*sizeof(maybelong));           index_row=(index_t*) THREAD_MEMALLOC(p.NN_row,index_t);
261    
262           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) ||
263                  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) ))  {
264    
265             /*  open loop over all colors: */             /*  open loop over all colors: */
266             for (color=0;color<elements->numColors;color++) {             for (color=elements->minColor;color<=elements->maxColor;color++) {
267                /*  open loop over all elements: */                /*  open loop over all elements: */
268                #pragma omp for private(e) schedule(static)                #pragma omp for private(e) schedule(static)
269                for(e=0;e<elements->numElements;e++){                for(e=0;e<elements->numElements;e++){
270                  if (elements->Color[e]==color) {                  if (elements->Color[e]==color) {
271    //============================
272                    for (q=0;q<p.NN_row;q++) index_row[q]=p.label_row[elements->Nodes[INDEX2(p.row_node[q],e,p.NN)]];                    for (q=0;q<p.NN_row;q++) index_row[q]=p.label_row[elements->Nodes[INDEX2(p.row_node[q],e,p.NN)]];
273                    /* gather V-coordinates of nodes into V: */                    /* gather V-coordinates of nodes into V: */
274            Finley_Util_Gather_double(p.NN,&(elements->Nodes[INDEX2(0,e,p.NN)]),p.numDim,nodes->Coordinates,V);            Finley_Util_Gather_double(p.NN,&(elements->Nodes[INDEX2(0,e,p.NN)]),p.numDim,nodes->Coordinates,V);
# Line 281  void Finley_Assemble_PDE(Finley_NodeFile Line 280  void Finley_Assemble_PDE(Finley_NodeFile
280            Finley_Util_SmallMatSetMult(p.numQuad,p.NS_row,p.numDim,dSdV,p.numDim,p.referenceElement_row->dSdv,dvdV);            Finley_Util_SmallMatSetMult(p.numQuad,p.NS_row,p.numDim,dSdV,p.numDim,p.referenceElement_row->dSdv,dvdV);
281                    /*  scale volume: */                    /*  scale volume: */
282            for (q=0;q<p.numQuad;q++) Vol[q]=ABS(Vol[q]*p.referenceElement->QuadWeights[q]);            for (q=0;q<p.numQuad;q++) Vol[q]=ABS(Vol[q]*p.referenceElement->QuadWeights[q]);
283    //============================
284            
285                     /*   integration for the stiffness matrix: */                     /*   integration for the stiffness matrix: */
286                     /*   in order to optimze the number of operations the case of constants coefficience needs a bit more work */                     /*   in order to optimze the number of operations the case of constants coefficience needs a bit more work */
# Line 304  void Finley_Assemble_PDE(Finley_NodeFile Line 304  void Finley_Assemble_PDE(Finley_NodeFile
304                                                                       getSampleData(D,e),isExpanded(D));                                                                       getSampleData(D,e),isExpanded(D));
305                         }                         }
306                         for (q=0;q<p.NN_col;q++) index_col[q]=p.label_col[elements->Nodes[INDEX2(p.col_node[q],e,p.NN)]];                         for (q=0;q<p.NN_col;q++) index_col[q]=p.label_col[elements->Nodes[INDEX2(p.col_node[q],e,p.NN)]];
307                         Finley_SystemMatrix_add(S,p.NN_row,index_row,p.numEqu,p.NN_col,index_col,p.numComp,EM_S);                         Finley_Assemble_addToSystemMatrix(S,p.NN_row,index_row,p.numEqu,p.NN_col,index_col,p.numComp,EM_S);
308                       }                       }
309                       if (!isEmpty(F)) {                       if (!isEmpty(F)) {
310                         for (q=0;q<p.NN_row*p.numEqu;q++) EM_F[q]=0;                         for (q=0;q<p.NN_row*p.numEqu;q++) EM_F[q]=0;
# 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.8  2005/09/15 03:44:21  jgs
348   * Initial revision   * Merge of development branch dev-02 back to main trunk on 2005-09-15
349     *
350     * Revision 1.7  2005/09/01 03:31:35  jgs
351     * Merge of development branch dev-02 back to main trunk on 2005-09-01
352     *
353     * Revision 1.6  2005/08/12 01:45:42  jgs
354     * erge of development branch dev-02 back to main trunk on 2005-08-12
355     *
356     * Revision 1.5.2.3  2005/09/07 06:26:17  gross
357     * the solver from finley are put into the standalone package paso now
358     *
359     * Revision 1.5.2.2  2005/08/24 02:02:18  gross
360     * timing output switched off. solver output can be swiched through getSolution(verbose=True) now.
361     *
362     * Revision 1.5.2.1  2005/08/03 08:54:27  gross
363     * contact element assemblage was called with wrong element table pointer
364     *
365     * Revision 1.5  2005/07/08 04:07:46  jgs
366     * Merge of development branch back to main trunk on 2005-07-08
367   *   *
368   * Revision 1.3  2004/07/30 04:37:06  gross   * Revision 1.4  2004/12/15 07:08:32  jgs
369   * escript and finley are linking now and RecMeshTest.py has been passed   * *** empty log message ***
370     * Revision 1.1.1.1.2.2  2005/06/29 02:34:47  gross
371     * some changes towards 64 integers in finley
372   *   *
373   * Revision 1.2  2004/07/21 05:00:54  gross   * Revision 1.1.1.1.2.1  2004/11/24 01:37:12  gross
374   * name changes in DataC   * some changes dealing with the integer overflow in memory allocation. Finley solves 4M unknowns now
375   *   *
  * Revision 1.1  2004/07/02 04:21:13  gross  
  * Finley C code has been included  
376   *   *
377   *   *
378   */   */

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

  ViewVC Help
Powered by ViewVC 1.1.26