12 #define BOOST_ALLOW_DEPRECATED_HEADERS
14 #include <deal.II/base/multithread_info.h>
15 #include <deal.II/base/timer.h>
21 #include "project_A_to_B.hpp"
22 #include "project_T_to_J.hpp"
25 #include "settings.hpp"
28 using namespace StaticVectorSolver;
40 if (nr_threads_max > 0)
41 MultithreadInfo::set_thread_limit(nr_threads_max);
44 const unsigned int mapping_degree = 1;
45 const std::string dir =
"Data/cube/";
49 const unsigned int mapping_degree = 2;
50 const std::string dir =
"Data/sphere/";
53 std::cout <<
"Program: mss-vt-i\n"
56 <<
"Domain type: " << DOMAIN__ <<
"\n"
57 <<
"Writing to: " << dir <<
"\n";
62 for (
unsigned int p = 0; p < 3; p++) {
66 for (
unsigned int r = 5; r < 9; r++) {
67 table_J.add_value(
"r", r);
68 table_J.add_value(
"p", p);
70 table_B.add_value(
"r", r);
71 table_B.add_value(
"p", p);
74 std::cout <<
"Stage 0: solving for T ...\n";
79 dir +
"solution_T_p" + std::to_string(p) +
"_r" +
85 std::cout <<
"Stage 1: projecting T in H(curl) to Jf in H(div) ...\n";
94 dir +
"solution_J_p" + std::to_string(p) +
"_r" +
102 table_J.add_value(
"ndofs", stage0.
get_n_dofs());
105 table_J.add_value(
"H1", 0.0);
110 std::cout <<
"Stage 2: solving for A ...\n";
118 dir +
"solution_A_p" + std::to_string(p) +
"_r" +
124 std::cout <<
"Stage 3: projecting A in H(curl) to B in H(div) ...\n";
133 dir +
"solution_B_p" + std::to_string(p) +
"_r" +
141 table_B.add_value(
"ndofs", stage0.
get_n_dofs());
144 table_B.add_value(
"H1", 0.0);
147 std::cout <<
"Table J \n";
148 table_J.
save(dir +
"main_table_J_p" + std::to_string(p));
150 std::cout <<
"Table B \n";
151 table_B.
save(dir +
"main_table_B_p" + std::to_string(p));
162 }
catch (std::exception& exc) {
163 std::cerr << std::endl
165 <<
"----------------------------------------------------"
167 std::cerr <<
"Exception on processing: " << std::endl
168 << exc.what() << std::endl
169 <<
"Aborting!" << std::endl
170 <<
"----------------------------------------------------"
174 std::cerr << std::endl
176 <<
"----------------------------------------------------"
178 std::cerr <<
"Unknown exception!" << std::endl
179 <<
"Aborting!" << std::endl
180 <<
"----------------------------------------------------"
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-i/) num...
Describes exact solution, , of the Method of manufactured solutions, vector potential (mms-vt-i/) num...
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-i/) numerical expe...
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,...
Computes the magnetic field as a curl of the magnetic vector potential, , i.e., .
double get_L2_norm()
Returns error norm.
void clear()
Releases computer memory associated with system matrix and right-hand side.
Computes the volume free-current density as a curl of the current vector potential,...
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.
const DoFHandler< dim > & get_dof_handler() const
Returns a reference to dof handler.
const Vector< double > & get_solution() const
Returns a reference to solution.
const Triangulation< dim > & get_tria() const
Returns a reference to triangulation.
void clear()
Releases computer memory associated with system matrix and right-hand side.
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.