9 #pragma GCC diagnostic push
10 #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
12 #pragma GCC diagnostic pop
37 { std::cout <<
" reindexed\n"; }
39 double xmin =
minNodes(Nodes::IDX_X);
40 double xmax =
maxNodes(Nodes::IDX_X);
42 double ymin =
minNodes(Nodes::IDX_Y);
43 double ymax =
maxNodes(Nodes::IDX_Y);
45 double zmin =
minNodes(Nodes::IDX_Z);
46 double zmax =
maxNodes(Nodes::IDX_Z);
48 l = Eigen::Vector3d(xmax - xmin, ymax - ymin, zmax - zmin);
49 c = Eigen::Vector3d(0.5 * (xmax + xmin), 0.5 * (ymax + ymin), 0.5 * (zmax + zmin));
56 long_axis = Nodes::IDX_X;
58 long_axis = Nodes::IDX_Z;
63 long_axis = Nodes::IDX_Y;
65 long_axis = Nodes::IDX_Z;
69 vol = std::transform_reduce(EXEC_POL,
tet.begin(),
tet.end(), 0.0, std::plus{},
70 [](
Tetra::Tet const &te) { return te.calc_vol(); });
83 inline const Eigen::Vector3d
getNode_p(
const int i)
const {
return node[i].p; }
86 inline const Eigen::Vector3d
getNode_u(
const int i)
const {
return node[i].get_u(Nodes::NEXT); }
89 inline const Eigen::Vector3d
getNode_v(
const int i)
const {
return node[i].get_v(Nodes::NEXT); }
98 inline void set_node_u0(
const int i, Eigen::Vector3d
const &val)
99 {
node[i].d[Nodes::CURRENT].u = val; }
105 void infos(
void)
const;
110 std::for_each(EXEC_POL,
node.begin(),
node.end(),
115 void updateNodes(Eigen::Ref<Eigen::VectorXd> X,
const double dt);
120 std::for_each(EXEC_POL,
node.begin(),
node.end(),
134 std::vector<Facette::Fac>
fac;
137 std::vector<Tetra::Tet>
tet;
143 const std::string fileName );
151 n.d[Nodes::CURRENT].u = mySets.getMagnetization(n.p);
152 n.d[Nodes::NEXT].u = n.d[Nodes::CURRENT].u;
153 n.d[Nodes::NEXT].phi = 0.;
154 n.d[Nodes::NEXT].phiv = 0.;
165 void savesol(
const int precision ,
166 const std::string fileName ,
167 std::string
const &metadata )
const;
171 bool savesol(
const int precision ,
172 const std::string fileName ,
173 std::string
const &metadata ,
174 std::vector<double>
const &val )
const;
178 inline void set(
const int i ,
179 std::function<
void(
Nodes::Node &,
const double)> what_to_set ,
181 { what_to_set(
node[i], val); }
213 std::function<
bool(
double,
double)> whatToDo )
const;
218 return doOnNodes(__DBL_MAX__, coord, [](
double a,
double b) {
return a < b; });
224 return doOnNodes(__DBL_MIN__, coord, [](
double a,
double b) {
return a > b; });
250 void indexReorder(std::vector<Tetra::prm>
const &prmTetra);
const Eigen::Vector3d getNode_p(const int i) const
Definition: mesh.h:83
Eigen::Vector3d l
Definition: mesh.h:128
void checkMeshFile(Settings const &mySets)
Definition: read.cpp:35
void readNodes(Settings const &mySets)
Definition: read.cpp:60
const Eigen::Vector3d getNode_u(const int i) const
Definition: mesh.h:86
void readMesh(Settings const &mySets)
Definition: read.cpp:12
void indexReorder(std::vector< Tetra::prm > const &prmTetra)
Definition: mesh.cpp:48
int getNbFacs(void) const
Definition: mesh.h:77
void infos(void) const
Definition: mesh.cpp:5
Eigen::Vector3d c
Definition: mesh.h:125
void set_node_zero_v(const int i)
Definition: mesh.h:102
void init_distrib(Settings const &mySets)
Definition: mesh.h:147
int getNbNodes(void) const
Definition: mesh.h:74
std::vector< Nodes::Node > node
Definition: mesh.h:186
double minNodes(const Nodes::index coord) const
Definition: mesh.h:216
double doOnNodes(const double init_val, const Nodes::index coord, std::function< bool(double, double)> whatToDo) const
Definition: mesh.cpp:35
double getProj_ep(const int i) const
Definition: mesh.h:92
void savesol(const int precision, const std::string fileName, std::string const &metadata) const
Definition: save.cpp:127
std::vector< Tetra::Tet > tet
Definition: mesh.h:137
double maxNodes(const Nodes::index coord) const
Definition: mesh.h:222
double avg(std::function< double(Nodes::Node, Nodes::index)> getter, Nodes::index d) const
Definition: mesh.cpp:22
int getNbTets(void) const
Definition: mesh.h:80
void set_node_u0(const int i, Eigen::Vector3d const &val)
Definition: mesh.h:98
void sortNodes(Nodes::index long_axis)
Definition: mesh.cpp:97
double readSol(bool VERBOSE, const std::string fileName)
Definition: read.cpp:174
std::vector< Facette::Fac > fac
Definition: mesh.h:134
void setBasis(const double r)
Definition: mesh.h:108
void readTetraedrons(Settings const &mySets)
Definition: read.cpp:82
void evolution(void)
Definition: mesh.h:118
const Eigen::Vector3d getNode_v(const int i) const
Definition: mesh.h:89
void readTriangles(Settings const &mySets)
Definition: read.cpp:130
void updateNodes(Eigen::Ref< Eigen::VectorXd > X, const double dt)
Definition: mesh.cpp:14
std::vector< int > node_index
Definition: mesh.h:193
double getProj_eq(const int i) const
Definition: mesh.h:95
double vol
Definition: mesh.h:131
mesh(Settings const &mySets)
Definition: mesh.h:31
void set(const int i, std::function< void(Nodes::Node &, const double)> what_to_set, const double val)
Definition: mesh.h:178
Container for all the settings provided by the user, with conversions to/from YAML.
Definition: feellgoodSettings.h:63
int verbose
Definition: feellgoodSettings.h:125
std::vector< Tetra::prm > paramTetra
Definition: feellgoodSettings.h:210
contains namespace Facette header containing Fac class, and some constants and a less_than operator t...
many settings to give some parameters to the solver, boundary conditions for the problem,...
constexpr double a[N][NPI]
Definition: facette.h:28
index
Definition: node.h:34
header to define struct Node
namespace Tetra header containing Tet class, some constants, and integrales