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 "
dirichletInletOutlet_PolyconvexHGO.hpp
"
14
#include "
newtonRaphson.hpp
"
15
16
int
main
(
int
argc,
char
*argv[]){
17
18
#ifdef HAVE_MPI
19
MPI_Init(&argc, &argv);
20
Epetra_MpiComm Comm(MPI_COMM_WORLD);
21
#else
22
Epetra_SerialComm Comm;
23
#endif
24
25
Teuchos::ParameterList Parameters;
26
Teuchos::ParameterList & aztec = Parameters.sublist(
"Krylov"
);
27
Teuchos::ParameterList & newton = Parameters.sublist(
"Newton"
);
28
Teuchos::ParameterList & mesh_sublist = Parameters.sublist(
"Mesh"
);
29
30
aztec.set(
"solver"
,
"gmres"
);
31
aztec.set(
"kspace"
,500);
32
aztec.set(
"orthog"
,
"classical"
);
33
aztec.set(
"precond"
,
"dom_decomp"
);
34
aztec.set(
"subdomain_solve"
,
"ilut"
);
35
aztec.set(
"overlap"
,2);
36
aztec.set(
"type_overlap"
,
"symmetric"
);
37
aztec.set(
"pre_calc"
,
"recalc"
);
38
aztec.set(
"ilut_fill"
,4.0);
39
aztec.set(
"athresh"
,0.0);
40
aztec.set(
"rthresh"
,0.0);
41
aztec.set(
"drop"
,0.0);
42
aztec.set(
"AZ_conv"
,
"noscaled"
);
43
aztec.set(
"AZ_tol"
,1
e
-6);
44
aztec.set(
"AZ_output"
,0);
45
aztec.set(
"AZ_diagnostics"
,
"all"
);
46
aztec.set(
"AZ_reorder"
,1);
47
48
newton.set(
"delta"
,0.25);
49
newton.set(
"iterMax"
,10);
50
newton.set(
"nbBisMax"
,5);
51
newton.set(
"NormFTol"
,1
e
-6);
52
newton.set(
"NormFMax"
,1e7);
53
newton.set(
"eps"
,1
e
-8);
54
newton.set(
"success_parameter"
,2.0);
55
newton.set(
"failure_parameter"
,2.0);
56
newton.set(
"number_of_loads"
,1);
57
newton.set(
"bc_disp"
,1.0);
58
newton.set(
"pressure_load"
,0.0/1000.0);
59
60
unsigned
int
nb_phys_groups = 4;
61
//mesh_sublist.set("mesh_file","/Users/Brian/Documents/Thesis/0-Trilinos/Meshes/Arterial_wall/arterial_wall.msh");
62
//mesh_sublist.set("boundary_file","/Users/Brian/Documents/Thesis/0-Trilinos/Meshes/Arterial_wall/nodes_to_boundaries_less_bumpy.txt");
63
mesh_sublist.set(
"mesh_file"
,
"/home/s/staber/Trilinos/Meshes/Arterial_wall/media.msh"
);
//arterial_wall.msh");
64
mesh_sublist.set(
"boundary_file"
,
"/home/s/staber/Trilinos/Meshes/Arterial_wall/nodes_to_boundaries_media.txt"
);
//nodes_to_boundaries.txt");
65
mesh_sublist.set(
"nb_phys_groups"
,nb_phys_groups);
66
67
Teuchos::ParameterList &
laplace
= Parameters.sublist(
"Laplace"
);
68
laplace.set(
"solver"
,
"cg"
);
69
laplace.set(
"precond"
,
"dom_decomp"
);
70
laplace.set(
"subdomain_solve"
,
"icc"
);
71
laplace.set(
"overlap"
,0);
72
laplace.set(
"AZ_conv"
,
"noscaled"
);
73
laplace.set(
"AZ_tol"
, 1
e
-6);
74
laplace.set(
"AZ_output"
, 0);
75
laplace.set(
"AZ_diagnostics"
, 0);
76
laplace.set(
"AZ_reorder"
, 1);
77
78
Teuchos::RCP<dirichletInletOutlet_PolyconvexHGO> my_interface = Teuchos::rcp(
new
dirichletInletOutlet_PolyconvexHGO
(Comm,Parameters));
79
Teuchos::RCP<newtonRaphson> Newton = Teuchos::rcp(
new
newtonRaphson
(*my_interface,Parameters));
80
81
my_interface->fixed = 2;
82
my_interface->moved = 3;
83
my_interface->xxmax = 11.696;
84
85
Newton->Initialization();
86
87
int
throwint;
88
throwint = Newton->Solve_with_Aztec(
true
);
89
90
my_interface->fixed = 3;
91
my_interface->moved = 2;
92
my_interface->xxmax = 0.15685;
93
94
throwint = Newton->Solve_with_Aztec(
true
);
95
96
std::string name=
"dirichlet_arteries.mtx"
;
97
Newton->print_newton_solution(name);
98
99
#ifdef HAVE_MPI
100
MPI_Finalize();
101
#endif
102
return
0;
103
104
}
dirichletInletOutlet_PolyconvexHGO
Definition:
dirichletInletOutlet_PolyconvexHGO.hpp:12
newtonRaphson
Definition:
newtonRaphson.hpp:22
newtonRaphson.hpp
laplace
Definition:
laplacepp.hpp:10
main
int main(int argc, char *argv[])
Definition:
main.cpp:23
e
e
Definition:
run.m:10
dirichletInletOutlet_PolyconvexHGO.hpp
arteries
deterministic_dirichlet
main.cpp
Generated by
1.8.13