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)) {
160 return(
fei->setCurrentMatrix(matID) );
163 if (!std::strcmp(
"setCurrentRHS", method)) {
171 return(
fei->setCurrentMatrix(rhsID) );
174 if (!std::strcmp(
"initFields", method)) {
180 if (!std::strcmp(
"initElemBlock", method)) {
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)) {
241 return(
fei->deleteMultCRs() );
244 if (!std::strcmp(
"initElem", method)) {
255 if (!std::strcmp(
"initComplete", method)) {
256 return(
fei->initComplete() );
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)) {
340 return(
fei->loadComplete() );
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);
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 initElemBlock_numInts_
int * initElemBlock_ints_
int appendName(const char *name)
int skipWhite(FEI_ISTREAM *instr)
int readData(const char *fileName)
std::vector< sumInElem * > sumInElems_
int setCurrentRHSCounter_
std::vector< loadCR * > loadCRMult_
int putBlockFieldNodeSolutionCounter_
int * initFields_fieldIDs_
int call_fei_method(const char *method, FEI *fei)
std::vector< parameters * > parameters_
std::vector< sumInElem * > sumInElemRHS_
std::vector< nodeBC * > loadNodeBCs_
int * initFields_fieldSizes_
int initSharedNodesCounter_
int * initElemBlock_fieldsPerNode_
std::vector< int > setCurrentMatrix_
int ** initElemBlock_fieldIDs_
std::vector< const char * > methodNames
std::vector< putBlockFieldNodeSolution * > putBlockFieldNodeSolution_
std::vector< setIDLists * > setIDLists_
int setCurrentMatrixCounter_
std::vector< sharedNodes * > initSharedNodes_
std::vector< initElem * > initElems_
int initFields_numFields_
double resetInitialGuess_
int getKeyword(FEI_ISTREAM *instr, char *&keyword)
int sumInElemMatrixCounter_
std::vector< sumInElem * > sumInElemMatrix_
int * initElemBlock_elemDofFieldIDs_
std::vector< initCR * > initCRMult_
std::vector< int > setCurrentRHS_
std::vector< char * > paramList
std::ostream & console_out()
const char * getParamValue(const char *key, int numParams, const char *const *paramStrings, char separator=' ')