Logbook  (07-04-2025)
Static problems
solver.hpp
1 /******************************************************************************
2  * Copyright (C) Siarhei Uzunbajakau, 2023.
3  *
4  * This program is free software. You can use, modify, and redistribute it under
5  * the terms of the GNU Lesser General Public License as published by the Free
6  * Software Foundation, either version 3 or (at your option) any later version.
7  * This program is distributed without any warranty.
8  *
9  * Refer to COPYING.LESSER for more details.
10  ******************************************************************************/
11 
12 #ifndef SolverMMSVTI_H__
13 #define SolverMMSVTI_H__
14 
15 #include <deal.II/base/function.h>
16 #include <deal.II/base/tensor_function.h>
17 #include <deal.II/base/vectorization.h>
18 
19 #include <deal.II/lac/precondition.h>
20 #include <deal.II/lac/solver_cg.h>
21 #include <deal.II/lac/solver_control.h>
22 #include <deal.II/lac/sparse_direct.h>
23 
24 #include <deal.II/grid/grid_in.h>
25 #include <deal.II/grid/grid_tools.h>
26 #include <deal.II/grid/manifold_lib.h>
27 
28 #include <fstream>
29 #include <string>
30 
31 #include "exact_solution.hpp"
32 #include "settings.hpp"
33 #include "static_vector_solver_i.hpp"
34 #include "static_vector_solver_ii.hpp"
35 
36 using namespace StaticVectorSolver;
37 
44  : public SettingsMMSVTI
45  , public Solver1<3, 0>
46 {
47 public:
48  SolverMMSVTI_T() = delete;
49 
63  SolverMMSVTI_T(unsigned int p,
64  unsigned int mapping_degree,
65  unsigned int r,
66  std::string fname)
67  : Solver1<3, 0>(p,
68  mapping_degree,
69  3,
70  0.0,
71  fname,
72  nullptr,
73  SettingsMMSVTI::print_time_tables,
74  false,
75  true)
76  , r(r)
77  , fname(fname)
78  {
80  }
81 
82  ~SolverMMSVTI_T() = default;
83 
84 private:
85  const unsigned int r;
86  const std::string fname;
87 
88  virtual void make_mesh() override final;
89  virtual void fill_dirichlet_stack() override final;
90  virtual void solve() override final;
91 
92  const SphericalManifold<3> sphere;
93  DirichletBC_MMSVTI_T dirichlet_bc;
94 };
95 
102  : public SettingsMMSVTI
103  , public Solver2<3, 2>
104 {
105 public:
106  SolverMMSVTI_A() = delete;
107 
127  SolverMMSVTI_A(unsigned int p,
128  unsigned int mapping_degree,
129  const Triangulation<3>& triangulation_T,
130  const DoFHandler<3>& dof_handler_T,
131  const Vector<double>& solution_T,
132  unsigned int r,
133  std::string fname)
134  : Solver2<3, 2>(p,
135  mapping_degree,
136  triangulation_T,
137  dof_handler_T,
138  solution_T,
139  0,
140  0.0,
141  fname,
142  &dirichlet_bc,
143  SettingsMMSVTI::print_time_tables,
144  SettingsMMSVTI::project_exact_solution,
145  true)
146  , fname(fname)
147  , r(r)
148  {
150  }
151 
152  ~SolverMMSVTI_A() = default;
153 
154 private:
155  const std::string fname;
156 
157  const unsigned int r;
158 
159  DirichletBC_MMSVTI_A dirichlet_bc;
160  // Solver2 reuses triangulations of other solvers.
161  // No make_mesh() this time around.
162  virtual void fill_dirichlet_stack() override final;
163  virtual void solve() override final;
164 };
165 
166 #endif
Describes the Dirichlet boundary condition for , in the Method of manufactured solutions,...
Describes the Dirichlet boundary condition for , in the Method of manufactured solutions,...
Global settings for the Method of manufactured solutions, vector potential (mms-vt-i/) numerical expe...
Definition: settings.hpp:26
Implements the solver for magnetic vector potential, , in the Method of manufactured solutions,...
Definition: solver.hpp:104
SolverMMSVTI_A(unsigned int p, unsigned int mapping_degree, const Triangulation< 3 > &triangulation_T, const DoFHandler< 3 > &dof_handler_T, const Vector< double > &solution_T, unsigned int r, std::string fname)
Definition: solver.hpp:127
Implements the solver for current vector potential, , in the Method of manufactured solutions,...
Definition: solver.hpp:46
SolverMMSVTI_T(unsigned int p, unsigned int mapping_degree, unsigned int r, std::string fname)
Definition: solver.hpp:63
Solves static vector boundary value problem.
void run()
Runs the simulation.
Solves static vector boundary value problem.
void run()
Runs the simulation.