5 #include "Epetra_ConfigDefs.h" 8 #include "Epetra_MpiComm.h" 10 #include "Epetra_SerialComm.h" 13 #include "Teuchos_RCP.hpp" 15 #include "Ifpack_AdditiveSchwarz.h" 16 #include "BelosLinearProblem.hpp" 17 #include "BelosBlockGmresSolMgr.hpp" 18 #include "BelosEpetraAdapter.hpp" 19 #include <BelosSolverFactory.hpp> 20 #include "BelosBlockGmresSolMgr.hpp" 21 #include "Teuchos_StandardCatchMacros.hpp" 22 #include "Teuchos_ParameterList.hpp" 23 #include "Teuchos_XMLParameterListCoreHelpers.hpp" 24 #include "Stratimikos_DefaultLinearSolverBuilder.hpp" 27 int main(
int argc,
char *argv[]){
29 std::string xmlInFileName =
"";
31 Teuchos::CommandLineProcessor clp(
false);
32 clp.setOption(
"xml-in-file",&xmlInFileName,
"The XML file to read into a parameter list");
33 clp.setDocString(
"TO DO.");
35 Teuchos::CommandLineProcessor::EParseCommandLineReturn
36 parse_return = clp.parse(argc,argv);
37 if( parse_return != Teuchos::CommandLineProcessor::PARSE_SUCCESSFUL ) {
38 std::cout <<
"\nEnd Result: TEST FAILED" << std::endl;
43 MPI_Init(&argc, &argv);
44 Epetra_MpiComm Comm(MPI_COMM_WORLD);
46 Epetra_SerialComm Comm;
49 Teuchos::RCP<Teuchos::ParameterList> paramList = Teuchos::rcp(
new Teuchos::ParameterList);
50 if(xmlInFileName.length()) {
51 Teuchos::updateParametersFromXmlFile(xmlInFileName, inoutArg(*paramList));
55 paramList->print(std::cout,2,
true,
true);
58 Teuchos::RCP<asmeSBVP>
interface = Teuchos::rcp(new asmeSBVP(Comm,*paramList));
60 double deltaN = Teuchos::getParameter<double>(paramList->sublist(
"Shinozuka"),
"deltaN");
61 double deltaM4 = Teuchos::getParameter<double>(paramList->sublist(
"Shinozuka"),
"deltaM4");
62 double deltaM5 = Teuchos::getParameter<double>(paramList->sublist(
"Shinozuka"),
"deltaM5");
63 std::string path = Teuchos::getParameter<std::string>(paramList->sublist(
"Mesh"),
"path");
65 interface->_deltaN = deltaN;
66 interface->_deltaM4 = deltaM4;
67 interface->_deltaM5 = deltaM5;
69 int * seed =
new int [5];
70 double displacement = 1.0;
72 for (
unsigned int j=0;
j<5000; ++
j){
73 seed[0] = 5*
j; seed[1] = 5*
j+1; seed[2] = 5*
j+2; seed[3] = 5*
j+3; seed[4] = 5*
j+4;
74 interface->solveOneRealization(displacement,seed);
75 std::string path1 = path + std::to_string(
j) +
".mtx";
76 std::string path2 = path + std::to_string(
j);
77 interface->print_solution(path1);
78 interface->recover_cauchy_stress(path2,seed);
79 interface->compute_deformation(*interface->solution,path2,
true,
false);
int main(int argc, char *argv[])