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

#include <spinAccumulationSolver.h>

Inheritance diagram for spinAcc:
solver< DIM_PB_SPIN_ACC >

Public Member Functions

 spinAcc (Mesh::mesh &_msh, std::vector< Tetra::prm > &_pTetra, std::vector< Facette::prm > &_pFac, const double _tol, const bool v, const int max_iter)
 
void boundaryConditions (void)
 
void preCompute (std::vector< double > &V)
 
bool compute (void)
 
void checkBoundaryConditions (void) const
 
- Public Member Functions inherited from solver< DIM_PB_SPIN_ACC >
 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;})
 

Public Attributes

std::vector< Eigen::Vector3d > s
 

Private Member Functions

void fillDirichletData (const int k, Eigen::Vector3d &s_value)
 
double getMs (Tetra::Tet const &tet) const
 
double getSigma (Tetra::Tet const &tet) const
 
double getPolarizationRate (Tetra::Tet const &tet) const
 
double getDiffusionCst (Tetra::Tet const &tet) const
 
double getLsd (Tetra::Tet const &tet) const
 
double getLsf (Tetra::Tet const &tet) const
 
double getSpinHall (Tetra::Tet const &tet) const
 
void prepareExtras (void)
 
bool solve (void)
 
void integrales (Tetra::Tet &tet, Eigen::Matrix< double, DIM_PB *Tetra::N, DIM_PB *Tetra::N > &AE)
 
void integrales (Tetra::Tet &tet, std::vector< double > &BE)
 

Private Attributes

std::vector< double > valDirichlet
 
std::vector< int > idxDirichlet
 
std::vector< Eigen::Matrix< double, Nodes::DIM, Tetra::NPI > > gradV
 
const int precision = 8
 

Additional Inherited Members

- Protected Member Functions inherited from solver< DIM_PB_SPIN_ACC >
algebra::MatrixShape build_shape (std::function< bool(Mesh::Edge)> edge_filter)
 
void buildMat (std::vector< int > &ind, Eigen::Matrix< double, DIM_PROBLEM *N, DIM_PROBLEM *N > &Ke)
 
void buildVect (std::vector< int > &ind, std::vector< double > &Le)
 
- Protected Attributes inherited from solver< DIM_PB_SPIN_ACC >
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 inherited from solver< DIM_PB_SPIN_ACC >
static const int DIM_PB
 

Detailed Description

container for Spin Accumulation constants, solver and related datas. The model obeys the diffusive spin equation. The boundary conditions are Dirichlet type. User has to provide through mesh and settings a surface S0 where spin diffusion vector s is a constant (zero recommended), and another surface S1 where current density and spin polarization is defined. This surface S1 must be the same as the one given to the potential solver for its own boundary conditions.

Constructor & Destructor Documentation

◆ spinAcc()

spinAcc::spinAcc ( Mesh::mesh _msh,
std::vector< Tetra::prm > &  _pTetra,
std::vector< Facette::prm > &  _pFac,
const double  _tol,
const bool  v,
const int  max_iter 
)
inline

constructor

Parameters
[in]_mshref to the mesh
[in]_pTetraref to vector of param tetra (volume region parameters)
[in]_pFacref to vector of param facette (surface region parameters)
[in]_toltolerance for bicg_dir solver
[in]vverbose bool
[in]max_itermaximum number of iterations

Member Function Documentation

◆ boundaryConditions()

void spinAcc::boundaryConditions ( void  )

boundary conditions: a surface with a fixed s, and another surface with fixed normal current density J and polarization vector P set valDirichlet values and fill vector of indices idxDirichlet

◆ checkBoundaryConditions()

void spinAcc::checkBoundaryConditions ( void  ) const
virtual

check boundary conditions: mesh and settings have to define a single surface with constant normal current density J, a vector polarization P and another single surface where spin diffusion = 0

Implements solver< DIM_PB_SPIN_ACC >.

◆ compute()

bool spinAcc::compute ( void  )

call solver and update spin diffusion solution, returns true if solver succeeded

◆ fillDirichletData()

void spinAcc::fillDirichletData ( const int  k,
Eigen::Vector3d &  s_value 
)
private

fill valDirichlet and idxDirichlet vectors with k, a node index from fac.ind and the corresponding spin diffusion s value

◆ getDiffusionCst()

double spinAcc::getDiffusionCst ( Tetra::Tet const &  tet) const
private

diffusion constant, units: s^-1 m^2

◆ getLsd()

double spinAcc::getLsd ( Tetra::Tet const &  tet) const
private

length s-d : only in magnetic material

◆ getLsf()

double spinAcc::getLsf ( Tetra::Tet const &  tet) const
private

spin flip length : exists in both non magnetic and magnetic metals

◆ getMs()

double spinAcc::getMs ( Tetra::Tet const &  tet) const
private

returns Ms

◆ getPolarizationRate()

double spinAcc::getPolarizationRate ( Tetra::Tet const &  tet) const
private

\( P \) is polarization rate of the current density

◆ getSigma()

double spinAcc::getSigma ( Tetra::Tet const &  tet) const
private

returns sigma of the tetraedron, (conductivity in (Ohm.m)^-1

◆ getSpinHall()

double spinAcc::getSpinHall ( Tetra::Tet const &  tet) const
private

spin Hall constant

◆ integrales() [1/2]

void spinAcc::integrales ( Tetra::Tet tet,
Eigen::Matrix< double, DIM_PB *Tetra::N, DIM_PB *Tetra::N > &  AE 
)
private

computes all contributions to matrix AE from tetrahedron tet (LHS) all = non magnetic metal + magnetic metal

◆ integrales() [2/2]

void spinAcc::integrales ( Tetra::Tet tet,
std::vector< double > &  BE 
)
private

computes all contributions to spin diffusion from tetrahedron tet (RHS) all = magnetic metal + spin Hall effect

◆ preCompute()

void spinAcc::preCompute ( std::vector< double > &  V)

initializations: compute gradV and call prepareExtras method

◆ prepareExtras()

void spinAcc::prepareExtras ( void  )
private

affect extraField member function of all tetrahedrons

◆ solve()

bool spinAcc::solve ( void  )
private

solver, using biconjugate stabilized gradient, with diagonal preconditionner and Dirichlet boundary conditions

Member Data Documentation

◆ gradV

std::vector< Eigen::Matrix<double,Nodes::DIM,Tetra::NPI> > spinAcc::gradV
private

table of the gradients of the potential, gradV.size() is the number of tetrahedrons [gradV] = Volt/m = kg m A^-1 s^-3

◆ idxDirichlet

std::vector<int> spinAcc::idxDirichlet
private

list of the indices for Dirichlet boundary conditions, it contains the indices of the nodes where s is given by the user to be a constant on a surface

◆ precision

const int spinAcc::precision = 8
private

number of digits in the optional output file

◆ s

std::vector<Eigen::Vector3d> spinAcc::s

solution of the spin diffusion vector s over the nodes

◆ valDirichlet

std::vector<double> spinAcc::valDirichlet
private

Dirichlet values of the components of s on the nodes, it is zero if the node is not in idxDirichlet


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