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

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

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

revision 2548 by jfenwick, Mon Jul 20 06:20:06 2009 UTC revision 2881 by jfenwick, Thu Jan 28 02:03:15 2010 UTC
# Line 1  Line 1 
1    
2  /*******************************************************  /*******************************************************
3  *  *
4  * Copyright (c) 2003-2009 by University of Queensland  * Copyright (c) 2003-2010 by University of Queensland
5  * Earth Systems Science Computational Center (ESSCC)  * Earth Systems Science Computational Center (ESSCC)
6  * http://www.uq.edu.au/esscc  * http://www.uq.edu.au/esscc
7  *  *
# Line 141  void Finley_Assemble_PDE(Finley_NodeFile Line 141  void Finley_Assemble_PDE(Finley_NodeFile
141    
142    /* check if all function spaces are the same */    /* check if all function spaces are the same */
143    
144    if (! numSamplesEqual(A,p.numQuad,elements->numElements) ) {    if (! numSamplesEqual(A,p.numQuadTotal,elements->numElements) ) {
145          sprintf(error_msg,"Finley_Assemble_PDE: sample points of coefficient A don't match (%d,%d)",p.numQuad,elements->numElements);          sprintf(error_msg,"Finley_Assemble_PDE: sample points of coefficient A don't match (%d,%d)",p.numQuadTotal,elements->numElements);
146          Finley_setError(TYPE_ERROR,error_msg);          Finley_setError(TYPE_ERROR,error_msg);
147    }    }
148    
149    if (! numSamplesEqual(B,p.numQuad,elements->numElements) ) {    if (! numSamplesEqual(B,p.numQuadTotal,elements->numElements) ) {
150          sprintf(error_msg,"Finley_Assemble_PDE: sample points of coefficient B don't match (%d,%d)",p.numQuad,elements->numElements);          sprintf(error_msg,"Finley_Assemble_PDE: sample points of coefficient B don't match (%d,%d)",p.numQuadTotal,elements->numElements);
151          Finley_setError(TYPE_ERROR,error_msg);          Finley_setError(TYPE_ERROR,error_msg);
152    }    }
153    
154    if (! numSamplesEqual(C,p.numQuad,elements->numElements) ) {    if (! numSamplesEqual(C,p.numQuadTotal,elements->numElements) ) {
155          sprintf(error_msg,"Finley_Assemble_PDE: sample points of coefficient C don't match (%d,%d)",p.numQuad,elements->numElements);          sprintf(error_msg,"Finley_Assemble_PDE: sample points of coefficient C don't match (%d,%d)",p.numQuadTotal,elements->numElements);
156          Finley_setError(TYPE_ERROR,error_msg);          Finley_setError(TYPE_ERROR,error_msg);
157    }    }
158    
159    if (! numSamplesEqual(D,p.numQuad,elements->numElements) ) {    if (! numSamplesEqual(D,p.numQuadTotal,elements->numElements) ) {
160          sprintf(error_msg,"Finley_Assemble_PDE: sample points of coefficient D don't match (%d,%d)",p.numQuad,elements->numElements);          sprintf(error_msg,"Finley_Assemble_PDE: sample points of coefficient D don't match (%d,%d)",p.numQuadTotal,elements->numElements);
161          Finley_setError(TYPE_ERROR,error_msg);          Finley_setError(TYPE_ERROR,error_msg);
162    }    }
163    
164    if (! numSamplesEqual(X,p.numQuad,elements->numElements) ) {    if (! numSamplesEqual(X,p.numQuadTotal,elements->numElements) ) {
165          sprintf(error_msg,"Finley_Assemble_PDE: sample points of coefficient X don't match (%d,%d)",p.numQuad,elements->numElements);          sprintf(error_msg,"Finley_Assemble_PDE: sample points of coefficient X don't match (%d,%d)",p.numQuadTotal,elements->numElements);
166          Finley_setError(TYPE_ERROR,error_msg);          Finley_setError(TYPE_ERROR,error_msg);
167    }    }
168    
169    if (! numSamplesEqual(Y,p.numQuad,elements->numElements) ) {    if (! numSamplesEqual(Y,p.numQuadTotal,elements->numElements) ) {
170          sprintf(error_msg,"Finley_Assemble_PDE: sample points of coefficient Y don't match (%d,%d)",p.numQuad,elements->numElements);          sprintf(error_msg,"Finley_Assemble_PDE: sample points of coefficient Y don't match (%d,%d)",p.numQuadTotal,elements->numElements);
171          Finley_setError(TYPE_ERROR,error_msg);          Finley_setError(TYPE_ERROR,error_msg);
172    }    }
173    
# Line 272  void Finley_Assemble_PDE(Finley_NodeFile Line 272  void Finley_Assemble_PDE(Finley_NodeFile
272          if (p.numEqu > 1) {          if (p.numEqu > 1) {
273            /* system of PDESs */            /* system of PDESs */
274            if (p.numDim==3) {            if (p.numDim==3) {
275              if (p.row_NS == p.col_NS && p.row_NS == p.row_NN && p.col_NS == p.col_NN ) {              if ( p.numSides == 1 ) {
276                 Finley_Assemble_PDE_System2_3D(p,elements,S,F,A,B,C,D,X,Y);                 Finley_Assemble_PDE_System2_3D(p,elements,S,F,A,B,C,D,X,Y);
277              } else if ( p.row_NS == p.col_NS &&  2*p.row_NS == p.row_NN && 2*p.col_NS == p.col_NN ) {              } else if ( p.numSides == 2 ) {
278                 if ( !isEmpty(A) || !isEmpty(B) || !isEmpty(C) || !isEmpty(X) ) {                 if ( !isEmpty(A) || !isEmpty(B) || !isEmpty(C) || !isEmpty(X) ) {
279                    Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE: Contact elements require A, B, C and X to be empty.");                    Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE: Contact elements require A, B, C and X to be empty.");
280                 } else {                 } else {
# Line 284  void Finley_Assemble_PDE(Finley_NodeFile Line 284  void Finley_Assemble_PDE(Finley_NodeFile
284                 Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE supports numShape=NumNodes or 2*numShape=NumNodes only.");                 Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE supports numShape=NumNodes or 2*numShape=NumNodes only.");
285              }              }
286            } else if (p.numDim==2) {            } else if (p.numDim==2) {
287              if ((p.row_NS == p.col_NS) && (p.row_NS == p.row_NN) && (p.col_NS == p.col_NN )) {              if ( p.numSides == 1 ) {
288                 Finley_Assemble_PDE_System2_2D(p,elements,S,F,A,B,C,D,X,Y);                 Finley_Assemble_PDE_System2_2D(p,elements,S,F,A,B,C,D,X,Y);
289              } else if ( p.row_NS == p.col_NS &&  2*p.row_NS == p.row_NN && 2*p.col_NS == p.col_NN ) {              } else if (  p.numSides == 2 ) {
290                 if ( !isEmpty(A) || !isEmpty(B) || !isEmpty(C) || !isEmpty(X) ) {                 if ( !isEmpty(A) || !isEmpty(B) || !isEmpty(C) || !isEmpty(X) ) {
291                    Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE: Contact elements require A, B, C and X to be empty.");                    Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE: Contact elements require A, B, C and X to be empty.");
292                 } else {                 } else {
# Line 295  void Finley_Assemble_PDE(Finley_NodeFile Line 295  void Finley_Assemble_PDE(Finley_NodeFile
295              } else {              } else {
296                 Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE supports numShape=NumNodes or 2*numShape=NumNodes only.");                 Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE supports numShape=NumNodes or 2*numShape=NumNodes only.");
297              }              }
298            } else if (p.numDim==2) {            } else if (p.numDim==1) {
299              if (p.row_NS == p.col_NS && p.row_NS == p.row_NN && p.col_NS == p.col_NN ) {              if ( p.numSides == 1  ) {
300                 Finley_Assemble_PDE_System2_1D(p,elements,S,F,A,B,C,D,X,Y);                 Finley_Assemble_PDE_System2_1D(p,elements,S,F,A,B,C,D,X,Y);
301              } else if ( p.row_NS == p.col_NS &&  2*p.row_NS == p.row_NN && 2*p.col_NS == p.col_NN ) {              } else if ( p.numSides == 2 ) {
302                 if ( !isEmpty(A) || !isEmpty(B) || !isEmpty(C) || !isEmpty(X) ) {                 if ( !isEmpty(A) || !isEmpty(B) || !isEmpty(C) || !isEmpty(X) ) {
303                    Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE: Contact elements require A, B, C and X to be empty.");                    Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE: Contact elements require A, B, C and X to be empty.");
304                 } else {                 } else {
# Line 313  void Finley_Assemble_PDE(Finley_NodeFile Line 313  void Finley_Assemble_PDE(Finley_NodeFile
313          } else {          } else {
314            /* single PDES */            /* single PDES */
315            if (p.numDim==3) {            if (p.numDim==3) {
316              if (p.row_NS == p.col_NS && p.row_NS == p.row_NN && p.col_NS == p.col_NN ) {              if ( p.numSides == 1  ) {
317                 Finley_Assemble_PDE_Single2_3D(p,elements,S,F,A,B,C,D,X,Y);                 Finley_Assemble_PDE_Single2_3D(p,elements,S,F,A,B,C,D,X,Y);
318              } else if ( p.row_NS == p.col_NS &&  2*p.row_NS == p.row_NN && 2*p.col_NS == p.col_NN ) {              } else if ( p.numSides == 2 ) {
319                 if ( !isEmpty(A) || !isEmpty(B) || !isEmpty(C) || !isEmpty(X) ) {                 if ( !isEmpty(A) || !isEmpty(B) || !isEmpty(C) || !isEmpty(X) ) {
320                    Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE: Contact elements require A, B, C and X to be empty.");                    Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE: Contact elements require A, B, C and X to be empty.");
321                 } else {                 } else {
# Line 325  void Finley_Assemble_PDE(Finley_NodeFile Line 325  void Finley_Assemble_PDE(Finley_NodeFile
325                 Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE supports numShape=NumNodes or 2*numShape=NumNodes only.");                 Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE supports numShape=NumNodes or 2*numShape=NumNodes only.");
326              }              }
327            } else if (p.numDim==2) {            } else if (p.numDim==2) {
328              if ((p.row_NS == p.col_NS) && (p.row_NS == p.row_NN) && (p.col_NS == p.col_NN )) {              if ( p.numSides == 1 ) {
329                 Finley_Assemble_PDE_Single2_2D(p,elements,S,F,A,B,C,D,X,Y);                 Finley_Assemble_PDE_Single2_2D(p,elements,S,F,A,B,C,D,X,Y);
330              } else if ( p.row_NS == p.col_NS &&  2*p.row_NS == p.row_NN && 2*p.col_NS == p.col_NN ) {              } else if ( p.numSides == 2 ) {
331                 if ( !isEmpty(A) || !isEmpty(B) || !isEmpty(C) || !isEmpty(X) ) {                 if ( !isEmpty(A) || !isEmpty(B) || !isEmpty(C) || !isEmpty(X) ) {
332                    Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE: Contact elements require A, B, C and X to be empty.");                    Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE: Contact elements require A, B, C and X to be empty.");
333                 } else {                 } else {
# Line 337  void Finley_Assemble_PDE(Finley_NodeFile Line 337  void Finley_Assemble_PDE(Finley_NodeFile
337                 Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE supports numShape=NumNodes or 2*numShape=NumNodes only.");                 Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE supports numShape=NumNodes or 2*numShape=NumNodes only.");
338              }              }
339            } else if (p.numDim==1) {            } else if (p.numDim==1) {
340              if (p.row_NS == p.col_NS && p.row_NS == p.row_NN && p.col_NS == p.col_NN ) {              if ( p.numSides == 1 ) {
341                 Finley_Assemble_PDE_Single2_1D(p,elements,S,F,A,B,C,D,X,Y);                 Finley_Assemble_PDE_Single2_1D(p,elements,S,F,A,B,C,D,X,Y);
342              } else if ( p.row_NS == p.col_NS &&  2*p.row_NS == p.row_NN && 2*p.col_NS == p.col_NN ) {              } else if ( p.numSides == 2  ) {
343                 if ( !isEmpty(A) || !isEmpty(B) || !isEmpty(C) || !isEmpty(X) ) {                 if ( !isEmpty(A) || !isEmpty(B) || !isEmpty(C) || !isEmpty(X) ) {
344                    Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE: Contact elements require A, B, C and X to be empty.");                    Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE: Contact elements require A, B, C and X to be empty.");
345                 } else {                 } else {
# Line 355  void Finley_Assemble_PDE(Finley_NodeFile Line 355  void Finley_Assemble_PDE(Finley_NodeFile
355       } else {       } else {
356            Finley_setError(VALUE_ERROR,"Finley_Assemble_PDE requires number of equations == number of solutions  .");            Finley_setError(VALUE_ERROR,"Finley_Assemble_PDE requires number of equations == number of solutions  .");
357       }       }
      #ifdef Finley_TRACE  
      printf("timing: assemblage PDE: %.4e sec\n",Finley_timer()-time0);  
      #endif  
358    }    }
359    blocktimer_increment("Finley_Assemble_PDE()", blocktimer_start);    blocktimer_increment("Finley_Assemble_PDE()", blocktimer_start);
360  }  }
 /*  
  * $Log$  
  * Revision 1.8  2005/09/15 03:44:21  jgs  
  * Merge of development branch dev-02 back to main trunk on 2005-09-15  
  *  
  * Revision 1.7  2005/09/01 03:31:35  jgs  
  * Merge of development branch dev-02 back to main trunk on 2005-09-01  
  *  
  * Revision 1.6  2005/08/12 01:45:42  jgs  
  * erge of development branch dev-02 back to main trunk on 2005-08-12  
  *  
  * Revision 1.5.2.3  2005/09/07 06:26:17  gross  
  * the solver from finley are put into the standalone package paso now  
  *  
  * Revision 1.5.2.2  2005/08/24 02:02:18  gross  
  * timing output switched off. solver output can be swiched through getSolution(verbose=True) now.  
  *  
  * Revision 1.5.2.1  2005/08/03 08:54:27  gross  
  * contact element assemblage was called with wrong element table pointer  
  *  
  * Revision 1.5  2005/07/08 04:07:46  jgs  
  * Merge of development branch back to main trunk on 2005-07-08  
  *  
  * Revision 1.4  2004/12/15 07:08:32  jgs  
  * *** empty log message ***  
  * Revision 1.1.1.1.2.2  2005/06/29 02:34:47  gross  
  * some changes towards 64 integers in finley  
  *  
  * Revision 1.1.1.1.2.1  2004/11/24 01:37:12  gross  
  * some changes dealing with the integer overflow in memory allocation. Finley solves 4M unknowns now  
  *  
  *  
  *  
  */  

Legend:
Removed from v.2548  
changed lines
  Added in v.2881

  ViewVC Help
Powered by ViewVC 1.1.26