12 #include <fei_macros.hpp>
18 #include <fei_base.hpp>
19 #include <FEI_Implementation.hpp>
21 #include <fei_LibraryWrapper.hpp>
22 #include <test_utils/LibraryFactory.hpp>
24 #include <test_utils/Poisson_Elem.hpp>
25 #include <test_utils/PoissonData.hpp>
27 #include <test_utils/ElemBlock.hpp>
28 #include <test_utils/CRSet.hpp>
29 #include <test_utils/BCNodeSet.hpp>
30 #include <test_utils/CommNodeSet.hpp>
31 #include <test_utils/DataReader.hpp>
32 #include <test_utils/driverData.hpp>
33 #include <test_utils/fei_test_utils.hpp>
34 #include <test_utils/SolnCheck.hpp>
37 #define fei_file "feiDriver.cpp"
38 #include <fei_ErrMacros.hpp>
43 int feiDriver_main(
int argc,
char** argv,
44 MPI_Comm comm,
int numProcs,
int localProc){
46 std::vector<std::string> stdstrings;
50 const char** params = NULL;
57 std::string solverName;
58 std::string inputFileName;
62 fei::console_out() <<
"Expected to find both 'SOLVER_NAME' and 'INPUT_FILE' "
63 <<
"in input-file."<<FEI_ENDL;
69 FEI_OSTRINGSTREAM fullFileName;
70 fullFileName<< inputFileName<<
"."<<numProcs<<
"."<< localProc;
73 CHK_ERR( drv.readData(fullFileName.str().c_str()) );
84 catch (std::runtime_error& exc) {
91 const char* feiVersionString;
92 CHK_ERR( fei->version(feiVersionString) );
94 FEI_COUT << FEI_ENDL <<
"FEI version: " << feiVersionString << FEI_ENDL << FEI_ENDL;
96 CHK_ERR( fei->parameters(numParams, params) );
98 std::vector<const char*>& methodNames = drv.get_methodNames();
100 for(
size_t i=0; i<methodNames.size(); i++) {
101 if (!strcmp(
"destructor", methodNames[i])) {
106 FEI_COUT <<
"feiDriver: proc " << localProc <<
" destroying/reallocing FEI"
114 catch (std::runtime_error& exc) {
121 CHK_ERR( fei->parameters(numParams, params) );
126 FEI_COUT <<
"feiDriver: proc " << localProc <<
" calling FEI method: "
127 << methodNames[i] << FEI_ENDL;
128 int feierror = drv.call_fei_method(methodNames[i], fei.get());
129 if (feierror > 0)
continue;
140 if (localProc == 0) {
141 FEI_COUT <<
"feiDriver: TEST PASSED" << FEI_ENDL;
144 FEI_COUT <<
"SIERRA execution successful" << FEI_ENDL;
145 #ifdef SIERRA_BUILD_DATE
146 FEI_COUT.setf(IOS_FIXED, IOS_FLOATFIELD);
147 FEI_COUT <<
"Maximum CPU time: 0.0 seconds." << FEI_ENDL;
void strings_to_char_ptrs(std::vector< std::string > &stdstrings, int &numStrings, const char **&charPtrs)
int getStringParamValue(const char *name, std::string ¶mValue) const
int get_filename_and_read_input(int argc, char **argv, MPI_Comm comm, int localProc, std::vector< std::string > &stdstrings)
std::ostream & console_out()
void parse_strings(std::vector< std::string > &stdstrings, const char *separator_string, fei::ParameterSet ¶mset)
fei::SharedPtr< LibraryWrapper > create_LibraryWrapper(MPI_Comm comm, const char *libraryName)