24#define fei_file "test_FEI.cpp"
52 errcode = test_params->getIntParamValue(
"NUM_SOLVES", numSolves);
54 std::string solverName;
55 errcode = test_params->getStringParamValue(
"SOLVER_LIBRARY", solverName);
57 throw std::runtime_error(
".input file doesn't contain 'SOLVER_LIBRARY'");
61 errcode = test_params->getStringParamValue(
"WHICH_FEI", whichFEI);
63 throw std::runtime_error(
".input file doesn't contain 'WHICH_FEI'");
66 std::string inputFileName;
67 errcode = test_params->getStringParamValue(
"INPUT_FILE",inputFileName);
69 throw std::runtime_error(
".input file doesn't contain 'INPUT_FILE'");
72 std::string paramFile;
73 errcode = test_params->getStringParamValue(
"PARAM_FILE", paramFile);
75 throw std::runtime_error(
".input file doesn't contain 'PARAM_FILE'");
79 errcode = test_params->getStringParamValue(
"SOLN_FILE", solnFile);
81 throw std::runtime_error(
".input file doesn't contain 'SOLN_FILE'");
84 std::string checkFile;
85 errcode = test_params->getStringParamValue(
"CHECK_FILE", checkFile);
87 throw std::runtime_error(
".input file doesn't contain 'CHECK_FILE'");
90 std::string readerType;
91 errcode = test_params->getStringParamValue(
"READER_TYPE", readerType);
99 std::string fullName_str = fullName.str();
100 const char* fullName_c_str = fullName_str.c_str();
105 CHK_ERR( data_reader->readData(fullName_c_str));
109 const char* paramFile_c_str = fullParamFileName.c_str();
111 std::vector<std::string> param_file_contents;
113 param_file_contents);
115 data_reader->numParams_ = param_file_contents.size();
116 data_reader->paramStrings_ =
new char*[data_reader->numParams_];
118 for(
unsigned i=0; i<param_file_contents.size(); ++i) {
119 std::string& str = param_file_contents[i];
120 data_reader->paramStrings_[i] =
new char[str.size()+1];
121 for(
unsigned j=0; j<str.size(); ++j) {
122 data_reader->paramStrings_[i][j] = str[j];
124 data_reader->paramStrings_[i][str.size()] =
'\0';
127 data_reader->solverLibraryName_ = solverName;
130 data_reader->solnFileName_ = fullSolnFile;
133 data_reader->checkFileName_ = fullCheckFile;
138 if (whichFEI ==
"OLDFEI") {
141 if (whichFEI ==
"fei::FEI_Impl") {
142 bool useNewFEI =
true;
146 else if (whichFEI ==
"new_fei") {
150 if (fei_tester.
get() == NULL) {
154 fei_tester->setPath(
path_);
156 int errCode = fei_tester->testInitialization();
165 for(
int solveCounter=1; solveCounter<=numSolves; solveCounter++) {
167 CHK_ERR( fei_tester->testLoading() );
176 CHK_ERR( fei_tester->testSolve() );
178 CHK_ERR( fei_tester->testCheckResult() );
188 std::vector<std::string> inputFileStrings;
193 std::size_t length =
path_.size();
195 if (
path_[length-1] !=
'/') filename<<
"/";
200 std::string filename_str = filename.str();
201 const char* filename_c_str = filename_str.c_str();
215 std::size_t length =
path_.size();
217 if (
path_[length-1] !=
'/') osstr<<
"/";
std::string fully_qualified_name(const std::string &fileName)
fei::SharedPtr< fei::ParameterSet > get_test_parameters()
#define FEI_OSTRINGSTREAM
void parse_strings(std::vector< std::string > &stdstrings, const char *separator_string, fei::ParameterSet ¶mset)
void read_input_file(const char *filename, MPI_Comm comm, std::vector< std::string > &file_contents)