12 #ifndef SolverMMSV_H__
13 #define SolverMMSV_H__
15 #include <deal.II/grid/grid_in.h>
16 #include <deal.II/grid/grid_out.h>
17 #include <deal.II/grid/grid_tools.h>
18 #include <deal.II/grid/manifold_lib.h>
22 #include "exact_solution.hpp"
23 #include "settings.hpp"
24 #include "static_vector_solver_i.hpp"
26 using namespace StaticVectorSolver;
54 unsigned int mapping_degree,
64 project_exact_solution,
69 if (DIMENSION__ == 2) {
70 if (HYPERCUBE__ == 1) {
71 fname_mesh =
"../../gmsh/data/square_r" + std::to_string(r) +
".msh";
73 fname_mesh =
"../../gmsh/data/circle_r" + std::to_string(r) +
".msh";
76 if (HYPERCUBE__ == 1) {
77 fname_mesh =
"../../gmsh/data/cube_r" + std::to_string(r) +
".msh";
79 fname_mesh =
"../../gmsh/data/sphere_r" + std::to_string(r) +
".msh";
90 const std::string fname;
91 std::string fname_mesh;
95 virtual void make_mesh() override final;
96 virtual
void fill_dirichlet_stack() override final;
97 virtual
void solve() override final;
99 const SphericalManifold<dim> sphere;
118 if (log_cg_convergence)
119 control.enable_history_data();
121 GrowingVectorMemory<Vector<double>> memory;
122 SolverCG<Vector<double>> cg(control, memory);
127 PreconditionSSOR<SparseMatrix<double>> preconditioner;
137 if (log_cg_convergence) {
138 const std::vector<double> history_data = control.get_history_data();
140 std::ofstream ofs(fname +
"_cg_convergence.csv");
143 for (
auto item : history_data) {
144 ofs << i <<
", " << item <<
"\n";
158 std::ifstream ifs(fname_mesh);
159 gridin.read_msh(ifs);
163 if (HYPERCUBE__ != 1) {
166 for (
unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; f++) {
168 double dif_norm = 0.0;
169 for (
unsigned int v = 1; v < GeometryInfo<dim>::vertices_per_face; v++)
170 dif_norm += std::abs(cell->face(f)->vertex(0).norm() -
171 cell->face(f)->vertex(v).norm());
173 if ((dif_norm < eps) && (cell->center().norm() > rd1))
174 cell->face(f)->set_all_manifold_ids(1);
Describes exact solutions, , of the Method of manufactured solutions, vector potential (mms-v/) numer...
Global settings for the Method of manufactured solutions, vector potential (mms-v/) numerical experim...
Implements the Method of manufactured solutions, vector potential (mms-v/) numerical experiment.
SolverMMSV(unsigned int p, unsigned int mapping_degree, unsigned int r, std::string fname)
Solves static vector boundary value problem.
void run()
Runs the simulation.