Feellgood
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
solver< DIM_PROBLEM > Class Template Referenceabstract

template class for the different solvers template parameter DIM_PROBLEM: dimensionnality of the problem to solve More...

#include <solver.h>

Public Member Functions

 solver (Mesh::mesh &_msh, std::vector< Tetra::prm > &_pTetra, std::vector< Facette::prm > &_pFac, const std::string name, const double _tol, const bool v, const int max_iter, std::function< bool(Mesh::Edge)> edge_filter=[](Mesh::Edge){ return true;})
 
virtual void checkBoundaryConditions (void) const =0
 

Protected Member Functions

algebra::MatrixShape build_shape (std::function< bool(Mesh::Edge)> edge_filter)
 
template<int N>
void buildMat (std::vector< int > &ind, Eigen::Matrix< double, DIM_PROBLEM *N, DIM_PROBLEM *N > &Ke)
 
template<int N>
void buildVect (std::vector< int > &ind, std::vector< double > &Le)
 

Protected Attributes

Mesh::meshmsh
 
const int NOD
 
const std::vector< Tetra::prm > & paramTet
 
const std::vector< Facette::prm > & paramFac
 
const bool verbose
 
algebra::iteration< double > iter
 
algebra::SparseMatrix K
 
std::vector< double > L_rhs
 

Static Protected Attributes

static const int DIM_PB = DIM_PROBLEM
 

Detailed Description

template<int DIM_PROBLEM>
class solver< DIM_PROBLEM >

template class for the different solvers template parameter DIM_PROBLEM: dimensionnality of the problem to solve

Constructor & Destructor Documentation

◆ solver()

template<int DIM_PROBLEM>
solver< DIM_PROBLEM >::solver ( Mesh::mesh _msh,
std::vector< Tetra::prm > &  _pTetra,
std::vector< Facette::prm > &  _pFac,
const std::string  name,
const double  _tol,
const bool  v,
const int  max_iter,
std::function< bool(Mesh::Edge)>  edge_filter = [](Mesh::Edge){ return true; } 
)
inlineexplicit

constructor

Parameters
[in]_mshmesh
[in]_pTetraref to vector of param tet (volume region parameters)
[in]_pFacref to vector of param fac (surface region parameters)
[in]namename of the solver method
[in]_tolsolver tolerance
[in]vverbose mode for iteration monitor
[in]max_itermaximum number of iterations
[in]edge_filterpredicate for relevant mesh edges

Member Function Documentation

◆ build_shape()

template<int DIM_PROBLEM>
algebra::MatrixShape solver< DIM_PROBLEM >::build_shape ( std::function< bool(Mesh::Edge)>  edge_filter)
inlineprotected

Build a matrix shape suitable for the current problem.

◆ buildMat()

template<int DIM_PROBLEM>
template<int N>
void solver< DIM_PROBLEM >::buildMat ( std::vector< int > &  ind,
Eigen::Matrix< double, DIM_PROBLEM *N, DIM_PROBLEM *N > &  Ke 
)
inlineprotected

function template. parameter N is the number of indices of the element to build matrix from: ind.size() = N

◆ buildVect()

template<int DIM_PROBLEM>
template<int N>
void solver< DIM_PROBLEM >::buildVect ( std::vector< int > &  ind,
std::vector< double > &  Le 
)
inlineprotected

function template. parameter N is the number of indices of the element to build vector from

◆ checkBoundaryConditions()

template<int DIM_PROBLEM>
virtual void solver< DIM_PROBLEM >::checkBoundaryConditions ( void  ) const
pure virtual

check boundary conditions, exit if there is a mistake in the boundary conditions

Implemented in spinAcc, LinAlgebra, and electrostatSolver.

Member Data Documentation

◆ DIM_PB

template<int DIM_PROBLEM>
const int solver< DIM_PROBLEM >::DIM_PB = DIM_PROBLEM
staticprotected

dimensionnality of the problem

◆ iter

template<int DIM_PROBLEM>
algebra::iteration<double> solver< DIM_PROBLEM >::iter
protected

monitor the solver called in method solve()

◆ K

template<int DIM_PROBLEM>
algebra::SparseMatrix solver< DIM_PROBLEM >::K
protected

matrix of the system to solve

◆ L_rhs

template<int DIM_PROBLEM>
std::vector<double> solver< DIM_PROBLEM >::L_rhs
protected

RHS vector of the system to solve

◆ msh

template<int DIM_PROBLEM>
Mesh::mesh* solver< DIM_PROBLEM >::msh
protected

mesh pointer to access nodes, fac, tet, and others geometrical values and methods

◆ NOD

template<int DIM_PROBLEM>
const int solver< DIM_PROBLEM >::NOD
protected

number of nodes in the mesh

◆ paramFac

template<int DIM_PROBLEM>
const std::vector<Facette::prm>& solver< DIM_PROBLEM >::paramFac
protected

this vector contains the material parameters for all surface regions for all the triangular facettes

◆ paramTet

template<int DIM_PROBLEM>
const std::vector<Tetra::prm>& solver< DIM_PROBLEM >::paramTet
protected

this vector contains the material parameters for all volume regions for all the tetrahedrons

◆ verbose

template<int DIM_PROBLEM>
const bool solver< DIM_PROBLEM >::verbose
protected

if verbose set to true, some printing are sent to terminal


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