5 #include "Epetra_ConfigDefs.h" 8 #include "Epetra_MpiComm.h" 10 #include "Epetra_SerialComm.h" 14 #include "Teuchos_RCP.hpp" 15 #include "Teuchos_ParameterList.hpp" 16 #include "Teuchos_StandardCatchMacros.hpp" 17 #include "Teuchos_CommandLineProcessor.hpp" 18 #include "Teuchos_XMLParameterListCoreHelpers.hpp" 20 int main(
int argc,
char *argv[]){
22 std::string xmlInFileName =
"";
24 Teuchos::CommandLineProcessor clp(
false);
25 clp.setOption(
"xml-in-file",&xmlInFileName,
"The XML file to read into a parameter list");
26 clp.setDocString(
"TO DO.");
28 Teuchos::CommandLineProcessor::EParseCommandLineReturn
29 parse_return = clp.parse(argc,argv);
30 if( parse_return != Teuchos::CommandLineProcessor::PARSE_SUCCESSFUL ) {
31 std::cout <<
"\nEnd Result: TEST FAILED" << std::endl;
36 MPI_Init(&argc, &argv);
37 Epetra_MpiComm Comm(MPI_COMM_WORLD);
39 Epetra_SerialComm Comm;
42 Teuchos::RCP<Teuchos::ParameterList> paramList = Teuchos::rcp(
new Teuchos::ParameterList);
43 if(xmlInFileName.length()) {
44 Teuchos::updateParametersFromXmlFile(xmlInFileName, inoutArg(*paramList));
48 paramList->print(std::cout,2,
true,
true);
51 Epetra_SerialDenseVector x(7);
52 x(0) = Teuchos::getParameter<double>(paramList->sublist(
"TIMooney"),
"mu1");
53 x(1) = Teuchos::getParameter<double>(paramList->sublist(
"TIMooney"),
"mu2");
54 x(2) = Teuchos::getParameter<double>(paramList->sublist(
"TIMooney"),
"mu3");
55 x(3) = Teuchos::getParameter<double>(paramList->sublist(
"TIMooney"),
"mu4");
56 x(4) = Teuchos::getParameter<double>(paramList->sublist(
"TIMooney"),
"mu5");
57 x(5) = Teuchos::getParameter<double>(paramList->sublist(
"TIMooney"),
"beta4");
58 x(6) = Teuchos::getParameter<double>(paramList->sublist(
"TIMooney"),
"beta5");
59 for (
unsigned int i=0;
i<5;
i++){
62 double angle = 15.0*2.0*M_PI/360.0;
64 Teuchos::RCP<compressibleHyperelasticity_linearPatchTest> obj =
66 obj->set_parameters(x,angle);
68 Teuchos::RCP<newtonRaphson> newton =
71 newton->Initialization();
72 int flagNewton = newton->Solve_with_Aztec(
true);
76 errorL2 = obj->errorL2(*newton->x);
77 std::string filenameU =
"/Users/brian/Documents/GitHub/Trilinos_results/nrl/UlinearPatchTest.mtx";
78 newton->print_newton_solution(filenameU);
80 std::cout <<
"-----------------------------\n";
81 std::cout <<
"||u||_L^2 = " << errorL2 <<
"\n";
82 std::cout <<
"-----------------------------\n";
int main(int argc, char *argv[])