16#include <Porosites_champ.h>
17#include <Champ_Don_base.h>
18#include <Sous_Domaine.h>
19#include <Domaine_VF.h>
24const DoubleTab& modif_par_porosite_si_flag(
const DoubleTab& org, DoubleTab& res,
int flag,
const DoubleVect& porosite)
26 mapToDevice(porosite);
28 if ((flag == 0) || (local_min_abs_vect(porosite) == 1))
34 tab_multiply_any_shape(res, porosite, VECT_ALL_ITEMS);
45 Cerr <<
"!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << finl;
46 Cerr <<
"TRUST-V1.9.1 : Porosites_champ interpret is no more available !" << finl;
47 Cerr <<
"You should define the porosity in the medium bloc, for example like this : " << finl;
48 Cerr <<
"porosites_champ champ_fonc_xyz dom 1 1-0.5*(y>1)*(y<2) " << finl;
84 Cerr <<
"Porosites : { expected after porosites instead of " << mot << finl;
87 for (is >> mot; mot !=
"}"; is >> mot)
95 Cerr <<
"Porosites : { expected after the sous domaine instead of " << mot << finl;
98 for (is >> motcle; motcle !=
"}"; is >> motcle)
100 if (motcle ==
"VOLUMIQUE")
105 else if (motcle ==
"SURFACIQUE")
112 Cerr <<
"Porosites : " << motcle <<
" is not known !! Use either VOLUMIQUE or SURFACIQUE" << finl;
128 if (val.local_min_vect() <= 0)
130 Cerr <<
"You entered a negative surfacic porosity ! " << finl;
141 Cerr <<
"Porosites should no longer be used in VEF. Porosites_champ should be used instead." << finl;
149 for (
int ind = 0; ind < sz; ind++)
158 const int elem = ssz(i);
160 for (
int j = 0; j < nb_faces_elem; j++)
162 double norme_normale = 0;
163 for (
int iii = 0; iii <
dimension; iii++)
166 porosite_face(elem_faces(elem, j)) = 0.;
167 for (
int iii = 0; iii <
dimension; iii++)
169 * std::fabs(zvf.
face_normales(elem_faces(elem, j), iii)) / norme_normale;
175 Cerr <<
" The volumic porosities are used to calculate the surfacic porosities " << finl;
178 const int elem = ssz(i);
183 for (
int i = 0; i < nb_elem_tot; i++)
185 for (
int j = 0; j < nb_faces_elem; j++)
187 int face_glob = elem_faces(i, j), num_poly_vois = zvf.
face_voisins(face_glob, 1), num_poly_vois1 = zvf.
face_voisins(face_glob, 0);
189 if ((num_poly_vois != -1) && (num_poly_vois1 != -1))
190 porosite_face(face_glob) = (porosite_elem(num_poly_vois1) + porosite_elem(num_poly_vois)) / 2.;
192 porosite_face(face_glob) = porosite_elem(i);
197 else if (porsurfmin != 1)
199 Cerr <<
" The surfacic porosities are used to calculate the volumic porosities " << finl;
202 const int elem = ssz(i);
203 for (
int j = 0; j < nb_faces_elem; j++)
205 double norme_normale = 0.;
206 for (
int iii = 0; iii <
dimension; iii++)
209 porosite_face(elem_faces(elem, j)) = 0.;
210 for (
int iii = 0; iii <
dimension; iii++)
int_t nb_elem_tot() const
int nb_faces_elem(int=0) const
Returns the number of faces of type i of the geometric elements that make up the domain.
virtual double face_normales(int face, int comp) const
int elem_faces(int i, int j) const
Returns the index of the i-th face of element num_elem; the face numbering convention is.
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,...
Base class for "interpreter" objects.
static Objet_U & objet(const Nom &)
See Interprete_bloc::objet_global(). BM: the Interprete class is not the best place for this.
virtual int debute_par(const char *const n) const
Base class for TRUST objects (Objet_U).
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.
Porosites_champ nom_pb champ: assigns the field champ to the volumetric porosity of the domain of pro...
Entree & interpreter(Entree &) override
void remplir_champ(const Domaine_VF &zvf, DoubleVect &, DoubleVect &)
std::vector< DoubleVect > porosites_surf
std::vector< double > porosites_volu
std::vector< Nom > les_sous_domaines
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Base class for output streams.
int_t nb_elem_tot() const
virtual void ref(const TRUSTTab &)
_SIZE_ dimension_tot(int) const override
_SIZE_ size_totale() const