driverData.hpp

00001 /*--------------------------------------------------------------------*/
00002 /*    Copyright 2005 Sandia Corporation.                              */
00003 /*    Under the terms of Contract DE-AC04-94AL85000, there is a       */
00004 /*    non-exclusive license for use of this work by or on behalf      */
00005 /*    of the U.S. Government.  Export of this program may require     */
00006 /*    a license from the United States Government.                    */
00007 /*--------------------------------------------------------------------*/
00008 
00009 #ifndef _driverData_h_
00010 #define _driverData_h_
00011 
00012 #include <fei_macros.hpp>
00013 #include <fei_defs.h>
00014 
00015 class initElem {
00016  public:
00017   initElem(){}
00018   ~initElem()
00019     {
00020       delete [] nodeIDs;
00021     }
00022   GlobalID elemBlockID;
00023   GlobalID elemID;
00024   int numNodes;
00025   GlobalID* nodeIDs;
00026 };
00027 
00028 class sumInElem {
00029  public:
00030   sumInElem() : stiff1D(NULL), stiffness(NULL), load(NULL) {}
00031   ~sumInElem()
00032     {
00033       delete [] nodeIDs;
00034       delete [] stiff1D;
00035       delete [] stiffness;
00036       delete [] load;
00037     }
00038   GlobalID elemBlockID;
00039   GlobalID elemID;
00040   int numNodes;
00041   GlobalID* nodeIDs;
00042   int numRows;
00043   double* stiff1D;
00044   double** stiffness;
00045   double* load;
00046   int elemFormat;
00047 };
00048 
00049 class nodeBC {
00050  public:
00051   nodeBC():nodeIDs(NULL), alpha(NULL), beta(NULL), gamma(NULL) {}
00052   ~nodeBC()
00053     {
00054       for(int i=0; i<numNodes; ++i) {
00055   delete [] alpha[i];
00056   delete [] beta[i];
00057   delete [] gamma[i];
00058       }
00059       delete [] alpha;
00060       delete [] beta;
00061       delete [] gamma;
00062       delete [] nodeIDs;
00063     }
00064   int numNodes;
00065   GlobalID* nodeIDs;
00066   int fieldID;
00067   int fieldSize;
00068   double** alpha;
00069   double** beta;
00070   double** gamma;
00071 };
00072 
00073 class initCR {
00074  public:
00075   initCR(){}
00076   ~initCR()
00077     {
00078       delete [] nodeIDs;
00079       delete [] fieldIDs;
00080     }
00081 
00082   int numNodes;
00083   GlobalID* nodeIDs;
00084   int* fieldIDs;
00085   int CRID;
00086 };
00087 
00088 class loadCR {
00089  public:
00090   loadCR() {}
00091   ~loadCR()
00092     {
00093       delete [] fieldIDs;
00094       delete [] fieldSizes;
00095       delete [] weights;
00096       delete [] nodeIDs;
00097     }
00098 
00099   int numNodes;
00100   GlobalID* nodeIDs;
00101   int* fieldIDs;
00102   int* fieldSizes;
00103   double* weights;
00104   double CRValue;
00105   double penValue;
00106   int CRID;  
00107 };
00108 
00109 class sharedNodes {
00110  public:
00111   sharedNodes() : nodeIDs(NULL), numProcsPerNode(NULL), sharedProcIDs(NULL){}
00112   ~sharedNodes()
00113     {
00114       for(int i=0; i<numNodes; ++i) delete [] sharedProcIDs[i];
00115       delete [] sharedProcIDs;
00116       delete [] numProcsPerNode;
00117       delete [] nodeIDs;
00118     }
00119 
00120   int numNodes;
00121   GlobalID* nodeIDs;
00122   int* numProcsPerNode;
00123   int** sharedProcIDs;
00124 };
00125 
00126 class parameters {
00127  public:
00128   parameters() : paramList() {}
00129   ~parameters()
00130     {
00131       for(size_t i=0; i<paramList.size(); ++i) delete [] paramList[i];
00132     }
00133 
00134   std::vector<char*> paramList;
00135 };
00136 
00137 class setIDLists {
00138  public:
00139   setIDLists() : matrixIDs(NULL), rhsIDs(NULL) {}
00140   ~setIDLists(){delete [] matrixIDs; delete [] rhsIDs;}
00141 
00142   int* matrixIDs;
00143   int numMatrices;
00144   int* rhsIDs;
00145   int numRHSs;
00146 };
00147 
00148 class putBlockFieldNodeSolution {
00149  public:
00150   putBlockFieldNodeSolution() : nodeIDs(NULL), estimates(NULL) {}
00151   ~putBlockFieldNodeSolution(){delete [] nodeIDs; delete [] estimates;}
00152 
00153   int elemBlockID;
00154   int fieldID;
00155   int fieldSize;
00156   int numNodes;
00157   GlobalID* nodeIDs;
00158   double* estimates;
00159 };
00160 
00161 class driverData {
00162  public:
00163   driverData();
00164   ~driverData();
00165 
00166   int readData(const char* fileName);
00167 
00172   int call_fei_method(const char* method, FEI* fei);
00173 
00174   std::vector<const char*>& get_methodNames() { return( methodNames ); }
00175 
00176  private:
00177   int readData(FEI_ISTREAM* instr, char* keyword);
00178   int getKeyword(FEI_ISTREAM* instr, char*& keyword);
00179 
00180   int is_reg_char(char c);
00181   int skipWhite(FEI_ISTREAM* instr);
00182   int readData(FEI_ISTREAM* instr, int& n);
00183   int readData(FEI_ISTREAM* instr, double& val);
00184   int appendName(const char* name);
00185 
00186   std::vector<const char*> methodNames;
00187   char* temp_;
00188   int tempLen_;
00189 
00190   int solveType_;
00191 
00192   int initFields_numFields_;
00193   int* initFields_fieldSizes_;
00194   int* initFields_fieldIDs_;
00195 
00196   int initElemBlock_numInts_;
00197   int* initElemBlock_ints_;
00198   int* initElemBlock_fieldsPerNode_;
00199   int** initElemBlock_fieldIDs_;
00200   int* initElemBlock_elemDofFieldIDs_;
00201 
00202   std::vector<initElem*> initElems_;
00203   int initElemCounter_;
00204 
00205   std::vector<sumInElem*> sumInElems_;
00206   int sumInElemCounter_;
00207 
00208   std::vector<sumInElem*> sumInElemMatrix_;
00209   int sumInElemMatrixCounter_;
00210 
00211   std::vector<sumInElem*> sumInElemRHS_;
00212   int sumInElemRHSCounter_;
00213 
00214   double resetSystem_;
00215   double resetMatrix_;
00216   double resetRHSVector_;
00217   double resetInitialGuess_;
00218 
00219   std::vector<nodeBC*> loadNodeBCs_;
00220   int loadNodeBCsCounter_;
00221 
00222   std::vector<initCR*> initCRMult_;
00223   int initCRMultCounter_;
00224 
00225   std::vector<loadCR*> loadCRMult_;
00226   int loadCRMultCounter_;
00227 
00228   std::vector<sharedNodes*> initSharedNodes_;
00229   int initSharedNodesCounter_;
00230 
00231   std::vector<parameters*> parameters_;
00232   int parametersCounter_;
00233 
00234   std::vector<setIDLists*> setIDLists_;
00235   int setIDListsCounter_;
00236 
00237   std::vector<int> setCurrentMatrix_;
00238   int setCurrentMatrixCounter_;
00239 
00240   std::vector<int> setCurrentRHS_;
00241   int setCurrentRHSCounter_;
00242 
00243   std::vector<putBlockFieldNodeSolution*> putBlockFieldNodeSolution_;
00244   int putBlockFieldNodeSolutionCounter_;
00245 };
00246 
00247 #endif // _driverData_h_

Generated on Tue Jul 13 09:27:44 2010 for FEI by  doxygen 1.4.7