Trilinos based (stochastic) FEM solvers
main.cpp
Go to the documentation of this file.
1 /*
2 Brian Staber (brian.staber@gmail.com)
3 */
4 
5 #include "Epetra_ConfigDefs.h"
6 #ifdef HAVE_MPI
7 #include "mpi.h"
8 #include "Epetra_MpiComm.h"
9 #else
10 #include "Epetra_SerialComm.h"
11 #endif
12 
13 #include "Teuchos_CommandLineProcessor.hpp"
14 #include "Teuchos_StandardCatchMacros.hpp"
15 #include "Teuchos_ParameterList.hpp"
16 #include "Teuchos_XMLParameterListCoreHelpers.hpp"
18 #include "newtonRaphson.hpp"
19 
20 int main(int argc, char *argv[]){
21 
22  std::string xmlInFileName = "";
23  std::string extraXmlFile = "";
24  std::string xmlOutFileName = "paramList.out";
25 
26  Teuchos::CommandLineProcessor clp(false);
27  clp.setOption("xml-in-file",&xmlInFileName,"The XML file to read into a parameter list");
28  clp.setDocString("TO DO.");
29 
30  Teuchos::CommandLineProcessor::EParseCommandLineReturn
31  parse_return = clp.parse(argc,argv);
32  if( parse_return != Teuchos::CommandLineProcessor::PARSE_SUCCESSFUL ) {
33  std::cout << "\nEnd Result: TEST FAILED" << std::endl;
34  return parse_return;
35  }
36 
37 #ifdef HAVE_MPI
38  MPI_Init(&argc, &argv);
39  Epetra_MpiComm Comm(MPI_COMM_WORLD);
40 #else
41  Epetra_SerialComm Comm;
42 #endif
43 
44  Teuchos::RCP<Teuchos::ParameterList> paramList = Teuchos::rcp(new Teuchos::ParameterList);
45  if(xmlInFileName.length()) {
46  Teuchos::updateParametersFromXmlFile(xmlInFileName, inoutArg(*paramList));
47  }
48 
49  if (Comm.MyPID()==0){
50  paramList->print(std::cout,2,true,true);
51  }
52 
53  Teuchos::RCP<neumannInnerSurface_PolyconvexHGO> my_interface = Teuchos::rcp(new neumannInnerSurface_PolyconvexHGO(Comm,*paramList));
54  Teuchos::RCP<newtonRaphson> Newton = Teuchos::rcp(new newtonRaphson(*my_interface,*paramList));
55 
56  Newton->Initialization();
57  Newton->setParameters(*paramList);
58  int error = Newton->Solve_with_Aztec(true);
59  if (!error){
60  std::string path = "/home/s/staber/Trilinos_results/arteries/gmrf_neumann/";
61  std::string filename1 = path + "disp_mean_model.mtx";
62  Newton->print_newton_solution(filename1);
63  std::string filename2 = path + "stress_mean_model";
64  my_interface->compute_center_cauchy_stress(*Newton->x,filename2);
65  }
66 
67 #ifdef HAVE_MPI
68  MPI_Finalize();
69 #endif
70 return 0;
71 
72 }
int main(int argc, char *argv[])
Definition: main.cpp:23