79int main(
int argc,
char** argv)
82 int numProcs, localProc;
86 std::vector<std::string> stdstrings;
91 const char** params = NULL;
99 std::string solverName;
100 std::string datasource;
114 fei::console_out() <<
"Failed to find one or more required parameters in input-file."
115 << std::endl <<
"Required parameters:"<<std::endl
116 <<
"SOLVER_LIBRARY" << std::endl
117 <<
"DATA_SOURCE" << std::endl
118 <<
"WHICH_FEI" << std::endl
119 <<
"W" << std::endl <<
"D" << std::endl <<
"DofPerNode" << std::endl;
124 if (datasource ==
"HexBeam") {
125 hexcubeptr =
new HexBeam(W, D, DofPerNode,
129 hexcubeptr =
new HexBeamCR(W, D, DofPerNode,
133 HexBeam& hexcube = *hexcubeptr;
135 if (localProc == 0) {
136 int numCRs = (W+1)*(W+1)*(numProcs*2)-1;
138 std::cout << std::endl;
139 std::cout <<
"========================================================"
141 std::cout <<
"Size W: " << W <<
" (num-elements-along-side-of-cube)"<<std::endl;
142 std::cout <<
"Size D: " << D <<
" (num-elements-along-depth-of-cube)"<<std::endl;
143 std::cout <<
"DOF per node: " << DofPerNode <<std::endl;
144 std::cout <<
"Num local elements: " << hexcube.
localNumElems_ << std::endl;
145 std::cout <<
"Num global elements: " << hexcube.
totalNumElems_ << std::endl;
146 std::cout <<
"Num local DOF: " << hexcube.
numLocalDOF_ << std::endl;
147 std::cout <<
"Num global DOF: " << hexcube.
numGlobalDOF_ << std::endl;
148 std::cout <<
"Num global CRs: " << numCRs << std::endl;
149 std::cout <<
"========================================================"
161 if (whichFEI ==
"OLDFEI") {
165 catch (std::runtime_error& exc) {
171 else if (whichFEI ==
"fei::FEI_Impl") {
175 catch (std::runtime_error& exc) {
179 fei = factory->createFEI(comm);
182 fei::console_out() <<
"beam ERROR, value of 'WHICH_FEI' must be 'OLDFEI' or 'fei::FEI_Impl'"<< std::endl;
187 CHK_ERR(
fei->parameters(numParams, params) );
196 CHK_ERR(
fei->initFields( 1, &fieldSize, &fieldID ) );
204 init_constraints(
fei.get(), hexcube, firstLocalCRID) );
210 if (localProc == 0) {
212 std::cout <<
"Initialization time: " << fei_init_time << std::endl;
235 if (localProc == 0) {
238 std::cout <<
"Coef. loading time: " << fei_load_time << std::endl;
239 std::cout <<
"Total assembly time: " << fei_init_time + fei_load_time << std::endl;
251 err =
fei->solve(status);
254 if (localProc==0) std::cout <<
"solve returned status: " << status << std::endl;
259 if (localProc == 0) {
260 std::cout <<
"Solver time: " << solve_time << std::endl;
264 if (localProc == 0) {
265#if defined(FEI_PLATFORM) && defined(FEI_OPT_LEVEL)
266 double benchmark = fei_init_time;
269 testname_init <<
"cube_"<<whichFEI<<
"_init_"<<W<<
"_"<<D<<
"_"<<DofPerNode<<
"_"
270 <<solverName<<
"_np"<<numProcs<<
"_"
271 <<FEI_PLATFORM<<
"_"<<FEI_OPT_LEVEL;
274 testname_load <<
"cube_"<<whichFEI<<
"_load_"<<W<<
"_"<<D<<
"_"<<DofPerNode<<
"_"
275 <<solverName<<
"_np"<<numProcs<<
"_"
276 <<FEI_PLATFORM<<
"_"<<FEI_OPT_LEVEL;
278 double file_init, file_load;
279 bool file_benchmarks_available =
true;
282 testname_init.str().c_str());
284 testname_load.str().c_str());
286 catch (std::runtime_error& exc) {
287 file_benchmarks_available =
false;
290 if (file_benchmarks_available) {
292 bool init_test_passed =
296 benchmark = fei_load_time;
297 bool load_test_passed =
301 returnValue = init_test_passed&&load_test_passed ? 0 : 1;
306 bool testPassed = returnValue==0;
307 if (testPassed && localProc == 0) {
309 std::cout <<
"beam execution successful" << std::endl;