Feellgood
linear_algebra.h
Go to the documentation of this file.
1 #ifndef linear_algebra_h
2 #define linear_algebra_h
3 
9 #include <random>
10 #pragma GCC diagnostic push
11 #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
12 #include <execution>
13 #pragma GCC diagnostic pop
14 
15 #include "config.h"
16 
17 #include "facette.h"
18 #include "feellgoodSettings.h"
19 #include "mesh.h"
20 #include "node.h"
21 #include "tetra.h"
22 
29  {
30 public:
32  inline LinAlgebra(Settings &s , Mesh::mesh &my_msh )
33  : NOD(my_msh.getNbNodes()), MAXITER(s.MAXITER), TOL(s.TOL), ILU_tol(s.ILU_tol),
35  prmTetra(s.paramTetra), prmFacette(s.paramFacette), refMsh(&my_msh)
36  {
37  Eigen::setNbThreads(s.solverNbTh);
39  if (!s.recenter)
40  { idx_dir = Nodes::IDX_UNDEF; }
41  else
43 
44  if(s.getFieldType() == R4toR3)
45  { setExtSpaceField(s); }
46  }
47 
49  void prepareElements(Eigen::Vector3d const &Hext , timing const &t_prm );
50 
52  void prepareElements(double const A_Hext , timing const &t_prm );
53 
55  void buildInitGuess(Eigen::Ref<Eigen::VectorXd> G) const;
56 
59  int solver(timing const &t_prm );
60 
62  inline void set_DW_vz(double vz ) { DW_vz = vz; }
63 
65  inline double get_v_max(void) { return v_max; }
66 
68  void setExtSpaceField(Settings &s );
69 
71  void base_projection();
72 private:
75 
77  const int NOD;
78 
80  const int MAXITER;
81 
83  const double TOL;
84 
86  double ILU_tol;
87 
90 
92  const int verbose;
93 
95  const std::vector<Tetra::prm> &prmTetra;
96 
98  const std::vector<Facette::prm> &prmFacette;
99 
102 
104  double DW_vz;
105 
107  double v_max;
108 
110  std::vector< Eigen::Matrix<double,Nodes::DIM,Tetra::NPI> > extSpaceField;
111  };// end class linAlgebra
112 #endif
Definition: linear_algebra.h:29
LinAlgebra(Settings &s, Mesh::mesh &my_msh)
Definition: linear_algebra.h:32
double DW_vz
Definition: linear_algebra.h:104
const int NOD
Definition: linear_algebra.h:77
double get_v_max(void)
Definition: linear_algebra.h:65
void setExtSpaceField(Settings &s)
Definition: linear_algebra.cpp:65
double ILU_tol
Definition: linear_algebra.h:86
Nodes::index idx_dir
Definition: linear_algebra.h:74
double v_max
Definition: linear_algebra.h:107
void buildInitGuess(Eigen::Ref< Eigen::VectorXd > G) const
Definition: linear_algebra.cpp:13
void prepareElements(Eigen::Vector3d const &Hext, timing const &t_prm)
Definition: linear_algebra.cpp:22
double ILU_fill_factor
Definition: linear_algebra.h:89
void set_DW_vz(double vz)
Definition: linear_algebra.h:62
int solver(timing const &t_prm)
Definition: solver.cpp:7
const std::vector< Tetra::prm > & prmTetra
Definition: linear_algebra.h:95
Mesh::mesh * refMsh
Definition: linear_algebra.h:101
const double TOL
Definition: linear_algebra.h:83
const int MAXITER
Definition: linear_algebra.h:80
const std::vector< Facette::prm > & prmFacette
Definition: linear_algebra.h:98
void base_projection()
Definition: linear_algebra.cpp:3
std::vector< Eigen::Matrix< double, Nodes::DIM, Tetra::NPI > > extSpaceField
Definition: linear_algebra.h:110
const int verbose
Definition: linear_algebra.h:92
Definition: mesh.h:27
Container for all the settings provided by the user, with conversions to/from YAML.
Definition: feellgoodSettings.h:63
int solverNbTh
Definition: feellgoodSettings.h:143
Nodes::index recentering_direction
Definition: feellgoodSettings.h:137
field_exprType getFieldType(void) const
Definition: feellgoodSettings.h:291
bool recenter
Definition: feellgoodSettings.h:134
Definition: time_integration.h:6
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,...
@ R4toR3
Definition: feellgoodSettings.h:36
class mesh, readMesh is expecting a mesh file in gmsh format either text or binary,...
index
Definition: node.h:34
header to define struct Node
namespace Tetra header containing Tet class, some constants, and integrales