39#define fei_file "cube_main.cpp"
46 MPI_Comm comm,
int numProcs,
int localProc){
48 std::vector<std::string> stdstrings;
53 const char** params = NULL;
61 std::string solverName;
62 std::string datasource;
76 fei::console_out() <<
"Failed to find one or more required parameters in input-file."
86 if (datasource ==
"HexBeam") {
87 hexcubeptr =
new HexBeam(W, D, DofPerNode,
91 hexcubeptr =
new HexBeamCR(W, D, DofPerNode,
98 int numCRs = (W+1)*(W+1)*(numProcs*2)-1;
101 FEI_COUT <<
"========================================================"
103 FEI_COUT <<
"Size W: " << W <<
" (num-elements-along-side-of-cube)"<<
FEI_ENDL;
104 FEI_COUT <<
"Size D: " << D <<
" (num-elements-along-depth-of-cube)"<<
FEI_ENDL;
111 FEI_COUT <<
"========================================================"
123 if (whichFEI ==
"OLDFEI") {
127 catch (std::runtime_error& exc) {
133 else if (whichFEI ==
"fei::FEI_Impl") {
137 catch (std::runtime_error& exc) {
141 fei = factory->createFEI(comm);
149 CHK_ERR(
fei->parameters(numParams, params) );
158 CHK_ERR(
fei->initFields( 1, &fieldSize, &fieldID ) );
166 init_constraints(
fei.get(), hexcube, firstLocalCRID) );
172 if (localProc == 0) {
197 if (localProc == 0) {
201 FEI_COUT <<
"Total assembly time: " << fei_init_time + fei_load_time <<
FEI_ENDL;
213 err =
fei->solve(status);
216 if (localProc==0)
FEI_COUT <<
"solve returned status: " << status <<
FEI_ENDL;
221 if (localProc == 0) {
226 if (localProc == 0) {
227#if defined(FEI_PLATFORM) && defined(FEI_OPT_LEVEL)
228 double benchmark = fei_init_time;
231 testname_init <<
"cube_"<<whichFEI<<
"_init_"<<W<<
"_"<<D<<
"_"<<DofPerNode<<
"_"
232 <<solverName<<
"_np"<<numProcs<<
"_"
233 <<FEI_PLATFORM<<
"_"<<FEI_OPT_LEVEL;
236 testname_load <<
"cube_"<<whichFEI<<
"_load_"<<W<<
"_"<<D<<
"_"<<DofPerNode<<
"_"
237 <<solverName<<
"_np"<<numProcs<<
"_"
238 <<FEI_PLATFORM<<
"_"<<FEI_OPT_LEVEL;
240 double file_init, file_load;
241 bool file_benchmarks_available =
true;
244 testname_init.str().c_str());
246 testname_load.str().c_str());
248 catch (std::runtime_error& exc) {
249 file_benchmarks_available =
false;
252 if (file_benchmarks_available) {
254 bool init_test_passed =
258 benchmark = fei_load_time;
259 bool load_test_passed =
263 returnValue = init_test_passed&&load_test_passed ? 0 : 1;
268 bool testPassed = returnValue==0;
269 if (testPassed && localProc == 0) {
int beam_oldfei_main(int argc, char **argv, MPI_Comm comm, int numProcs, int localProc)
HexBeamCR(int W, int D, int DofPerNode, int decomp, int numProcs, int localProc)
HexBeam(int W, int D, int DofPerNode, int decomp, int numProcs, int localProc)
virtual int numDofPerNode()
int getIntParamValue(const char *name, int ¶mValue) const
int getStringParamValue(const char *name, std::string ¶mValue) const
#define FEI_SINGLE_SYSTEM
#define FEI_OSTRINGSTREAM
#define FEI_Implementation
int init_elem_connectivities(FEI *fei, HexBeam &hexcube)
int load_elem_data(FEI *fei, HexBeam &hexcube)
int load_constraints(FEI *fei, HexBeam &hexcube, int firstLocalCRID)
int init_shared_nodes(FEI *fei, HexBeam &hexcube)
void parse_strings(std::vector< std::string > &stdstrings, const char *separator_string, fei::ParameterSet ¶mset)
void strings_to_char_ptrs(std::vector< std::string > &stdstrings, int &numStrings, const char **&charPtrs)
int get_filename_and_read_input(int argc, char **argv, MPI_Comm comm, int localProc, std::vector< std::string > &stdstrings)
bool check_and_cout_test_result(std::string testname, double value, double file_value, unsigned margin)
double get_file_benchmark(const char *filename, const char *testname)
fei::SharedPtr< fei::Factory > create_fei_Factory(MPI_Comm comm, const char *libraryName)
std::ostream & console_out()
fei::SharedPtr< LibraryWrapper > create_LibraryWrapper(MPI_Comm comm, const char *libraryName)