Feellgood
Public Member Functions | Public Attributes | Private Member Functions | List of all members
Triangle::Tri Class Reference

#include <triangle.h>

Inheritance diagram for Triangle::Tri:
element< N, NPI >

Public Member Functions

 Tri (const std::vector< Nodes::Node > &_p_node, const int _NOD, const int _idx, std::initializer_list< int > _i)
 
void interpolation (std::function< Eigen::Vector3d(Nodes::Node)> getter, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> result) const
 
void interpolation (std::function< double(Nodes::Node)> getter, Eigen::Ref< Eigen::Matrix< double, NPI, 1 >> result) const
 
void integrales (Triangle::prm const &params)
 
double anisotropyEnergy (Triangle::prm const &param, Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> const u) const
 
Eigen::Matrix< double, NPI, 1 > charges (const double &dMs, std::function< Eigen::Vector3d(const Nodes::Node &)> getter) const
 
void correctionCharges (std::function< Eigen::Vector3d(Nodes::Node)> getter, Eigen::Matrix< double, Triangle::NPI, 1 > &localCharges, std::vector< double > &corr)
 
double demagEnergy (Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> u, Eigen::Ref< Eigen::Matrix< double, NPI, 1 >> phi) const
 
double potential (std::function< Eigen::Vector3d(Nodes::Node)> getter, int i) const
 
bool operator< (const Tri &f) const
 
bool operator== (const Tri &f) const
 
Eigen::Vector3d calc_norm (void) const
 
void getPtGauss (Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> result) const
 
double calc_surf (void) const
 
- Public Member Functions inherited from element< N, NPI >
 element (const std::vector< Nodes::Node > &_p_node, const int _idx, 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)
 
bool existNodes (void) const
 

Public Attributes

double surf
 
double dMs
 
Eigen::Vector3d n
 
- Public Attributes inherited from element< N, NPI >
std::vector< int > 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)
 
Eigen::Vector3d normal_vect () const
 

Additional Inherited Members

- Protected Member Functions inherited from element< N, NPI >
const Nodes::NodegetNode (const int i) const
 
void zeroBasing (void)
 

Detailed Description

Tri is a class containing the index references to nodes, its surface and its normal unit vector, it has a triangular shape and should not be degenerated, orientation must be defined in adequation with the mesh

Constructor & Destructor Documentation

◆ Tri()

Triangle::Tri::Tri ( const std::vector< Nodes::Node > &  _p_node,
const int  _NOD,
const int  _idx,
std::initializer_list< int >  _i 
)
inline

constructor used by readMesh Warning: mesh::indexReorder method call it with both _NOD = 0 and _p_node.size() > 0 TODO: get rid of _NOD and rewrite mesh::indexReorder

Parameters
[in]_p_nodevector of nodes
[in]_NODit is equal to _p_node.size() except if _NOD == 0
[in]_idxregion index in region vector
[in]_inode index

Member Function Documentation

◆ anisotropyEnergy()

double Tri::anisotropyEnergy ( Triangle::prm const &  param,
Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >> const  u 
) const

anisotropy energy of the triangle

Parameters
[in]param
[in]u

◆ calc_norm()

Eigen::Vector3d Triangle::Tri::calc_norm ( void  ) const
inline

computes the norm to the triangle, returns a unit vector

◆ calc_surf()

double Triangle::Tri::calc_surf ( void  ) const
inline

computes surface of the triangle

◆ charges()

Eigen::Matrix< double, NPI, 1 > Tri::charges ( const double &  dMs,
std::function< Eigen::Vector3d(const Nodes::Node &)>  getter 
) const
virtual

computes surface charges, return result on NPI

Parameters
[in]dMs
[in]getter

Implements element< N, NPI >.

◆ correctionCharges()

void Tri::correctionCharges ( std::function< Eigen::Vector3d(Nodes::Node)>  getter,
Eigen::Matrix< double, Triangle::NPI, 1 > &  localCharges,
std::vector< double > &  corr 
)

computes correction on surface charges from localCharges input, result directly stored in corr

Parameters
[in]getter
[in]localCharges
corr[in|out]

◆ demagEnergy()

double Tri::demagEnergy ( Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >>  u,
Eigen::Ref< Eigen::Matrix< double, NPI, 1 >>  phi 
) const

demagnetizing energy of the triangle

Parameters
[in]u
[in]phi

◆ getPtGauss()

void Triangle::Tri::getPtGauss ( Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >>  result) const
inlinevirtual

returns Gauss points in result = vec_nod*Trianglea

Implements element< N, NPI >.

◆ integrales()

void Tri::integrales ( Triangle::prm const &  params)

computes the integral contribution of the triangular triangle, the only contribution comes from Neel surface anisotropy

Parameters
[in]params

◆ interpolation() [1/2]

void Triangle::Tri::interpolation ( std::function< double(Nodes::Node)>  getter,
Eigen::Ref< Eigen::Matrix< double, NPI, 1 >>  result 
) const
inline

interpolation function on the output of the getter, mind the transposition: result = transpose(scalar_nod) * a

Parameters
[in]getter
[out]result

◆ interpolation() [2/2]

void Triangle::Tri::interpolation ( std::function< Eigen::Vector3d(Nodes::Node)>  getter,
Eigen::Ref< Eigen::Matrix< double, Nodes::DIM, NPI >>  result 
) const
inline

interpolation function on the output of the getter. result = vec_nod * a

Parameters
[in]getter
[out]result

◆ normal_vect()

Eigen::Vector3d Triangle::Tri::normal_vect ( ) const
inlineprivate

return normal to the triangle, not normalized

◆ operator<()

bool Triangle::Tri::operator< ( const Tri f) const
inline

Compares indices on lexicographic order : ind[0] then ind[1] then ind[2].

◆ operator==()

bool Triangle::Tri::operator== ( const Tri f) const
inline

two triangles are equal if there exists an indices permutation where node indices are the same Warning: it does not take into account orientation (direct or indirect)

◆ orientate()

void Triangle::Tri::orientate ( void  )
inlineprivatevirtual

do nothing function: orientation is done in mesh::indexReorder

Implements element< N, NPI >.

◆ potential()

double Tri::potential ( std::function< Eigen::Vector3d(Nodes::Node)>  getter,
int  i 
) const

computes correction on potential

Member Data Documentation

◆ dMs

double Triangle::Tri::dMs

difference (d for delta) of magnetization at the triangle between corresponding tetrahedrons

◆ n

Eigen::Vector3d Triangle::Tri::n

normal vector (unit vector)

◆ surf

double Triangle::Tri::surf

surface of the element


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