Logbook  (07-04-2025)
Static problems
SolverSLDI< dim > Class Template Reference

Implements the solver that solves for \(\Psi\) in the Magnetostatic shield - 1 (sld-i/) numerical experiment. More...

#include <solver.hpp>

Inheritance diagram for SolverSLDI< dim >:
Collaboration diagram for SolverSLDI< dim >:

Public Member Functions

 SolverSLDI (unsigned int p, unsigned int mapping_degree, unsigned int r, std::string fname)
 
- Public Member Functions inherited from StaticScalarSolver::Solver< dim, stage >
 Solver (unsigned int p, unsigned int mapping_degree, unsigned int type_of_pde_rhs, std::string fname="data", const Function< dim > *exact_solution=nullptr, bool axisymmetric=false, bool vector_potential=false, bool print_time_tables=false, bool project_exact_solution=false, bool write_higher_order_cells=false)
 The only constructor. More...
 
void setup ()
 Initializes system matrix and the right-hand side vector, etc. More...
 
void assemble ()
 Assembles the system matrix and the right-hand side vector.
 
void compute_error_norms ()
 Computes error norms.
 
void project_exact_solution_fcn ()
 Projects exact solution. More...
 
void save () const
 Saves simulation results into a vtk or vtu file. More...
 
void save_matrix_and_rhs_to_csv (std::string fname) const
 Saves the system matrix and the right-hand side into a csv file. More...
 
void clear ()
 Releases computer memory associated with the system matrix and right-hand side.
 
const Triangulation< dim > & get_tria () const
 Returns a reference to triangulation.
 
const DoFHandler< dim > & get_dof_handler () const
 Returns a reference to dof handler.
 
const Vector< double > & get_solution () const
 Returns a reference to the solution.
 
unsigned int get_n_cells () const
 Returns the number of active cells in the mesh.
 
unsigned int get_n_vertices () const
 Returns the number of vertices.
 
unsigned int get_n_used_vertices () const
 Returns the number of used vertices.
 
unsigned int get_n_lines () const
 Returns the number of lines.
 
unsigned int get_n_dofs () const
 Returns the total amount of the degrees of freedom.
 
unsigned int get_type_of_pde_rhs () const
 Returns the value of type_of_pde_rhs.
 
double get_L2_norm () const
 Returns \(L^2\) error norm.
 
double get_H1_norm () const
 Returns \(H^1\) error norm.
 
double get_Linfty_norm () const
 Returns \(L^{\infty}\) error norm.
 
unsigned int get_mapping_degree () const
 Returns degree of the interpolating Lagrange polynomials used for mapping from the reference cell to the real mesh cell and back.
 
void run ()
 Runs the simulation. More...
 

Additional Inherited Members

- Public Attributes inherited from SettingsSLDI
const unsigned int nr_threads_max = 0
 If greater than zero, limits the amount of threads used in the simulations.
 
const double mu_0 = permeability_fs
 The permeability of free space.
 
const double d1 = (DIMENSION__ == 2) ? 0.07 : 0.05
 The half-side of the cube (square) in the middle of the spherical (circular) mesh.
 
const double rd1 = sqrt(DIMENSION__) * d1
 The radius of the circle (sphere) that encloses the square (cube) in the middle of the mesh.
 
const double a = 0.2
 The inner radius of the shield.
 
const double b = 0.4
 The outer radius of the shield.
 
const double d_2 = 0.8
 The half- side length of the square (cube) in which the error norms are computed.
 
const double d_3 = 2.0
 The half- side length of the square (cube) that represents the outer boundary.
 
const types::boundary_id bid = 1
 The ID of the only boundary of the problem domain.
 
const BoundaryConditionType type_of_bc = Exact
 Switches between three boundary conditions options.
 
const types::material_id mid_1 = 1
 The ID of the material inside the shield.
 
const types::material_id mid_2 = 2
 The ID of the material of the shield.
 
