16#ifndef Iterateur_Source_Face_included
17#define Iterateur_Source_Face_included
19#include <Iterateur_Source_base.h>
20#include <Dirichlet_homogene.h>
21#include <Champ_Uniforme.h>
22#include <TRUSTSingle.h>
23#include <Milieu_base.h>
25#include <Domaine_VF.h>
27template <
class _TYPE_>
44 DoubleTab&
ajouter(DoubleTab& )
const override;
64 template <
typename Type_Double> DoubleTab&
ajouter_faces_bords(
const int, DoubleTab& )
const;
65 inline const int&
faces_doubles(
int num_face)
const {
return ref_cast(
Domaine_VF,le_dom.valeur()).faces_doubles()[num_face]; }
76 DoubleVect& bilan = so_base->bilan();
78 const int nb_faces_tot = ref_cast(
Domaine_VF,le_dom.valeur()).nb_faces_tot();
79 coef.resize(nb_faces_tot, RESIZE_OPTIONS::NOCOPY_NOINIT);
89 const DoubleTab& val_rho = rho.
valeurs();
90 const IntTab& face_vois = le_dom->face_voisins();
91 const DoubleVect& volumes = ref_cast(
Domaine_VF,le_dom.valeur()).volumes();
93 for (
int fac = 0; fac < nb_faces_tot; fac++)
95 const int elem1 = face_vois(fac, 0), elem2 = face_vois(fac, 1);
99 coef(fac) += val_rho(elem1) * volumes(elem1);
100 vol += volumes(elem1);
104 coef(fac) += val_rho(elem2) * volumes(elem2);
105 vol += volumes(elem2);
125template<
class _TYPE_>
template<
typename Type_Double>
128 Type_Double source(ncomp);
129 DoubleVect& bilan = so_base->bilan();
130 for (
int num_cl = 0; num_cl < le_dom->nb_front_Cl(); num_cl++)
132 const Cond_lim& la_cl = la_zcl->les_conditions_limites(num_cl);
137 for (
int num_face = ndeb; num_face < nfin; num_face++)
140 for (
int k = 0; k < ncomp; k++)
142 resu(num_face, k) += source[k];
143 double contribution = (
faces_doubles(num_face) == 1) ? 0.5 : 1;
144 bilan(k) += contribution *
coef(num_face) * source[k];
151template<
class _TYPE_>
template<
typename Type_Double>
154 Type_Double source(ncomp);
155 DoubleVect& bilan = so_base->bilan();
159 for (
int k = 0; k < ncomp; k++)
161 resu(num_face, k) += source[k];
162 double contribution = (
faces_doubles(num_face) == 1) ? 0.5 : 1;
163 bilan(k) += contribution *
coef(num_face) * source[k];
virtual DoubleTab & valeurs()=0
class Champ_base This class is the base of the fields hierarchy.
class Cond_lim Generic class used to represent any class
Classe Dirichlet_homogene This class is the base class of the hierarchy of homogeneous Dirichlet-type...
Dirichlet This class is the base class of the hierarchy of Dirichlet-type boundary conditions.
virtual const Milieu_base & milieu() const =0
int num_premiere_face() const
DoubleTab & ajouter_faces_internes(const int, DoubleTab &) const
Evaluateur_Source & evaluateur() override
_TYPE_ evaluateur_source_face
const int & faces_doubles(int num_face) const
DoubleTab & ajouter(DoubleTab &) const override
Iterateur_Source_Face(const Iterateur_Source_Face< _TYPE_ > &iter)
int premiere_face_interne
DoubleTab & ajouter_faces_bords(const int, DoubleTab &) const
void completer_() override
int equation_divisee_par_rho() const
Milieu_base This class is the base of the (physical) medium hierarchy.
virtual const Equation_base & equation(const std::string &nom_inc) const
virtual const Champ_base & masse_volumique() const
Returns the mass density of the medium (const version).
virtual int duplique() const =0
virtual unsigned taille_memoire() const =0
int numero() const
Returns the index of the object in Memoire::data.
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.