|
Feellgood
|
#include <tetra.h>
Public Member Functions | |
| Tet (const std::vector< Nodes::Node > &_p_node, const int _idx, const std::initializer_list< int > _i) | |
| void | interpolation (const std::function< double(Nodes::Node)> &getter, Eigen::Ref< Eigen::Matrix< double, NPI, 1 >> result) const |
| void | interpolation (const std::function< Eigen::Vector3d(Nodes::Node)> &getter, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> result, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> Tx, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> Ty, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> Tz) const |
| void | interpolation_field (const std::function< double(Nodes::Node)> &getter, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> X) const |
| void | interpolation (const std::function< double(Nodes::Node, Nodes::index)> &getter, const Nodes::index idx, Eigen::Ref< Eigen::Matrix< double, Tetra::NPI, 1 >> result) const |
| void | lumping (const Eigen::Ref< const Eigen::Matrix< double, NPI, 1 >> alpha_eff, double prefactor, Eigen::Ref< Eigen::Matrix< double, 3 *N, 3 *N >> AE) const |
| Eigen::Matrix< double, N, N > | calcDiagBlock (const double c, const Eigen::Matrix< double, N, 1 > &x) const |
| Eigen::Matrix< double, N, 1 > | calcOffDiagBlock (const Nodes::index idx) const |
| void | DMI_bulk_OffDiag (timing const &prm_t, const double DMIbulk_bis, Eigen::Ref< Eigen::Matrix< double, 3 *N, 3 *N >> AE) const |
| void | DMI_bulk_BE (const double cst, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> U, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> dUdx, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> dUdy, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> dUdz, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, N >> BE) const |
| void | add_drift_BE (const Eigen::Ref< const Eigen::Matrix< double, NPI, 1 >> alpha, double s_dt, double Vdrift, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> U, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> V, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> dUd_, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> dVd_, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, N >> BE) const |
| Eigen::Matrix< double, NPI, 1 > | calc_aniso_uniax (const Eigen::Ref< const Eigen::Vector3d > uk, const double Kbis, const double s_dt, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> U, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> V, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> H_aniso) const |
| Eigen::Matrix< double, NPI, 1 > | calc_aniso_cub (const Eigen::Ref< const Eigen::Matrix3d > e, const double K3bis, const double s_dt, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> U, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> V, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> H_aniso) const |
| Eigen::Matrix< double, Nodes::DIM, NPI > | Hst_order2_contribution (const Eigen::Ref< const Eigen::Matrix< double, Nodes::DIM, NPI >> Hst, const Eigen::Ref< const Eigen::Matrix< double, Nodes::DIM, NPI >> U, const Eigen::Ref< const Eigen::Matrix< double, Nodes::DIM, NPI >> V) const |
| void | integrales (const Tetra::prm ¶m, const timing &prm_t, const std::function< Eigen::Matrix< double, Nodes::DIM, NPI >(void)> &calc_Hext, Nodes::index idx_dir, double Vdrift, const AbsorbingEnds &absorb) |
| double | exchangeEnergy (const Tetra::prm ¶m, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> dudx, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> dudy, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> dudz) const |
| double | DMIBulkEnergy (const Tetra::prm ¶m, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> u, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> dudx, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> dudy, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> dudz) const |
| double | uniaxialAnisotropyEnergy (const Tetra::prm ¶m, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> u) const |
| double | cubicAnisotropyEnergy (const Tetra::prm ¶m, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> u) const |
| Eigen::Matrix< double, Tetra::NPI, 1 > | charges (const double &Ms, const std::function< Eigen::Vector3d(const Nodes::Node &)> &getter) const override |
| double | demagEnergy (const Tetra::prm ¶m, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> dudx, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> dudy, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> dudz, Eigen::Ref< Eigen::Matrix< double, NPI, 1 >> phi) const |
| double | zeemanEnergy (const Tetra::prm ¶m, const Eigen::Ref< const Eigen::Vector3d > Hext, const Eigen::Ref< const Eigen::Matrix< double, Nodes::DIM, Tetra::NPI >> u) const |
| double | zeemanEnergy (const Tetra::prm ¶m, double fieldAmp, const std::vector< Eigen::Matrix< double, Nodes::DIM, Tetra::NPI >> &spaceField, const Eigen::Ref< const Eigen::Matrix< double, Nodes::DIM, Tetra::NPI >> u) const |
| double | Jacobian (Eigen::Ref< Eigen::Matrix3d > J) const |
| double | calc_vol (void) const |
| Eigen::Matrix< double, Nodes::DIM, NPI > | getPtGauss (void) const override |
| Eigen::Matrix< double, Nodes::DIM, NPI > | gradV (const std::vector< double > &V) const |
Public Member Functions inherited from element< N, NPI > | |
| element (const std::vector< Nodes::Node > &_p_node, const int _idx, const std::initializer_list< int > &_i) | |
| constexpr int | getN (void) const |
| constexpr int | getNPI (void) const |
| void | buildMatP (Eigen::Ref< Eigen::Matrix< double, 2 *N, 3 *N >> P) |
| void | infos (void) const |
| bool | existNodes (void) const |
Public Attributes | |
| Eigen::Matrix< double, N, Nodes::DIM > | da |
| int | idx |
| std::function< void(Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> H)> | extraField |
Public Attributes inherited from element< N, NPI > | |
| std::array< int, N > | ind |
| int | idxPrm |
| Eigen::Matrix< double, NPI, 1 > | weight |
| Eigen::Matrix< double, 2 *N, 2 *N > | Kp |
| Eigen::Matrix< double, 2 *N, 1 > | Lp |
Private Member Functions | |
| void | orientate (void) override |
Additional Inherited Members | |
Protected Member Functions inherited from element< N, NPI > | |
| const Nodes::Node & | getNode (const int i) const |
Tet is a tetrahedron. It must not be flat. The list of its nodes is ordered in a way that enforces this spatial orientation:
The face (0, 1, 2) is oriented inwards: the nodes are arranged counterclockwise when seen from inside the tetrahedron. The orientation of the other faces are:
|
inline |
constructor. It initializes weight hat function with weights \( w_i = |J| p_i \) with \( p_i = pds[i] = (D,E,E,E,E) \) and dad(x|y|z) if \( | detJ | < \epsilon \) jacobian is considered degenerated If NPI=1 (single Gauss point) then w[0] is the tetrahedron volume unit tests : Tet_constructor; Tet_inner_tables
| _p_node | vector of nodes | |
| [in] | _idx | region index in region vector |
| [in] | _i | node index |
| void Tet::add_drift_BE | ( | const Eigen::Ref< const Eigen::Matrix< double, NPI, 1 >> | alpha, |
| double | s_dt, | ||
| double | Vdrift, | ||
| Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> | U, | ||
| Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> | V, | ||
| Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> | dUd_, | ||
| Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> | dVd_, | ||
| Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, N >> | BE | ||
| ) | const |
add drift contribution due to eventual recentering to vectors BE, Vdrift is the drift velocity in reduced time (physical velocity divided by gamma0), alpha is the damping at the Gauss points
| Eigen::Matrix< double, NPI, 1 > Tet::calc_aniso_cub | ( | const Eigen::Ref< const Eigen::Matrix3d > | e, |
| const double | K3bis, | ||
| const double | s_dt, | ||
| Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> | U, | ||
| Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> | V, | ||
| Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> | H_aniso | ||
| ) | const |
append(+=) H_aniso for cubic anisotropy contribution, returns contribution to uHeff (used to compute the stabilizing effective damping)
| [in] | e | base vectors |
| [in] | K3bis | cubic anisotropy coefficient |
| [in] | s_dt | THETA*dt |
| [in] | U | magnetization |
| [in] | V | |
| [out] | H_aniso | effective cubic anisotropy field |
| Eigen::Matrix< double, NPI, 1 > Tet::calc_aniso_uniax | ( | const Eigen::Ref< const Eigen::Vector3d > | uk, |
| const double | Kbis, | ||
| const double | s_dt, | ||
| Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> | U, | ||
| Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> | V, | ||
| Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> | H_aniso | ||
| ) | const |
append(+=) H_aniso for uniaxial anisotropy contribution, returns contribution to uHeff (used to compute the stabilizing effective damping)
| double Tet::calc_vol | ( | void | ) | const |
returns volume of the tetrahedron ; unit test Tet_calc_vol
| Eigen::Matrix< double, N, N > Tet::calcDiagBlock | ( | const double | c, |
| const Eigen::Matrix< double, N, 1 > & | x | ||
| ) | const |
computes elementary N*N matrix block returns Id⊗x + c Sum_i w_i da*transpose(da)
| Eigen::Matrix< double, N, 1 > Tet::calcOffDiagBlock | ( | const Nodes::index | idx | ) | const |
computes elementary diagonal elementary block (stored in a N vector) returns m(idx) on the nodes, with m(idx) a component of the magnetization
|
overridevirtual |
computes volume charges, the divergence of the magnetization, returns result
Implements element< N, NPI >.
| double Tet::cubicAnisotropyEnergy | ( | const Tetra::prm & | param, |
| Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> | u | ||
| ) | const |
cubic anisotropy energy of the tetrahedron
| double Tet::demagEnergy | ( | const Tetra::prm & | param, |
| Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> | dudx, | ||
| Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> | dudy, | ||
| Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> | dudz, | ||
| Eigen::Ref< Eigen::Matrix< double, NPI, 1 >> | phi | ||
| ) | const |
demagnetizing energy of the tetrahedron
| void Tet::DMI_bulk_BE | ( | const double | cst, |
| Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> | U, | ||
| Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> | dUdx, | ||
| Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> | dUdy, | ||
| Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> | dUdz, | ||
| Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, N >> | BE | ||
| ) | const |
add DMI bulk contribution to BE
| void Tet::DMI_bulk_OffDiag | ( | timing const & | prm_t, |
| const double | DMIbulk_bis, | ||
| Eigen::Ref< Eigen::Matrix< double, 3 *N, 3 *N >> | AE | ||
| ) | const |
computes off diagonal DMI bulk contributions and add them to matrix AE
| double Tet::DMIBulkEnergy | ( | const Tetra::prm & | param, |
| Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> | u, | ||
| Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> | dudx, | ||
| Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> | dudy, | ||
| Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> | dudz | ||
| ) | const |
DMI bulk energy of the tetrahedron
| double Tet::exchangeEnergy | ( | const Tetra::prm & | param, |
| Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> | dudx, | ||
| Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> | dudy, | ||
| Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> | dudz | ||
| ) | const |
exchange energy of the tetrahedron
|
inlineoverridevirtual |
returns gauss points
Implements element< N, NPI >.
| Eigen::Matrix< double, Nodes::DIM, NPI > Tet::gradV | ( | const std::vector< double > & | V | ) | const |
returns grad(V)
| Eigen::Matrix< double, Nodes::DIM, NPI > Tet::Hst_order2_contribution | ( | const Eigen::Ref< const Eigen::Matrix< double, Nodes::DIM, NPI >> | Hst, |
| const Eigen::Ref< const Eigen::Matrix< double, Nodes::DIM, NPI >> | U, | ||
| const Eigen::Ref< const Eigen::Matrix< double, Nodes::DIM, NPI >> | V | ||
| ) | const |
return the second order term of the spin accumulation field Hst: the derivative of its tangent part in the direction V, -(U.Hst) V; and V the velocity du/dtau, both in reduced time
| [in] | Hst | |
| [in] | U | magnetization |
| [in] | V |
| void Tet::integrales | ( | const Tetra::prm & | param, |
| const timing & | prm_t, | ||
| const std::function< Eigen::Matrix< double, Nodes::DIM, NPI >(void)> & | calc_Hext, | ||
| Nodes::index | idx_dir, | ||
| double | Vdrift, | ||
| const AbsorbingEnds & | absorb | ||
| ) |
computes the integral contribution of the tetrahedron to the evolution of the magnetization calc_Hext is a function that returns external H field defined on gauss points, absorb are the absorbing ends of the settings, used if param.absorbing is true
|
inline |
interpolation for scalar field : the getter function is given as a parameter in order to know what part of the node you want to interpolate If single Gauss point evaluates scalar at barycenter
|
inline |
interpolation for the component idx of a field : the getter function is given as a parameter in order to know what part of the node you want to interpolate
|
inline |
interpolation for 3D vector field and a tensor : getter function is given as a parameter to know what part of the node you want to interpolate
|
inline |
interpolation for components of a field : the getter function is given as a parameter in order to know what part of the node you want to interpolate Computes gradient at single Gauss point, constant for linear tetrahedron
| double Tet::Jacobian | ( | Eigen::Ref< Eigen::Matrix3d > | J | ) | const |
| void Tet::lumping | ( | const Eigen::Ref< const Eigen::Matrix< double, NPI, 1 >> | alpha_eff, |
| double | prefactor, | ||
| Eigen::Ref< Eigen::Matrix< double, 3 *N, 3 *N >> | AE | ||
| ) | const |
AE matrix filling with exchange contributions, diagonal contributions and magnetization contribution AE has a block structure: ( E -Z +Y) ( +Z E -X) ( -Y +X E) E X Y Z are N*N matrices E is the sum of the exchange contribution and modified alpha (scheme stabilizer) on its diagonal X Y Z are diagonal matrices with magnetization component contributions
|
overrideprivatevirtual |
Enforce the correct orientation by swapping nodes if needed.
Implements element< N, NPI >.
| double Tet::uniaxialAnisotropyEnergy | ( | const Tetra::prm & | param, |
| Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> | u | ||
| ) | const |
uniaxial anisotropy energy of the tetrahedron
| double Tet::zeemanEnergy | ( | const Tetra::prm & | param, |
| const Eigen::Ref< const Eigen::Vector3d > | Hext, | ||
| const Eigen::Ref< const Eigen::Matrix< double, Nodes::DIM, Tetra::NPI >> | u | ||
| ) | const |
zeeman energy of the tetrahedron for a constant Hext
| [in] | param | |
| [in] | Hext | constant applied field |
| [in] | u |
| double Tet::zeemanEnergy | ( | const Tetra::prm & | param, |
| double | fieldAmp, | ||
| const std::vector< Eigen::Matrix< double, Nodes::DIM, Tetra::NPI >> & | spaceField, | ||
| const Eigen::Ref< const Eigen::Matrix< double, Nodes::DIM, Tetra::NPI >> | u | ||
| ) | const |
zeeman energy of the tetrahedron for a varying Hext
| [in] | param | |
| [in] | fieldAmp | applied field amplitude, may be time dependant |
| [in] | spaceField | space varying applied field |
| [in] | u | magnetization at Gauss points |
| Eigen::Matrix<double,N,Nodes::DIM> Tetra::Tet::da |
local hat functions matrix, initialized by constructor: da = dadu * inverse(Jacobian) For linear tetrahedron, gradients are constant in the element
| std::function<void( Eigen::Ref<Eigen::Matrix<double,Nodes::DIM,NPI>> H)> Tetra::Tet::extraField |
do a += to the effective field H, to add contributions as spin transfert torque Hst
| int Tetra::Tet::idx |
idx is the index of the tetrahedron in the vector of tetrahedron