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;
41 if (nr_threads_max > 0)
42 MultithreadInfo::set_thread_limit(nr_threads_max);
44 std::string dir =
"Data/sphere/";
47 std::cout <<
"Program: ssol-iii\n"
50 <<
"Writing to: " << dir <<
"\n";
55 for (
unsigned int p = 0; p < 3; p++) {
59 for (
unsigned int r = 6; r < 10; r++) {
60 table_J.add_value(
"r", r);
61 table_J.add_value(
"p", p);
63 table_B.add_value(
"r", r);
64 table_B.add_value(
"p", p);
67 std::cout <<
"Stage 0: solving for T ...\n";
70 dir +
"solution_T_p" + std::to_string(p) +
"_r" + std::to_string(r);
73 std::cout <<
"Time table T \n";
80 std::cout <<
"Stage 1: projecting T in H(curl) to Jf in H(div) ...\n";
83 dir +
"solution_J_p" + std::to_string(p) +
"_r" + std::to_string(r);
86 std::cout <<
"Time table J \n";
104 table_J.add_value(
"ndofs", stage1.
get_n_dofs());
107 table_J.add_value(
"H1", 0.0);
110 std::cout <<
"Stage 2: solving for A ...\n";
113 dir +
"solution_A_p" + std::to_string(p) +
"_r" + std::to_string(r);
116 std::cout <<
"Time table A \n";
129 std::cout <<
"Stage 3: projecting A in H(curl) to B in H(div) ...\n";
132 dir +
"solution_B_p" + std::to_string(p) +
"_r" + std::to_string(r);
135 std::cout <<
"Time table B \n";
151 table_B.add_value(
"ndofs", stage3.
get_n_dofs());
154 table_B.add_value(
"H1", 0.0);
157 std::cout <<
"Table J\n";
158 table_J.
save(dir +
"table_J_p" + std::to_string(p));
160 std::cout <<
"Table B\n";
161 table_B.
save(dir +
"table_B_p" + std::to_string(p));
172 }
catch (std::exception& exc) {
173 std::cerr << std::endl
175 <<
"----------------------------------------------------"
177 std::cerr <<
"Exception on processing: " << std::endl
178 << exc.what() << std::endl
179 <<
"Aborting!" << std::endl
180 <<
"----------------------------------------------------"
184 std::cerr << std::endl
186 <<
"----------------------------------------------------"
188 std::cerr <<
"Unknown exception!" << std::endl
189 <<
"Aborting!" << std::endl
190 <<
"----------------------------------------------------"
This is a wrap-around class. It contains the main loop of the program that implements the Spherical c...
Describes exact solution, , of the Spherical coil with magnetic core (ssol-iii/) numerical experiment...
Describes exact solution, , of the Spherical coil with magnetic core (ssol-iii/) 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 Spherical coil with magnetic core (ssol-iii/) 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 Spherical coil with magnetic core (ssol-iii/) nume...
Solves for the current vector potential, , in the Spherical coil with magnetic core (ssol-iii/) numer...
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.