/[escript]/branches/domexper/dudley/src/Assemble_PDE.c
ViewVC logotype

Diff of /branches/domexper/dudley/src/Assemble_PDE.c

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

revision 971 by ksteube, Wed Feb 14 04:40:49 2007 UTC revision 1353 by matt, Thu Nov 22 06:05:35 2007 UTC
# Line 1  Line 1 
 /*  
  ************************************************************  
  *          Copyright 2006 by ACcESS MNRF                   *  
  *                                                          *  
  *              http://www.access.edu.au                    *  
  *       Primary Business: Queensland, Australia            *  
  *  Licensed under the Open Software License version 3.0    *  
  *     http://www.opensource.org/licenses/osl-3.0.php       *  
  *                                                          *  
  ************************************************************  
 */  
1    
2    /* $Id$ */
3    
4    /*******************************************************
5     *
6     *           Copyright 2003-2007 by ACceSS MNRF
7     *       Copyright 2007 by University of Queensland
8     *
9     *                http://esscc.uq.edu.au
10     *        Primary Business: Queensland, Australia
11     *  Licensed under the Open Software License version 3.0
12     *     http://www.opensource.org/licenses/osl-3.0.php
13     *
14     *******************************************************/
15    
16  /**************************************************************/  /**************************************************************/
17    
# Line 39  Line 41 
41    
42  /**************************************************************/  /**************************************************************/
43    
 /*  Author: gross@access.edu.au */  
 /*  Version: $Id$ */  
   
 /**************************************************************/  
   
44  #include "Assemble.h"  #include "Assemble.h"
45  #include "Util.h"  #include "Util.h"
46    #include "escript/blocktimer.h"
47  #ifdef _OPENMP  #ifdef _OPENMP
48  #include <omp.h>  #include <omp.h>
49  #endif  #endif
# Line 61  void Finley_Assemble_PDE(Finley_NodeFile Line 59  void Finley_Assemble_PDE(Finley_NodeFile
59    Assemble_Parameters p;    Assemble_Parameters p;
60    double time0;    double time0;
61    dim_t dimensions[ESCRIPT_MAX_DATA_RANK];    dim_t dimensions[ESCRIPT_MAX_DATA_RANK];
62      type_t funcspace;
63      double blocktimer_start = blocktimer_time();
64    
65    Finley_resetError();    Finley_resetError();
66    
67      {
68      int iam, numCPUs;
69    #ifdef Paso_MPI
70      iam = elements->elementDistribution->MPIInfo->rank;
71      numCPUs = elements->elementDistribution->MPIInfo->size;
72    #endif
73      }
74    
75    if (nodes==NULL || elements==NULL) return;    if (nodes==NULL || elements==NULL) return;
76    if (S==NULL && isEmpty(F)) return;    if (S==NULL && isEmpty(F)) return;
77    
78    if (isEmpty(F) && !isEmpty(X) && !isEmpty(F)) {    if (isEmpty(F) && !isEmpty(X) && !isEmpty(F)) {
79          Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE: right hand side coefficients are non-zero bat no right hand side vector given.");          Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE: right hand side coefficients are non-zero bat no right hand side vector given.");
80    }    }
81    
82    if (S==NULL && !isEmpty(A) && !isEmpty(B) && !isEmpty(C) && !isEmpty(D)) {    if (S==NULL && !isEmpty(A) && !isEmpty(B) && !isEmpty(C) && !isEmpty(D)) {
83          Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE: coefficients are non-zero but no matrix is given.");          Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE: coefficients are non-zero but no matrix is given.");
84    }    }
85    
86    /*  get the functionspace for this assemblage call */    /*  get the functionspace for this assemblage call */
87    type_t funcspace=UNKNOWN;    funcspace=UNKNOWN;
88    updateFunctionSpaceType(funcspace,A);    updateFunctionSpaceType(funcspace,A);
89    updateFunctionSpaceType(funcspace,B);    updateFunctionSpaceType(funcspace,B);
90    updateFunctionSpaceType(funcspace,C);    updateFunctionSpaceType(funcspace,C);
# Line 85  void Finley_Assemble_PDE(Finley_NodeFile Line 93  void Finley_Assemble_PDE(Finley_NodeFile
93    updateFunctionSpaceType(funcspace,Y);    updateFunctionSpaceType(funcspace,Y);
94    if (funcspace==UNKNOWN) return; /* all  data are empty */    if (funcspace==UNKNOWN) return; /* all  data are empty */
95    
   
