25 #define CHK_ERR(a) {int chkerr; if ((chkerr = a) != 0) { \
26 fei::console_out() << "file " << __FILE__ << ", line " << __LINE__ \
27 << ", err " << chkerr << FEI_ENDL; \
35 initFields_fieldSizes_(NULL),
36 initFields_fieldIDs_(NULL),
37 initElemBlock_ints_(NULL),
38 initElemBlock_fieldsPerNode_(NULL),
39 initElemBlock_fieldIDs_(NULL),
40 initElemBlock_elemDofFieldIDs_(NULL),
46 sumInElemMatrixCounter_(0),
48 sumInElemRHSCounter_(0),
50 loadNodeBCsCounter_(0),
52 initCRMultCounter_(0),
54 loadCRMultCounter_(0),
56 initSharedNodesCounter_(0),
58 parametersCounter_(0),
60 setIDListsCounter_(0),
62 setCurrentMatrixCounter_(0),
64 setCurrentRHSCounter_(0),
65 putBlockFieldNodeSolution_(),
66 putBlockFieldNodeSolutionCounter_(0)
115 char* keyword = NULL;
118 while (!instr->eof() && !err) {
136 if (!std::strcmp(
"setSolveType", method)) {
140 if (!std::strcmp(
"setIDLists", method)) {
152 if (!std::strcmp(
"setCurrentMatrix", method)) {
163 if (!std::strcmp(
"setCurrentRHS", method)) {
174 if (!std::strcmp(
"initFields", method)) {
180 if (!std::strcmp(
"initElemBlock", method)) {
182 initElemBlock_ints_[1],
183 initElemBlock_ints_[2],
186 initElemBlock_ints_[3],
188 initElemBlock_ints_[4]) );
192 if (!std::strcmp(
"parameters", method)) {
204 if (!std::strcmp(
"initCRMult", method)) {
216 if (!std::strcmp(
"initSharedNodes", method)) {
228 if (!std::strcmp(
"loadCRMult", method)) {
240 if (!std::strcmp(
"deleteMultCRs", method)) {
244 if (!std::strcmp(
"initElem", method)) {
255 if (!std::strcmp(
"initComplete", method)) {
259 if (!std::strcmp(
"resetSystem", method)) {
263 if (!std::strcmp(
"resetMatrix", method)) {
267 if (!std::strcmp(
"resetRHSVector", method)) {
271 if (!std::strcmp(
"resetInitialGuess", method)) {
275 if (!std::strcmp(
"sumInElem", method)) {
287 if (!std::strcmp(
"sumInElemMatrix", method)) {
299 if (!std::strcmp(
"sumInElemRHS", method)) {
311 if (!std::strcmp(
"putBlockFieldNodeSolution", method)) {
314 fei::console_out() <<
"driverData ERROR, can't call putBlockFieldNodeSolution again"
329 if (!std::strcmp(
"loadNodeBCs", method)) {
339 if (!std::strcmp(
"loadComplete", method)) {
343 if (!std::strcmp(
"solve", method)) {
345 return( fei->
solve(status) );
348 if (!std::strcmp(
"getBlockNodeIDList", method) ||
349 !std::strcmp(
"residualNorm", method) ||
350 !std::strcmp(
"getBlockFieldNodeSolution", method)) {
360 if (!std::strcmp(
"setSolveType", keyword)) {
365 if (!std::strcmp(
"setIDLists", keyword)) {
372 for(i=0; i<numMatrices; ++i) {
378 sidl->
rhsIDs =
new int[numRHSs];
379 for(i=0; i<numRHSs; ++i) {
387 if (!std::strcmp(
"setCurrentMatrix", keyword)) {
394 if (!std::strcmp(
"setCurrentRHS", keyword)) {
401 if (!std::strcmp(
"initFields", keyword)) {
417 if (!std::strcmp(
"parameters", keyword)) {
423 for(
int i=0; i<numParams; ++i) {
424 char* line =
new char[512];
425 instr->getline(line, 512);
432 if (!std::strcmp(
"initElemBlock", keyword)) {
434 int i, intOffset = 0;
446 for(i=0; i<len; ++i) {
450 for(i=0; i<len; ++i) {
453 for(
int ii=0; ii<len2; ++ii) {
463 for(i=0; i<len; ++i) {
472 if (!std::strcmp(
"initElem", keyword) ) {
490 if (!std::strcmp(
"initCRMult", keyword) ) {
513 if (!std::strcmp(
"loadCRMult", keyword) ) {
536 lcr->
weights =
new double[tmp];
540 for(
int j=0; j<size; ++j) {
554 if (!std::strcmp(
"deleteMultCRs", keyword) ) {
558 if (!std::strcmp(
"initSharedNodes", keyword) ) {
584 if (!std::strcmp(
"initComplete", keyword) ) {
588 if (!std::strcmp(
"sumInElem", keyword) ) {
607 sie->
stiff1D =
new double[tmp*tmp];
608 sie->
load =
new double[tmp];
611 for(i=0; i<sie->
numRows; ++i) {
612 for(
int j=0; j<sie->
numRows; ++j) {
619 for(
int j=0; j<sie->
numRows; ++j) {
631 if (!std::strcmp(
"sumInElemMatrix", keyword) ) {
650 sie->
stiff1D =
new double[tmp*tmp];
651 sie->
load =
new double[tmp];
654 for(i=0; i<sie->
numRows; ++i) {
655 for(
int j=0; j<sie->
numRows; ++j) {
669 if (!std::strcmp(
"sumInElemRHS", keyword) ) {
680 for(
int i=0; i<sie->
numNodes; ++i) {
689 for(
int j=0; j<sie->
numRows; ++j) {
698 if (!std::strcmp(
"resetSystem", keyword) ) {
703 if (!std::strcmp(
"resetMatrix", keyword) ) {
708 if (!std::strcmp(
"resetRHSVector", keyword) ) {
713 if (!std::strcmp(
"resetInitialGuess", keyword) ) {
718 if (!std::strcmp(
"putBlockFieldNodeSolution", keyword) ) {
743 if (!std::strcmp(
"loadNodeBCs", keyword) ) {
780 if (!std::strcmp(
"loadComplete", keyword) ||
781 !std::strcmp(
"solve", keyword) ||
782 !std::strcmp(
"destructor", keyword) ||
783 !std::strcmp(
"getBlockNodeIDList", keyword) ||
784 !std::strcmp(
"getBlockFieldNodeSolution", keyword) ||
785 !std::strcmp(
"residualNorm", keyword)) {
794 if (name == NULL)
return(-1);
795 char* str =
new char[strlen(name)+1];
804 if (err)
return(err);
809 instr->getline(
temp_, tempLen_);
810 }
while ((strlen(
temp_) == 0) && (!instr->eof()));
812 if (instr->eof() || strlen(
temp_) == 0)
return(-1);
814 keyword =
new char[strlen(
temp_)+1];
818 strcpy(keyword, temp2);
828 if (i<1 || i>126)
return(0);
842 while(c ==
'#' || c ==
'\n' || c ==
' ') {
844 char* buf =
new char[128];
845 for(
int i=0; i<128; i++) buf[i] =
'\0';
846 instr->getline(buf, 128);
852 if (instr->eof())
return(1);
853 if ((
int)c == EOF)
return(1);
867 if (err)
return(err);
875 if (err)
return(err);
int initFields_numFields_
virtual int sumInElemMatrix(GlobalID elemBlockID, GlobalID elemID, const GlobalID *elemConn, const double *const *elemStiffness, int elemFormat)=0
virtual int parameters(int numParams, const char *const *paramStrings)=0
std::vector< sumInElem * > sumInElems_
int sumInElemMatrixCounter_
virtual int initComplete()=0
std::vector< sumInElem * > sumInElemMatrix_
int * initElemBlock_ints_
int setCurrentRHSCounter_
std::vector< putBlockFieldNodeSolution * > putBlockFieldNodeSolution_
virtual int solve(int &status)=0
int * initFields_fieldIDs_
std::vector< char * > paramList
int call_fei_method(const char *method, FEI *fei)
std::vector< int > setCurrentRHS_
std::vector< sharedNodes * > initSharedNodes_
double resetInitialGuess_
virtual int loadCRMult(int CRMultID, int numCRNodes, const GlobalID *CRNodeIDs, const int *CRFieldIDs, const double *CRWeights, double CRValue)=0
int skipWhite(FEI_ISTREAM *instr)
int * initElemBlock_elemDofFieldIDs_
virtual int initCRMult(int numCRNodes, const GlobalID *CRNodeIDs, const int *CRFieldIDs, int &CRID)=0
int initElemBlock_numInts_
int putBlockFieldNodeSolutionCounter_
virtual int deleteMultCRs()=0
virtual int initSharedNodes(int numSharedNodes, const GlobalID *sharedNodeIDs, const int *numProcsPerNode, const int *const *sharingProcIDs)=0
virtual int resetInitialGuess(double s)=0
int getKeyword(FEI_ISTREAM *instr, char *&keyword)
virtual int initFields(int numFields, const int *fieldSizes, const int *fieldIDs, const int *fieldTypes=NULL)=0
virtual int initElemBlock(GlobalID elemBlockID, int numElements, int numNodesPerElement, const int *numFieldsPerNode, const int *const *nodalFieldIDs, int numElemDofFieldsPerElement, const int *elemDOFFieldIDs, int interleaveStrategy)=0
int initSharedNodesCounter_
std::vector< parameters * > parameters_
std::vector< initElem * > initElems_
std::vector< int > setCurrentMatrix_
virtual int setSolveType(int solveType)=0
int * initFields_fieldSizes_
int setCurrentMatrixCounter_
virtual int resetMatrix(double s=0.0)=0
std::ostream & console_out()
std::vector< loadCR * > loadCRMult_
virtual int loadComplete(bool applyBCs=true, bool globalAssemble=true)=0
int readData(const char *fileName)
std::vector< const char * > methodNames
virtual int resetSystem(double s=0.0)=0
virtual int sumInElemRHS(GlobalID elemBlockID, GlobalID elemID, const GlobalID *elemConn, const double *elemLoad)=0
virtual int resetRHSVector(double s=0.0)=0
int * initElemBlock_fieldsPerNode_
virtual int setIDLists(int numMatrices, const int *matrixIDs, int numRHSs, const int *rhsIDs)=0
int appendName(const char *name)
virtual int setCurrentMatrix(int matrixID)=0
std::vector< setIDLists * > setIDLists_
std::vector< nodeBC * > loadNodeBCs_
virtual int sumInElem(GlobalID elemBlockID, GlobalID elemID, const GlobalID *elemConn, const double *const *elemStiffness, const double *elemLoad, int elemFormat)=0
virtual int putBlockFieldNodeSolution(GlobalID elemBlockID, int fieldID, int numNodes, const GlobalID *nodeIDs, const double *estimates)=0
std::vector< sumInElem * > sumInElemRHS_
const char * getParamValue(const char *key, int numParams, const char *const *paramStrings, char separator=' ')
virtual int initElem(GlobalID elemBlockID, GlobalID elemID, const GlobalID *elemConn)=0
std::vector< initCR * > initCRMult_
int ** initElemBlock_fieldIDs_