12 #define BOOST_ALLOW_DEPRECATED_HEADERS
14 #include <deal.II/base/multithread_info.h>
20 #include "project_PSI_to_B.hpp"
21 #include "project_PSI_to_H.hpp"
37 if (nr_threads_max > 0)
38 MultithreadInfo::set_thread_limit(nr_threads_max);
40 Assert(DIMENSION__ > 1, ExcInternalError());
41 Assert(DIMENSION__ < 4, ExcInternalError());
44 std::string dir = (DIMENSION__ == 2) ?
"Data/square/" :
"Data/cube/";
46 std::cout <<
"----------------------------------------\n"
48 <<
"Dimension = " << DIMENSION__ <<
"\n"
49 <<
"Writing to: " << dir <<
"\n";
55 for (
unsigned int p = 1; p < 4; p++) {
61 for (
unsigned int r = 10; r < 14; r++)
64 for (
unsigned int r = 5; r < 9; r++)
67 table_PSI.add_value(
"r", r);
68 table_PSI.add_value(
"p", p);
70 fname = dir +
"solution_PSI_p" + std::to_string(p) +
"_r" +
74 table_PSI.add_value(
"ndofs", problem.
get_n_dofs());
75 table_PSI.add_value(
"ncells", problem.
get_n_cells());
82 table_H.add_value(
"r", r);
83 table_H.add_value(
"p", p);
85 fname = dir +
"solution_H_p" + std::to_string(p) +
"_r" +
89 std::cout <<
"Time table H \n";
93 ProjectPSItoH<DIMENSION__> projector(
107 table_H.add_value(
"ndofs", projector.get_n_dofs());
108 table_H.add_value(
"ncells", projector.get_n_cells());
109 table_H.add_value(
"L2", projector.get_L2_norm());
110 table_H.add_value(
"H1", 0.0);
113 table_B.add_value(
"r", r);
114 table_B.add_value(
"p", p);
116 fname = dir +
"solution_B_p" + std::to_string(p) +
"_r" +
120 std::cout <<
"Time table B \n";
124 ProjectPSItoB<DIMENSION__> projector(
138 table_B.add_value(
"ndofs", projector.get_n_dofs());
139 table_B.add_value(
"ncells", projector.get_n_cells());
140 table_B.add_value(
"L2", projector.get_L2_norm() / mu_0);
141 table_B.add_value(
"H1", 0.0);
145 std::cout <<
"Table PSI\n";
146 table_PSI.
save(dir +
"table_PSI_p" + std::to_string(p));
148 std::cout <<
"Table H\n";
149 table_H.
save(dir +
"table_H_p" + std::to_string(p));
151 std::cout <<
"Table B\n";
152 table_B.
save(dir +
"table_B_p" + std::to_string(p));
163 }
catch (std::exception& exc) {
164 std::cerr << std::endl
166 <<
"----------------------------------------------------"
168 std::cerr <<
"Exception on processing: " << std::endl
169 << exc.what() << std::endl
170 <<
"Aborting!" << std::endl
171 <<
"----------------------------------------------------"
175 std::cerr << std::endl
177 <<
"----------------------------------------------------"
179 std::cerr <<
"Unknown exception!" << std::endl
180 <<
"Aborting!" << std::endl
181 <<
"----------------------------------------------------"
This is a wrap-around class. It contains the main loop of the program that implements the Magnetostat...
Describes exact solution, , of the Magnetostatic shield - 1 (sld-i/) numerical experiment in two and ...
Describes exact solution, , of the Magnetostatic shield - 1 (sld-i/) numerical experiment in two and ...
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 Magnetostatic shield - 1 (sld-i/) numerical experiment.
const bool print_time_tables
If set to true, the program will print time tables on the screen.
Implements the solver that solves for in the Magnetostatic shield - 1 (sld-i/) numerical experiment.
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.
unsigned int get_mapping_degree() const
Returns degree of the interpolating Lagrange polynomials used for mapping from the reference cell to ...