16#include <Op_Diff_PolyMAC_HFV_base.h>
17#include <Champ_Face_PolyMAC_HFV.h>
18#include <Linear_algebra_tools_impl.h>
19#include <Domaine_PolyMAC_HFV.h>
20#include <Connectivite_som_elem.h>
21#include <Champ_Fonc_reprise.h>
22#include <Schema_Temps_base.h>
23#include <MD_Vector_base.h>
24#include <Champ_Uniforme.h>
25#include <TRUSTTab_parts.h>
26#include <Pb_Multiphase.h>
27#include <Equation_base.h>
28#include <Matrix_tools.h>
29#include <Domaine_VF.h>
63 if (
futur(n).size_reelle_ok())
65 DoubleTab& vals =
futur(n);
90 const IntTab& e_f =
domaine.elem_faces(), &f_e =
domaine.face_voisins();
95 for (j = 0; j < e_f.
dimension(1) && (f = e_f(e, j)) >= 0; j++)
97 const double coef = is_vit && ppf ? (*ppf)(f) / (*ppe)(e) : 1.0;
98 for (r = 0; r <
dimension; r++) val(e, r) += fs(f) / ve(e) * (xv(f, r) - xp(e, r)) * (e == f_e(f, 0) ? 1 : -1) * inco(f) * coef;
108 const IntTab& e_f =
domaine.elem_faces(), &f_e =
domaine.face_voisins();
110 assert(ve.line_size() == N * D);
112 for (
int poly = 0; poly < les_polys.
size(); poly++)
113 if ((e = les_polys(poly)) != -1)
115 for (n = 0; n < N * D; n++) val(e, n) = 0;
116 for (j = 0; j < e_f.
dimension(1) && (f = e_f(e, j)) >= 0; j++)
118 const double coef = is_vit && ppf ? (*ppf)(f) / (*ppe)(e) : 1.0;
119 for (d = 0; d < D; d++)
120 for (n = 0; n < N; n++) val(e, N * d + n) += fs(f) / ve(e) * (xv(f, d) - xp(e, d)) * (e == f_e(f, 0) ? 1 : -1) * inco(f, n) * coef;
131 Process::exit(
"TRUST error in Champ_Face_PolyMAC_HFV::valeur_aux_faces : A scalar field cannot be of Champ_Face type !");
136 for (
int f = 0; f <
domaine.nb_faces(); f++)
137 for (d = 0; d < D; d++)
138 for (n = 0; n < N; n++) val(f, N * d + n) = cha.
valeurs()(f, n) *
domaine.face_normales(f, d) /
domaine.face_surfaces(f);
144 assert(distant == 0);
146 const DoubleTab& val =
valeurs(t);
150 DoubleTrav ve(0, N * D);
157 for (
int i = 0; i < fr_vf.
nb_faces(); i++)
160 for (
int dir = 0; dir < 2; dir++)
162 const int elem = face_voisins(face, dir);
165 for (d = 0; d < dim; d++)
166 for (n = 0; n < N; n++) x(i, N * d + n) = vectoriel ? ve(elem, N * d + n) : val(face, n);
virtual Champ_base & le_champ()
: class Champ_Face_PolyMAC_HFV
void interp_ve(const DoubleTab &inco, DoubleTab &val, bool is_vit=true) const override
virtual void init_auxiliary_variables()
int fixer_nb_valeurs_nodales(int n) override
int nb_valeurs_nodales() const override
int reprendre(Entree &fich) override
Restores an Objet_U from an input stream. Virtual method to override.
DoubleTab & trace(const Frontiere_dis_base &, DoubleTab &, double, int distant) const override
Computes the trace of a field on a boundary at time tps.
const Domaine_PolyMAC_HFV & domaine_PolyMAC_HFV() const
DoubleTab & valeur_aux_faces(DoubleTab &result) const override
Returns the field value at the faces.
const Domaine & domaine() const
virtual void creer_tableau_distribue(const MD_Vector &, RESIZE_OPTIONS=RESIZE_OPTIONS::COPY_INIT)
DoubleTab & futur(int i=1) override
Returns field values at instant t+i.
virtual int nb_valeurs_temporelles() const
Returns the number of temporal values currently kept.
DoubleTab & valeurs() override
Returns the array of field values at the current time.
int reprendre(Entree &) override
Reads an unknown field from an input stream for a restart.
bool via_ch_fonc_reprise() const
virtual DoubleTab & valeurs()=0
class Champ_base This class is the base of the fields hierarchy.
virtual void creer_tableau_elements(Array_base &, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT) const
Creates a parallel array of values at elements.
int nb_faces() const
Returns the total number of faces.
int face_voisins(int num_face, int i) const
Returns the neighbouring element of num_face in direction i.
const Domaine & domaine() const
Class defining operators and methods for all reading operation in an input flow (file,...
virtual const Milieu_base & milieu() const =0
const Nom & le_nom() const override
Returns the name of the field.
virtual int nb_comp() const
int num_premiere_face() const
class Frontiere_dis_base Class representing a discretized boundary.
: This class is an OWN_PTR but the pointed object is shared among multiple
DoubleVect & porosite_elem()
DoubleVect & porosite_face()
int mon_equation_non_nul() const
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
const Nom & que_suis_je() const
Returns the string identifying the class.
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Multiphase thermohydraulics problem of type "3*N equations":
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Base class for output streams.
void set_md_vector(const MD_Vector &) override
void resize(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
void resize_dim0(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
_SIZE_ dimension(int d) const