96    /* check if all function spaces are the same */    /* check if all function spaces are the same */
97    if (! functionSpaceTypeEqual(funcspace,A) ) {    if (! functionSpaceTypeEqual(funcspace,A) ) {
98          Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE: unexpected function space type for coefficient A");          Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE: unexpected function space type for coefficient A");
# Line 116  void Finley_Assemble_PDE(Finley_NodeFile Line 123  void Finley_Assemble_PDE(Finley_NodeFile
123         reducedIntegrationOrder=FALSE;         reducedIntegrationOrder=FALSE;
124    } else if (funcspace==FINLEY_CONTACT_ELEMENTS_2)  {    } else if (funcspace==FINLEY_CONTACT_ELEMENTS_2)  {
125         reducedIntegrationOrder=FALSE;         reducedIntegrationOrder=FALSE;
126      } else if (funcspace==FINLEY_REDUCED_ELEMENTS) {
127           reducedIntegrationOrder=TRUE;
128      } else if (funcspace==FINLEY_REDUCED_FACE_ELEMENTS)  {
129           reducedIntegrationOrder=TRUE;
130      } else if (funcspace==FINLEY_REDUCED_CONTACT_ELEMENTS_1)  {
131           reducedIntegrationOrder=TRUE;
132      } else if (funcspace==FINLEY_REDUCED_CONTACT_ELEMENTS_2)  {
133           reducedIntegrationOrder=TRUE;
134    } else {    } else {
135         Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE: assemblage failed because of illegal function space.");         Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE: assemblage failed because of illegal function space.");
136    }    }
# Line 158  void Finley_Assemble_PDE(Finley_NodeFile Line 173  void Finley_Assemble_PDE(Finley_NodeFile
173    }    }
174    
175    /*  check the dimensions: */    /*  check the dimensions: */
176      
177    if (p.numEqu==1 && p.numComp==1) {    if (p.numEqu==1 && p.numComp==1) {
178      if (!isEmpty(A)) {      if (!isEmpty(A)) {
179        dimensions[0]=p.numDim;        dimensions[0]=p.numDim;
# Line 198  void Finley_Assemble_PDE(Finley_NodeFile Line 213  void Finley_Assemble_PDE(Finley_NodeFile
213         if (!isDataPointShapeEqual(Y,0,dimensions)) {         if (!isDataPointShapeEqual(Y,0,dimensions)) {
214            Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE: coefficient Y, rank 0 expected.");            Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE: coefficient Y, rank 0 expected.");
215         }         }
216      }      }
217    } else {    } else {
218      if (!isEmpty(A)) {      if (!isEmpty(A)) {
219        dimensions[0]=p.numEqu;        dimensions[0]=p.numEqu;
# Line 345  void Finley_Assemble_PDE(Finley_NodeFile Line 360  void Finley_Assemble_PDE(Finley_NodeFile
360       printf("timing: assemblage PDE: %.4e sec\n",Finley_timer()-time0);       printf("timing: assemblage PDE: %.4e sec\n",Finley_timer()-time0);
361       #endif       #endif
362    }    }
363      blocktimer_increment("Finley_Assemble_PDE()", blocktimer_start);
364  }  }
365  /*  /*
366   * $Log$   * $Log$

Legend:
Removed from v.971  
changed lines
  Added in v.1353

  ViewVC Help
Powered by ViewVC 1.1.26