5 #include "Epetra_ConfigDefs.h" 8 #include "Epetra_MpiComm.h" 10 #include "Epetra_SerialComm.h" 15 int main(
int argc,
char *argv[]){
17 std::string xmlInFileName =
"";
20 Teuchos::CommandLineProcessor clp(
false);
21 clp.setOption(
"xml-in-file",&xmlInFileName,
"The XML file to read into a parameter list");
22 clp.setOption(
"mesh-index",&meshIndex,
"The index of the manufactured mesh.");
23 clp.setDocString(
"TO DO.");
25 Teuchos::CommandLineProcessor::EParseCommandLineReturn
26 parse_return = clp.parse(argc,argv);
27 if( parse_return != Teuchos::CommandLineProcessor::PARSE_SUCCESSFUL ) {
28 std::cout <<
"\nEnd Result: TEST FAILED" << std::endl;
33 MPI_Init(&argc, &argv);
34 Epetra_MpiComm Comm(MPI_COMM_WORLD);
36 Epetra_SerialComm Comm;
39 Teuchos::RCP<Teuchos::ParameterList> paramList = Teuchos::rcp(
new Teuchos::ParameterList);
40 if(xmlInFileName.length()){
41 Teuchos::updateParametersFromXmlFile(xmlInFileName, inoutArg(*paramList));
45 paramList->print(std::cout,2,
true,
true);
48 Epetra_SerialDenseVector parameters(7);
49 parameters(0) = Teuchos::getParameter<double>(paramList->sublist(
"TIMooney"),
"mu1");
50 parameters(1) = Teuchos::getParameter<double>(paramList->sublist(
"TIMooney"),
"mu2");
51 parameters(2) = Teuchos::getParameter<double>(paramList->sublist(
"TIMooney"),
"mu3");
52 parameters(3) = Teuchos::getParameter<double>(paramList->sublist(
"TIMooney"),
"mu4");
53 parameters(4) = Teuchos::getParameter<double>(paramList->sublist(
"TIMooney"),
"mu5");
54 parameters(5) = Teuchos::getParameter<double>(paramList->sublist(
"TIMooney"),
"beta4");
55 parameters(6) = Teuchos::getParameter<double>(paramList->sublist(
"TIMooney"),
"beta5");
56 for (
unsigned int i=0;
i<5; ++
i){
57 parameters(
i) = 1.0e3*parameters(
i);
59 double plyagl = 2.0*M_PI*30.0/360.0;
62 std::string path = Teuchos::getParameter<std::string>(paramList->sublist(
"Mesh"),
"path");
63 std::string meshname =
"manufactured" + std::to_string(meshIndex) +
".msh";
64 std::string fullpath = path + meshname;
66 Teuchos::RCP<newtonRaphson> Newton = Teuchos::rcp(
new newtonRaphson(*manufactured,*paramList));
67 manufactured->set_parameters(parameters,plyagl);
70 Newton->Initialization();
71 Newton->setParameters(*paramList);
72 int error = Newton->Solve_with_Aztec(
true);
74 std::string outpath = Teuchos::getParameter<std::string>(paramList->sublist(
"Mesh"),
"outpath");
75 std::string fulloutpath = outpath + std::to_string(meshIndex) +
".mtx";
76 Newton->print_newton_solution(fulloutpath);
79 fulloutpath = outpath +
"_gl_" + std::to_string(meshIndex) +
".mtx";
80 manufactured->compute_green_lagrange(*Newton->x,xi,xi,xi,fulloutpath);
81 errorL2 = manufactured->errorL2(*Newton->x);
85 output.open(
"output.txt",std::ios_base::app);
86 output << meshname << std::setw(5) << Comm.NumProc() << std::setw(15) << errorL2 <<
"\n";
int main(int argc, char *argv[])