12 #define BOOST_ALLOW_DEPRECATED_HEADERS
14 #include <deal.II/base/multithread_info.h>
15 #include <deal.II/base/timer.h>
21 #include "project_Axy_to_Bz.hpp"
22 #include "project_Tz_to_Jxy.hpp"
25 #include "settings.hpp"
28 using namespace StaticScalarSolver;
29 using namespace StaticVectorSolver;
41 if (nr_threads_max > 0)
42 MultithreadInfo::set_thread_limit(nr_threads_max);
45 const unsigned int mapping_degree = 1;
46 std::string dir =
"Data/square/";
50 const unsigned int mapping_degree = 2;
51 std::string dir =
"Data/circle/";
54 std::cout <<
"Program: mss-vt-ii\n"
57 <<
"Domain type: " << DOMAIN__ <<
"\n"
58 <<
"Writing to: " << dir <<
"\n";
64 for (
unsigned int p = 0; p < 3; p++) {
69 for (
unsigned int r = 9; r < 13; r++) {
70 table_T.add_value(
"r", r);
71 table_T.add_value(
"p", p);
73 table_J.add_value(
"r", r);
74 table_J.add_value(
"p", p);
76 table_B.add_value(
"r", r);
77 table_B.add_value(
"p", p);
80 std::cout <<
"Stage 0: solving for T ...\n";
85 dir +
"solution_T_p" + std::to_string(p) +
"_r" +
89 table_T.add_value(
"ndofs", stage0.
get_n_dofs());
95 std::cout <<
"Stage 1: projecting T in H(curl) to Jf in H(div) ...\n";
104 dir +
"solution_J_p" + std::to_string(p) +
105 "_r" + std::to_string(r),
112 table_J.add_value(
"ndofs", stage0.
get_n_dofs());
115 table_J.add_value(
"H1", 0.0);
120 std::cout <<
"Stage 2: solving for A ...\n";
128 dir +
"solution_A_p" + std::to_string(p) +
"_r" +
134 std::cout <<
"Stage 3: projecting A in H(curl) to B in H(div) ...\n";
143 dir +
"solution_B_p" + std::to_string(p) +
144 "_r" + std::to_string(r),
151 table_B.add_value(
"ndofs", stage0.
get_n_dofs());
154 table_B.add_value(
"H1", 0.0);
156 std::cout <<
"Table T \n";
157 table_T.
save(dir +
"main_table_T_p" + std::to_string(p));
159 std::cout <<
"Table J \n";
160 table_J.
save(dir +
"main_table_J_p" + std::to_string(p));
162 std::cout <<
"Table B \n";
163 table_B.
save(dir +
"main_table_B_p" + std::to_string(p));
174 }
catch (std::exception& exc) {
175 std::cerr << std::endl
177 <<
"----------------------------------------------------"
179 std::cerr <<
"Exception on processing: " << std::endl
180 << exc.what() << std::endl
181 <<
"Aborting!" << std::endl
182 <<
"----------------------------------------------------"
186 std::cerr << std::endl
188 <<
"----------------------------------------------------"
190 std::cerr <<
"Unknown exception!" << std::endl
191 <<
"Aborting!" << std::endl
192 <<
"----------------------------------------------------"
This is a wrap-around class. It contains the main loop of the program that implements the Method of m...
Describes exact solution, , of the Method of manufactured solutions, vector potential (mms-vt-ii/) nu...
Describes exact solution, , of the Method of manufactured solutions, vector potential (mms-vt-ii/) nu...
The convergence table used in multiple numerical experiments.
void save(std::string fname)
Saves the data in text and tex formats, and prints the data on screen.
const bool project_exact_solution
If set to true, the program will project the exact solution.
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...
const bool print_time_tables
If set to true, the program will print time tables on the screen.
Global settings for the Method of manufactured solutions, vector potential (mms-vt-ii/) numerical exp...
Implements the solver for magnetic vector potential, , in the Method of manufactured solutions,...
Implements the solver for current vector potential, , in the Method of manufactured solutions,...
double get_L2_norm()
Returns error norm.
void clear()
Releases computer memory associated with system matrix and right-hand side.
Computes the two-dimensional free-current density as a vector curl of the current vector potential,...
const Triangulation< dim > & get_tria() const
Returns a reference to triangulation.
const Vector< double > & get_solution() const
Returns a reference to the solution.
double get_L2_norm() const
Returns error norm.
void clear()
Releases computer memory associated with the system matrix and right-hand side.
const DoFHandler< dim > & get_dof_handler() const
Returns a reference to dof handler.
double get_H1_norm() const
Returns error norm.
unsigned int get_n_dofs() const
Returns the total amount of the degrees of freedom.
unsigned int get_n_cells() const
Returns the number of active cells in the mesh.
Computes an out-of-plane magnetic field, , as a scalar curl of an in-plane magnetic vector potential,...
double get_L2_norm()
Returns error norm.
void clear()
Releases computer memory associated with system matrix and right-hand side.
const Vector< double > & get_solution() const
Returns a reference to solution.
const DoFHandler< dim > & get_dof_handler() const
Returns a reference to a dof handler.