Feellgood
|
#include <mesh.h>
Public Member Functions | |
mesh (Settings const &mySets) | |
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 | updateNodes (Eigen::Ref< Eigen::VectorXd > X, 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) const |
void | savesol (const int precision, const std::string fileName, std::string const &metadata) const |
bool | savesol (const int precision, const std::string fileName, std::string const &metadata, std::vector< double > const &val) const |
void | set (const int i, std::function< void(Nodes::Node &, const double)> what_to_set, const double val) |
Public Attributes | |
Eigen::Vector3d | c |
Eigen::Vector3d | l |
double | vol |
std::vector< Facette::Fac > | fac |
std::vector< Tetra::Tet > | tet |
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 (std::vector< Tetra::prm > const &prmTetra) |
void | sortNodes (Nodes::index long_axis) |
Private Attributes | |
std::vector< Nodes::Node > | node |
std::vector< int > | node_index |
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 |
double mesh::avg | ( | std::function< double(Nodes::Node, Nodes::index)> | getter, |
Nodes::index | d | ||
) | const |
average component of either u or v through getter on the whole set of tetetrahedron
[in] | getter | |
[in] | d |
|
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 |
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
[in] | mySets |
|
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 | ||
) | const |
text file (tsv) writing function for a solution
[in] | precision | numeric precision in .sol output text file |
[in] | fileName | |
[in] | metadata |
bool Mesh::mesh::savesol | ( | const int | precision, |
const std::string | fileName, | ||
std::string const & | metadata, | ||
std::vector< double > const & | val | ||
) | const |
text file (tsv) writing function for a solution of a side problem, used by electrostatSolver
[in] | precision | |
[in] | fileName | |
[in] | metadata | |
[in] | val |
|
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 |
void mesh::updateNodes | ( | Eigen::Ref< Eigen::VectorXd > | X, |
const double | dt | ||
) |
make_evol on all nodes
Eigen::Vector3d Mesh::mesh::c |
isobarycenter
std::vector<Facette::Fac> Mesh::mesh::fac |
face container
Eigen::Vector3d Mesh::mesh::l |
lengths along x,y,z axis
|
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::Tet> Mesh::mesh::tet |
tetrahedron container
double Mesh::mesh::vol |
total volume of the mesh