12 #define BOOST_ALLOW_DEPRECATED_HEADERS
17 SolverMMSVTII_T::make_mesh()
23 std::ifstream ifs(
"../../gmsh/data/square_r" + std::to_string(r) +
".msh");
25 std::ifstream ifs(
"../../gmsh/data/circle_r" + std::to_string(r) +
".msh");
35 for (
unsigned int f = 0; f < GeometryInfo<2>::faces_per_cell; f++) {
36 dif_norm = std::abs(cell->face(f)->vertex(0).norm() -
37 cell->face(f)->vertex(1).norm());
39 if ((dif_norm <
eps) && (cell->center().norm() >
rd1))
40 cell->face(f)->set_all_manifold_ids(1);
49 SolverMMSVTII_T::fill_dirichlet_stack()
55 SolverMMSVTII_T::solve()
63 control.enable_history_data();
65 GrowingVectorMemory<Vector<double>> memory;
66 SolverCG<Vector<double>> cg(control, memory);
68 PreconditionSSOR<SparseMatrix<double>> preconditioner;
79 const std::vector<double> history_data = control.get_history_data();
81 std::ofstream ofs(fname +
"_cg_convergence.csv");
84 for (
auto item : history_data) {
85 ofs << i <<
", " << item <<
"\n";
97 SolverMMSVTII_A::fill_dirichlet_stack()
103 SolverMMSVTII_A::solve()
111 control.enable_history_data();
113 GrowingVectorMemory<Vector<double>> memory;
114 SolverCG<Vector<double>> cg(control, memory);
116 PreconditionSSOR<SparseMatrix<double>> preconditioner;
127 const std::vector<double> history_data = control.get_history_data();
129 std::ofstream ofs(fname +
"_cg_convergence.csv");
132 for (
auto item : history_data) {
133 ofs << i <<
", " << item <<
"\n";
const types::boundary_id bid_dirichlet
The Dirichlet boundary condition will be applied to the boundaries with ID = 1.
const double rd1
The radius of the circle (sphere) that encloses the square (cube) in the middle of the mesh.
const double eps
Two values in double format are considered to be equal if the absolute value of their difference is l...
const bool log_cg_convergence
If set to true, saves the residual at each iteration of the CG solver. The names of the files fit the...
std::map< types::boundary_id, const Function< dim > * > dirichlet_stack
A map that contains pairs of boundary IDs and the corresponding Dirichlet boundary conditions.
Triangulation< dim > triangulation
The mesh.
Vector< double > system_rhs
The system right-hand side vector.
Vector< double > solution
The solution vector, i.e., degrees of freedom yielded by the simulation.
AffineConstraints< double > constraints
The constraints associated with the Dirichlet boundary conditions.
SparseMatrix< double > system_matrix
The system matrix.
std::map< types::boundary_id, const Function< dim > * > dirichlet_stack
A map that contains pairs of boundary IDs and the corresponding Dirichlet boundary conditions....
SparseMatrix< double > system_matrix
The system matrix.
Vector< double > solution
The solution vector, that is, degrees of freedom yielded by the simulation.
Vector< double > system_rhs
The system right-hand side vector.
AffineConstraints< double > constraints
The constraints associated with the Dirichlet boundary conditions.