12 #define BOOST_ALLOW_DEPRECATED_HEADERS
16 using namespace StaticVectorSolver;
19 SolverSSOLIII_T::make_mesh()
24 std::ifstream ifs(
"../../gmsh/data/sphere_r" + std::to_string(r) +
".msh");
30 cell->set_material_id(mid_1);
32 if ((cell->center().norm() > a1) && (cell->center().norm() < b1))
33 cell->set_material_id(mid_2);
35 if ((cell->center().norm() > a2) && (cell->center().norm() < b2))
36 cell->set_material_id(mid_3);
38 for (
unsigned int f = 0; f < GeometryInfo<3>::faces_per_cell; f++) {
39 double dif_norm = 0.0;
40 for (
unsigned int v = 1; v < GeometryInfo<3>::vertices_per_face; v++)
41 dif_norm += std::abs(cell->face(f)->vertex(0).norm() -
42 cell->face(f)->vertex(v).norm());
44 if ((dif_norm < eps) && (cell->center().norm() > rd1))
45 cell->face(f)->set_all_manifold_ids(1);
53 SolverSSOLIII_T::fill_dirichlet_stack()
59 SolverSSOLIII_T::solve()
66 if (log_cg_convergence)
67 control.enable_history_data();
69 GrowingVectorMemory<Vector<double>> memory;
70 SolverCG<Vector<double>> cg(control, memory);
72 PreconditionSSOR<SparseMatrix<double>> preconditioner;
83 const std::vector<double> history_data = control.get_history_data();
85 std::ofstream ofs(fname +
"_cg_convergence.csv");
88 for (
auto item : history_data) {
89 ofs << i <<
", " << item <<
"\n";
101 SolverSSOLIII_A::fill_dirichlet_stack()
107 SolverSSOLIII_A::solve()
114 if (log_cg_convergence)
115 control.enable_history_data();
117 GrowingVectorMemory<Vector<double>> memory;
118 SolverCG<Vector<double>> cg(control, memory);
120 PreconditionSSOR<SparseMatrix<double>> preconditioner;
131 const std::vector<double> history_data = control.get_history_data();
133 std::ofstream ofs(fname +
"_cg_convergence.csv");
136 for (
auto item : history_data) {
137 ofs << i <<
", " << item <<
"\n";
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...
Solves static vector boundary value problem.
Solves static vector boundary value problem.