12 #define BOOST_ALLOW_DEPRECATED_HEADERS
16 using namespace StaticVectorSolver;
19 SolverCVPI::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() > a) && (cell->center().norm() < b))
33 cell->set_material_id(mid_2);
35 for (
unsigned int f = 0; f < GeometryInfo<3>::faces_per_cell; f++) {
36 double dif_norm = 0.0;
37 for (
unsigned int v = 1; v < GeometryInfo<3>::vertices_per_face; v++)
38 dif_norm += std::abs(cell->face(f)->vertex(0).norm() -
39 cell->face(f)->vertex(v).norm());
41 if ((dif_norm < eps) && (cell->center().norm() > rd1))
42 cell->face(f)->set_all_manifold_ids(1);
50 SolverCVPI::fill_dirichlet_stack()
63 if (log_cg_convergence)
64 control.enable_history_data();
66 GrowingVectorMemory<Vector<double>> memory;
67 SolverCG<Vector<double>> cg(control, memory);
69 PreconditionSSOR<SparseMatrix<double>> preconditioner;
80 const std::vector<double> history_data = control.get_history_data();
82 std::ofstream ofs(fname +
"_cg_convergence.csv");
85 for (
auto item : history_data) {
86 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.