|
Feellgood
|
#include <mesh.h>
Public Member Functions | |
| mesh (Settings &mySets) | |
| mesh (const mesh &)=delete | |
| mesh & | operator= (const mesh &)=delete |
| int | getNbNodes (void) const |
| int | getNbFacs (void) const |
| int | getNbTets (void) const |
| const Eigen::Vector3d | getNode_p (const int i) const |
| const Eigen::Vector3d | getNode_u (const int i) const |
| const Eigen::Vector3d | getNode_v (const int i) const |
| double | getProj_ep (const int i) const |
| double | getProj_eq (const int i) const |
| void | set_node_u0 (const int i, Eigen::Vector3d const &val) |
| void | set_node_zero_v (const int i) |
| void | infos (void) const |
| void | setBasis (const double r) |
| void | updateNode (int i, double vp, double vq, const double dt) |
| void | evolution (void) |
| double | readSol (bool VERBOSE, const std::string fileName) |
| void | init_distrib (Settings const &mySets) |
| double | avg (std::function< double(Nodes::Node, Nodes::index)> getter, Nodes::index d, int region=-1) const |
| double | max_angle () const |
| void | savesol (const int precision, const std::string fileName, std::string const &metadata, bool withSpinAcc, std::vector< Eigen::Vector3d > &s) const |
| void | set (const int i, std::function< void(Nodes::Node &, const double)> what_to_set, const double val) |
| int | getNodeIndex (const int i) const |
| bool | isMagnetic (const Tetra::Tet &t) |
| bool | isMagnetic (const Facette::Fac &f) |
Public Attributes | |
| Eigen::Vector3d | c |
| Eigen::Vector3d | l |
| double | vol |
| double | totalMagVol |
| std::vector< Facette::Fac > | fac |
| std::vector< Tetra::Tet > | tet |
| std::vector< Tetra::prm > & | paramTetra |
| std::vector< std::pair< int, int > > | edges |
| std::vector< bool > | magNode |
| std::vector< int > | magTet |
| std::vector< int > | magFac |
Private Member Functions | |
| void | checkMeshFile (Settings const &mySets) |
| void | readNodes (Settings const &mySets) |
| void | readTetraedrons (Settings const &mySets) |
| void | readTriangles (Settings const &mySets) |
| void | readMesh (Settings const &mySets) |
| double | doOnNodes (const double init_val, const Nodes::index coord, std::function< bool(double, double)> whatToDo) const |
| double | minNodes (const Nodes::index coord) const |
| double | maxNodes (const Nodes::index coord) const |
| void | indexReorder () |
| void | sortNodes (Nodes::index long_axis) |
| double | surface (std::vector< int > &facIndices) |
| bool | isInMagList (std::vector< int > &idxMagList, Facette::Fac &f) |
Private Attributes | |
| std::vector< Nodes::Node > | node |
| std::vector< int > | node_index |
| std::vector< std::vector< int > > | volumeRegions |
class for storing the mesh, including mesh geometry values, containers for the nodes, triangular faces and tetrahedrons. nodes data are private. They are accessible only through getter and setter.
|
inline |
constructor : read mesh file, reorder indices and computes some values related to the mesh : center and length along coordinates,full volume
| [in] | mySets |
|
delete |
operator copy deleted
| double mesh::avg | ( | std::function< double(Nodes::Node, Nodes::index)> | getter, |
| Nodes::index | d, | ||
| int | region = -1 |
||
| ) | const |
average component of either u or v through getter on the whole set of tetetrahedron
| [in] | getter | |
| [in] | d | |
| region | region index, or -1 for all magnetic regions |
|
private |
test if mesh file contains surfaces and regions mentionned in yaml settings and their dimensions
| [in] | mySets |
|
private |
loop on nodes to apply predicate 'whatTodo'
| [in] | init_val | |
| [in] | coord | |
| [in] | whatToDo |
|
inline |
call evolution for all the nodes
|
inline |
return number of triangular fac
|
inline |
return number of nodes
|
inline |
return number of tetrahedrons
|
inline |
getter : return node.p
|
inline |
getter : return node.u
|
inline |
getter : return node.v
|
inline |
getter for the node_index value at position i
|
inline |
return projection of speed at node i along ep
|
inline |
return projection of speed at node i along eq
|
private |
redefine orientation of triangular faces in accordance with the tetrahedron reorientation of the tetrahedrons if needed; definition of Ms on facette elements Indices and orientation convention :
v
.
,/
/
2(ic) 2
,/|`\ ,/|`\
,/ | `\ ,/ | `\
,/ '. `\ ,6 '. `5
,/ | `\ ,/ 8 `\
,/ | \ ,/ |\ 0(ia)----—'.-----—1(ib) --> u 0-----—4–'.-----—1 \. | ,/. | ,/ \. | ,/. | ,9 ‘. ’. ,/ ‘7. ’. ,/ \. |/. |/ 3(id)3 \. w
| void mesh::infos | ( | void | ) | const |
basic informations on the mesh
|
inline |
computes an analytical initial magnetization distribution as a starting point for the simulation. If the node is not magnetic then it is set to NAN.
| [in] | mySets |
|
inlineprivate |
return true if facette f is already indexed in the list idxMagList. Uses operator== for Fac.
|
inline |
return true if this facet is magnetic
|
inline |
return true if this tetraedron is magnetic
|
inline |
Compute the maximum angle of the magnetization between two adjacent nodes.
|
inlineprivate |
return the maximum of all nodes coordinate along coord axis
| [in] | coord |
|
inlineprivate |
return the minimum of all nodes coordinate along coord axis
| [in] | coord |
|
private |
reading mesh format 2.2 text file function
| [in] | mySets |
|
private |
read Nodes from mesh file
| [in] | mySets |
| double Mesh::mesh::readSol | ( | bool | VERBOSE, |
| const std::string | fileName | ||
| ) |
read a solution from a file (tsv formated) and initialize fem struct to restart computation from that distribution, return time
| [in] | VERBOSE | |
| [in] | fileName | input .sol text file |
|
private |
read tetraedrons of the settings volume regions
| [in] | mySets |
|
private |
read facettes of the settings surface regions
| [in] | mySets |
| void Mesh::mesh::savesol | ( | const int | precision, |
| const std::string | fileName, | ||
| std::string const & | metadata, | ||
| bool | withSpinAcc, | ||
| std::vector< Eigen::Vector3d > & | s | ||
| ) | const |
text file (tsv) writing function for a solution, node indices are zero based first column is index, then magnetization components, then scalar magnetic potential. If spin accumulation was involved, there are three extra columns for the componants of the spin diffusion vector. Since some volume region might be non magnetic, magnetization is undefined on those nodes and nan is used
| [in] | precision | numeric precision in .sol output text file |
| [in] | fileName | |
| [in] | metadata | |
| [in] | withSpinAcc | |
| [in] | s | spin accumulation (might be empty) |
|
inline |
setter for node[i]; what_to_set will fix what is the part of the node struct to set (usefull for fmm_demag.h)
| [in] | i | |
| [in] | what_to_set | |
| [in] | val |
|
inline |
setter for u0
|
inline |
fix to zero node[i].v
|
inline |
call setBasis for all nodes, and update P matrix for all elements
|
private |
Sort the nodes along the longest axis of the sample. This should reduce the bandwidth of the matrix we will have to solve for.
| [in] | long_axis |
|
private |
returns the surface defined by the set of facets of indices in facIndices each elementary surface triangle defined by points p0,p1,p2 is computed using norm(cross(p0p1,p0p2))/2, it is always positive
|
inline |
make_evol on i^th node
| Eigen::Vector3d Mesh::mesh::c |
isobarycenter
| std::vector<std::pair<int, int> > Mesh::mesh::edges |
Edges of all the tetrahedrons, i.e. all the unique pairs of adjacent node indices. Each pair is sorted: first < second. The list is sorted lexicographically, as per std::pair::operator<().
| std::vector<Facette::Fac> Mesh::mesh::fac |
face container
| Eigen::Vector3d Mesh::mesh::l |
lengths along x,y,z axis
| std::vector<int> Mesh::mesh::magFac |
list of the indices of all magnetic facets from all surface regions
| std::vector<bool> Mesh::mesh::magNode |
list of the magnetic nodes, using inner indices (non gmsh indices). If true it is magnetic. a node is magnetic if it belongs to a magnetic tetrahedron. Consequently any node on a magnetic/non magnetic interface is set to true in magNode.
| std::vector<int> Mesh::mesh::magTet |
list of the indices of all magnetic tetrahedrons from all volume regions
|
private |
node container: not initialized by constructor, but later while reading the mesh by member function init_node
|
private |
Index of a node in the node vector. This vector is itself indexed by the node position in the *.msh and *.sol files. In other words, the node found at file_idx in a file is stored as node[node_index[file_idx]].
This is the inverse of the permutation we applied when sorting the nodes.
| std::vector<Tetra::prm>& Mesh::mesh::paramTetra |
Reference to the volume regions in Settings.
| std::vector<Tetra::Tet> Mesh::mesh::tet |
tetrahedron container
| double Mesh::mesh::totalMagVol |
total magnetic volume of the mesh
| double Mesh::mesh::vol |
total volume of the mesh
|
private |
List of tetrahedrons making each volume region.