12 #define BOOST_ALLOW_DEPRECATED_HEADERS
17 using namespace StaticVectorSolver;
20 SolverSSOLII_T::make_mesh()
25 std::ifstream ifs(
"../../gmsh/data/sphere_r" + std::to_string(r) +
".msh");
31 cell->set_material_id(mid_1);
33 if ((cell->center().norm() > a) && (cell->center().norm() < b))
34 cell->set_material_id(mid_2);
36 for (
unsigned int f = 0; f < GeometryInfo<3>::faces_per_cell; f++) {
37 double dif_norm = 0.0;
38 for (
unsigned int v = 1; v < GeometryInfo<3>::vertices_per_face; v++)
39 dif_norm += std::abs(cell->face(f)->vertex(0).norm() -
40 cell->face(f)->vertex(v).norm());
42 if ((dif_norm < eps) && (cell->center().norm() > rd1))
43 cell->face(f)->set_all_manifold_ids(1);
51 SolverSSOLII_T::fill_dirichlet_stack()
57 SolverSSOLII_T::solve()
64 if (log_cg_convergence)
65 control.enable_history_data();
67 GrowingVectorMemory<Vector<double>> memory;
68 SolverCG<Vector<double>> cg(control, memory);
70 PreconditionSSOR<SparseMatrix<double>> preconditioner;
81 const std::vector<double> history_data = control.get_history_data();
83 std::ofstream ofs(fname +
"_cg_convergence.csv");
86 for (
auto item : history_data) {
87 ofs << i <<
", " << item <<
"\n";
99 SolverSSOLII_A::fill_dirichlet_stack()
105 SolverSSOLII_A::solve()
112 if (log_cg_convergence)
113 control.enable_history_data();
115 GrowingVectorMemory<Vector<double>> memory;
116 SolverCG<Vector<double>> cg(control, memory);
118 PreconditionSSOR<SparseMatrix<double>> preconditioner;
129 const std::vector<double> history_data = control.get_history_data();
131 std::ofstream ofs(fname +
"_cg_convergence.csv");
134 for (
auto item : history_data) {
135 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.