Feellgood
Public Member Functions | Private Attributes | List of all members
LinAlgebra Class Reference

#include <linear_algebra.h>

Inheritance diagram for LinAlgebra:
solver< DIM_PB_MAG >

Public Member Functions

 LinAlgebra (Settings &s, Mesh::mesh &my_msh)
 
algebra::MatrixShape build_shape ()
 
void prepareElements (Eigen::Vector3d const &Hext, timing const &t_prm)
 
void prepareElements (double const A_Hext, timing const &t_prm)
 
void buildInitGuess (std::vector< double > &G) const
 
bool solve (timing const &t_prm)
 
void set_DW_vz (double vz)
 
double get_v_max (void)
 
void setExtSpaceField (Settings &s)
 
void base_projection ()
 
- Public Member Functions inherited from solver< DIM_PB_MAG >
 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)
 

Private Attributes

Nodes::index idx_dir
 
algebra::r_sparseMat K
 
std::vector< double > L_rhs
 
std::vector< double > Xw
 
const int verbose
 
double DW_vz
 
double v_max
 
std::vector< Eigen::Matrix< double, Nodes::DIM, Tetra::NPI > > extSpaceField
 
std::vector< int > lvd
 

Additional Inherited Members

- Protected Member Functions inherited from solver< DIM_PB_MAG >
void buildMat (std::vector< int > &ind, Eigen::Matrix< double, DIM_PROBLEM *N, DIM_PROBLEM *N > &Ke, algebra::w_sparseMat &K)
 
void buildVect (std::vector< int > &ind, std::vector< double > &Le, std::vector< double > &L)
 
- Protected Attributes inherited from solver< DIM_PB_MAG >
Mesh::meshmsh
 
const int NOD
 
const std::vector< Tetra::prm > & paramTet
 
const std::vector< Facette::prm > & paramFac
 
algebra::iteration< double > iter
 
- Static Protected Attributes inherited from solver< DIM_PB_MAG >
static const int DIM_PB
 

Detailed Description

convenient class to grab altogether some part of the calculations involved using algebra::bicg solver at each timestep. The solver is handled by solver method, and is using algebra sparse matrices(Row major). The write sparse matrix is prepared in 'batch mode', to add all non zero coefficients with a '+=' logic. Then it is turned into a read sparse matrix before being used by bicg algo. Be aware of time units: when entering solver method, division by gamma0 and multiplication by gamma0 when ending are mandatory. The bicg algorithm is monitored by iter object. When debugging it might be usefull to set iter verbosity differently from LinAlgebra Solver (see constructor list initialization)

Constructor & Destructor Documentation

◆ LinAlgebra()

LinAlgebra::LinAlgebra ( Settings s,
Mesh::mesh my_msh 
)
inline

constructor When debugging it might be usefull to set iter verbosity differently

Parameters
[in]s
[in]my_msh

Member Function Documentation

◆ base_projection()

void LinAlgebra::base_projection ( )

computes local vector basis {ep,eq} in the tangeant plane for projection on the elements

◆ build_shape()

algebra::MatrixShape LinAlgebra::build_shape ( )
inline

build a matrix shape suitable for our mesh

◆ buildInitGuess()

void LinAlgebra::buildInitGuess ( std::vector< double > &  G) const

build init guess for bicg solver

Parameters
[out]G

◆ get_v_max()

double LinAlgebra::get_v_max ( void  )
inline

getter for v_max

◆ prepareElements() [1/2]

void LinAlgebra::prepareElements ( double const  A_Hext,
timing const &  t_prm 
)

computes inner data structures of tetraedrons and triangular facettes (K matrices and L vectors) this member function is overloaded to fit to two different situations, either if std::function passed to element = tetra is corresponding to the simple case of constant external field applied to the magnetic region or space dependant. Here is the variable space applied field.

Parameters
[in]A_Hextamplitude applied field (might be time dependant)
[in]t_prm

◆ prepareElements() [2/2]

void LinAlgebra::prepareElements ( Eigen::Vector3d const &  Hext,
timing const &  t_prm 
)

computes inner data structures of tetraedrons and triangular facettes (K matrices and L vectors) this member function is overloaded to fit to two different situations, either if std::function passed to element = tetra is corresponding to the simple case of constant external field applied to the magnetic region or space dependant. Here is the constant space applied field.

Parameters
[in]Hextapplied field
[in]t_prm

◆ set_DW_vz()

void LinAlgebra::set_DW_vz ( double  vz)
inline

setter for DW_dz

Parameters
[in]vz

◆ setExtSpaceField()

void LinAlgebra::setExtSpaceField ( Settings s)

when external applied field is of field_type R4toR3 values of field_space are stored in spaceField

Parameters
[in]s

◆ solve()

bool LinAlgebra::solve ( timing const &  t_prm)

call the solver, uses stabilized biconjugate gradient solver (bicg) with diagonal preconditionner, sparse matrix and vector are filled with multiThreading. Sparse matrix is row major.

Parameters
[in]t_prm

Member Data Documentation

◆ DW_vz

double LinAlgebra::DW_vz
private

speed of the domain wall

◆ extSpaceField

std::vector< Eigen::Matrix<double,Nodes::DIM,Tetra::NPI> > LinAlgebra::extSpaceField
private

external applied space field, values on gauss points, size is number of tetraedrons

◆ idx_dir

Nodes::index LinAlgebra::idx_dir
private

recentering index direction if any

◆ K

algebra::r_sparseMat LinAlgebra::K
private

matrix of the system to solve

◆ L_rhs

std::vector<double> LinAlgebra::L_rhs
private

RHS vector of the system to solve

◆ lvd

std::vector<int> LinAlgebra::lvd
private

list of the Dirichlet indices where (vp,vq) are zero, initialized by constructor

◆ v_max

double LinAlgebra::v_max
private

maximum speed of the magnetization in the whole physical object

◆ verbose

const int LinAlgebra::verbose
private

verbosity

◆ Xw

std::vector<double> LinAlgebra::Xw
private

solution of the system to solve


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