/[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 1072 by gross, Thu Mar 29 06:44:30 2007 UTC revision 2548 by jfenwick, Mon Jul 20 06:20:06 2009 UTC
# Line 1  Line 1 
1  /*  
2   ************************************************************  /*******************************************************
3   *          Copyright 2006 by ACcESS MNRF                   *  *
4   *                                                          *  * Copyright (c) 2003-2009 by University of Queensland
5   *              http://www.access.edu.au                    *  * Earth Systems Science Computational Center (ESSCC)
6   *       Primary Business: Queensland, Australia            *  * http://www.uq.edu.au/esscc
7   *  Licensed under the Open Software License version 3.0    *  *
8   *     http://www.opensource.org/licenses/osl-3.0.php       *  * Primary Business: Queensland, Australia
9   *                                                          *  * Licensed under the Open Software License version 3.0
10   ************************************************************  * http://www.opensource.org/licenses/osl-3.0.php
11  */  *
12    *******************************************************/
13    
14    
15  /**************************************************************/  /**************************************************************/
# Line 39  Line 40 
40    
41  /**************************************************************/  /**************************************************************/
42    
 /*  Author: gross@access.edu.au */  
 /*  Version: $Id$ */  
   
 /**************************************************************/  
   
43  #include "Assemble.h"  #include "Assemble.h"
44  #include "Util.h"  #include "Util.h"
45    #include "esysUtils/blocktimer.h"
46  #ifdef _OPENMP  #ifdef _OPENMP
47  #include <omp.h>  #include <omp.h>
48  #endif  #endif
# Line 62  void Finley_Assemble_PDE(Finley_NodeFile Line 59  void Finley_Assemble_PDE(Finley_NodeFile
59    double time0;    double time0;
60    dim_t dimensions[ESCRIPT_MAX_DATA_RANK];    dim_t dimensions[ESCRIPT_MAX_DATA_RANK];
61    type_t funcspace;    type_t funcspace;
62      double blocktimer_start = blocktimer_time();
63    
64    Finley_resetError();    Finley_resetError();
65    
66      {
67    #ifdef Paso_MPI
68      int iam, numCPUs;
69      iam = elements->elementDistribution->MPIInfo->rank;
70      numCPUs = elements->elementDistribution->MPIInfo->size;
71    #endif
72      }
73    
74    if (nodes==NULL || elements==NULL) return;    if (nodes==NULL || elements==NULL) return;
75    if (S==NULL && isEmpty(F)) return;    if (S==NULL && isEmpty(F)) return;
76    
77    if (isEmpty(F) && !isEmpty(X) && !isEmpty(F)) {    if (isEmpty(F) && !isEmpty(X) && !isEmpty(F)) {
78          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.");
79    }    }
80    
81    if (S==NULL && !isEmpty(A) && !isEmpty(B) && !isEmpty(C) && !isEmpty(D)) {    if (S==NULL && !isEmpty(A) && !isEmpty(B) && !isEmpty(C) && !isEmpty(D)) {
82          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.");
83    }    }
84    
# Line 166  void Finley_Assemble_PDE(Finley_NodeFile Line 172  void Finley_Assemble_PDE(Finley_NodeFile
172    }    }
173    
174    /*  check the dimensions: */    /*  check the dimensions: */
175      
176    if (p.numEqu==1 && p.numComp==1) {    if (p.numEqu==1 && p.numComp==1) {
177      if (!isEmpty(A)) {      if (!isEmpty(A)) {
178        dimensions[0]=p.numDim;        dimensions[0]=p.numDim;
# Line 206  void Finley_Assemble_PDE(Finley_NodeFile Line 212  void Finley_Assemble_PDE(Finley_NodeFile
212         if (!isDataPointShapeEqual(Y,0,dimensions)) {         if (!isDataPointShapeEqual(Y,0,dimensions)) {
213            Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE: coefficient Y, rank 0 expected.");            Finley_setError(TYPE_ERROR,"Finley_Assemble_PDE: coefficient Y, rank 0 expected.");
214         }         }
215      }      }
216    } else {    } else {
217      if (!isEmpty(A)) {      if (!isEmpty(A)) {
218        dimensions[0]=p.numEqu;        dimensions[0]=p.numEqu;
# Line 330  void Finley_Assemble_PDE(Finley_NodeFile Line 336  void Finley_Assemble_PDE(Finley_NodeFile
336              } else {              } else {
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==2) {            } 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.row_NS == p.col_NS && p.row_NS == p.row_NN && p.col_NS == p.col_NN ) {
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.row_NS == p.col_NS &&  2*p.row_NS == p.row_NN && 2*p.col_NS == p.col_NN ) {
# Line 353  void Finley_Assemble_PDE(Finley_NodeFile Line 359  void Finley_Assemble_PDE(Finley_NodeFile
359       printf("timing: assemblage PDE: %.4e sec\n",Finley_timer()-time0);       printf("timing: assemblage PDE: %.4e sec\n",Finley_timer()-time0);
360       #endif       #endif
361    }    }
362      blocktimer_increment("Finley_Assemble_PDE()", blocktimer_start);
363  }  }
364  /*  /*
365   * $Log$   * $Log$

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

  ViewVC Help
Powered by ViewVC 1.1.26