const types::material_id mid_3 = 3
 The ID of the material outside the shield.
 
const double mur_1 = 1.0
 Relative permeability of the material inside the shield.
 
const double mur_2 = 4.0
 Relative permeability of the material of the shield.
 
const double mur_3 = 1.0
 Relative permeability of the material outside the shield.
 
const double mu_1 = mur_1 * mu_0
 Permeability of the material inside the shield. simulations.
 
const double mu_2 = mur_2 * mu_0
 Permeability of the material of the shield.
 
const double mu_3 = mur_3 * mu_0
 Permeability of the material outside the shield.
 
const double H_0 = 1.0
 The magnitude of the uniform auxiliary field H at the infinity, i.e., in absence of the magnetic shield.
 
const double eps = 1e-12
 Two values in double format are considered to be equal if the absolute value of their difference is less than eps.
 
const bool print_time_tables = false
 If set to true, the program will print time tables on the screen.
 
const bool project_exact_solution = false
 If set to true, the program will project the exact solution. More...
 
const bool log_cg_convergence = false
 If set to true, saves the residual at each iteration of the CG solver. The names of the files fit the following wildcard *_cg_convergence.csv. More...
 
- Public Attributes inherited from Constants::Physics
const double pi
 The ratio between the circumference and the diameter of any circle, \(\pi\). More...
 
const double c = 299792458.0
 The speed of light in free space, \(c\).
 
const double permeability_fs = 4.0 * pi * 1.0e-7
 The permeability of the free space, \(\mu_0\).
 
const double permittivity_fs = 1.0 / (std::pow(c, 2) * permeability_fs)
 The permittivity of the free space, \(\epsilon_0\).
 
- Protected Attributes inherited from StaticScalarSolver::Solver< dim, stage >
std::map< types::boundary_id, const Function< dim > * > dirichlet_stack
 A map that contains pairs of boundary IDs and the corresponding Dirichlet boundary conditions. More...
 
Triangulation< dim > triangulation
 The mesh.
 
const FE_Q< dim > fe
 The finite elements.
 
DoFHandler< dim > dof_handler
 The degrees-of-freedom handler.
 
Vector< double > solution
 The solution vector, i.e., degrees of freedom yielded by the simulation.
 
Vector< double > projected_exact_solution
 The projected exact solution vector.
 
AffineConstraints< double > constraints
 The constraints associated with the Dirichlet boundary conditions.
 
SparsityPattern sparsity_pattern
 The sparsity pattern of the system matrix.
 
SparseMatrix< double > system_matrix
 The system matrix.
 
Vector< double > system_rhs
 The system right-hand side vector.
 
double L2_norm
 The \(L^2\) error norm.
 
double Linfty_norm
 The \(L^{\infty}\) error norm.
 
double H1_norm
 The \(H^1\) error semi-norm.
 

Detailed Description

template<int dim>
class SolverSLDI< dim >

Implements the solver that solves for \(\Psi\) in the Magnetostatic shield - 1 (sld-i/) numerical experiment.

Definition at line 61 of file solver.hpp.

Constructor & Destructor Documentation

◆ SolverSLDI()

template<int dim>
SolverSLDI< dim >::SolverSLDI ( unsigned int  p,
unsigned int  mapping_degree,
unsigned int  r,
std::string  fname 
)
inline

The constructor.

Parameters
[in]p- The degree of the interpolating polynomials of the Lagrange finite elements, FE_Q.
[in]mapping_degree- The degree of the interpolating polynomials used for mapping.
[in]r- The parameter that encodes the degree of mesh refinement. Must coincide with one of the values set in sld-i/gmsh/build. This parameter is used to compose the name of the mesh file to be uploaded from sld-i/gmsh/data/.
[in]fname- The name of the vtu file without extension to save the data.

Definition at line 82 of file solver.hpp.


The documentation for this class was generated from the following file: