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

#include <linear_algebra.h>

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
 
int solver (timing const &t_prm)
 
void set_DW_vz (double vz)
 
double get_v_max (void)
 
void setExtSpaceField (Settings &s)
 
void base_projection ()
 

Private Attributes

Nodes::index idx_dir
 
const int NOD
 
Mesh::meshrefMsh
 
algebra::iteration< double > iter
 
algebra::r_sparseMat K
 
std::vector< double > L_rhs
 
std::vector< double > Xw
 
const int verbose
 
const std::vector< Tetra::prm > & prmTetra
 
const std::vector< Facette::prm > & prmFacette
 
double DW_vz
 
double v_max
 
std::vector< Eigen::Matrix< double, Nodes::DIM, Tetra::NPI > > extSpaceField
 

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

◆ solver()

int LinAlgebra::solver ( timing const &  t_prm)

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

◆ iter

algebra::iteration<double> LinAlgebra::iter
private

monitor the solver

◆ 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

◆ NOD

const int LinAlgebra::NOD
private

number of nodes, also an offset for filling sparseMatrix, initialized by constructor

◆ prmFacette

const std::vector<Facette::prm>& LinAlgebra::prmFacette
private

material parameters of the facettes

◆ prmTetra

const std::vector<Tetra::prm>& LinAlgebra::prmTetra
private

material parameters of the tetrahedrons

◆ refMsh

Mesh::mesh* LinAlgebra::refMsh
private

direct access to the mesh

◆ 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: