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);
43 std::string dir =
"Data/sphere/";
46 std::cout <<
"Program: ssol-ii\n"
49 <<
"Writing to: " << dir <<
"\n";
54 for (
unsigned int p = 0; p < 3; p++) {
58 for (
unsigned int r = 6; r < 10; r++) {
59 table_J.add_value(
"r", r);
60 table_J.add_value(
"p", p);
62 table_B.add_value(
"r", r);
63 table_B.add_value(
"p", p);
66 std::cout <<
"Stage 0: solving for T ...\n";
69 dir +
"solution_T_p" + std::to_string(p) +
"_r" + std::to_string(r);
72 std::cout <<
"Time table T \n";
79 std::cout <<
"Stage 1: projecting T in H(curl) to Jf in H(div) ...\n";
82 dir +
"solution_J_p" + std::to_string(p) +
"_r" + std::to_string(r);
85 std::cout <<
"Time table J \n";
103 table_J.add_value(
"ndofs", stage1.
get_n_dofs());
106 table_J.add_value(
"H1", 0.0);
109 std::cout <<
"Stage 2: solving for A ...\n";
112 dir +
"solution_A_p" + std::to_string(p) +
"_r" + std::to_string(r);
115 std::cout <<
"Time table A \n";
128 std::cout <<
"Stage 3: projecting A in H(curl) to B in H(div) ...\n";
131 dir +
"solution_B_p" + std::to_string(p) +
"_r" + std::to_string(r);
134 std::cout <<
"Time table B \n";
150 table_B.add_value(
"ndofs", stage3.
get_n_dofs());
153 table_B.add_value(
"H1", 0.0);
156 std::cout <<
"Table J\n";
157 table_J.
save(dir +
"table_J_p" + std::to_string(p));
159 std::cout <<
"Table B\n";
160 table_B.
save(dir +
"table_B_p" + std::to_string(p));
171 }
catch (std::exception& exc) {
172 std::cerr << std::endl
174 <<
"----------------------------------------------------"
176 std::cerr <<
"Exception on processing: " << std::endl
177 << exc.what() << std::endl
178 <<
"Aborting!" << std::endl
179 <<
"----------------------------------------------------"
183 std::cerr << std::endl
185 <<
"----------------------------------------------------"
187 std::cerr <<
"Unknown exception!" << std::endl
188 <<
"Aborting!" << std::endl
189 <<
"----------------------------------------------------"
This is a wrap-around class. It contains the main loop of the program that implements the Thick spher...
Describes the exact solution, , of the Thick spherical coil (ssol-ii/) numerical experiment.
Describes the exact solution, , of the Thick spherical coil (ssol-ii/) numerical experiment.
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 Thick spherical coil (ssol-ii/) numerical experiment.
const bool print_time_tables
If set to true, the program will print time tables on the screen.
Solves for the magnetic vector potential, , in the Thick spherical coil (ssol-ii/) numerical experime...
Solves for the current vector potential, , in the Thick spherical coil (ssol-ii/) numerical experimen...
Computes the magnetic field as a curl of the magnetic vector potential, , i.e., .
double get_L2_norm()
Returns error norm.
unsigned int get_n_cells() const
Returns the number of active cells in the mesh.
unsigned int get_n_dofs() const
Returns the total amount of the degrees of freedom.
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,...
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.