16#include <Op_Conv_VEF_base.h>
18#include <Milieu_base.h>
19#include <Schema_Temps_base.h>
20#include <Probleme_base.h>
22#include <Discretisation_base.h>
24#include <Modifier_pour_fluide_dilatable.h>
25#include <Dirichlet_homogene.h>
26#include <Periodique.h>
66 const Domaine_VEF& domaine_VEF = le_dom_vef.valeur();
82 for (
int n_bord = 0; n_bord < domaine_VEF.
nb_front_Cl(); n_bord++)
89 int nfin = ndeb + le_bord.
nb_faces();
90 for (
int num_face = ndeb; num_face < nfin; num_face++)
97 for (
int num_face = ndeb; num_face < nfin; num_face++)
102 double dt_stab = 1.e30;
104 CDoubleArrView fluent =
fluent_.view_ro();
106 start_gpu_timer(__KERNEL_NAME__);
107 Kokkos::parallel_reduce(__KERNEL_NAME__,
109 KOKKOS_LAMBDA(
const int ind_face,
double& dtstab)
111 int num_face = faces_entrelaces_Cl(ind_face);
112 double dt_face = volumes_entrelaces_Cl(num_face)/(fluent(num_face)+DMINFLOAT);
113 if (dt_face < dtstab) dtstab = dt_face;
114 }, Kokkos::Min<double>(dt_stab));
115 end_gpu_timer(__KERNEL_NAME__);
122 CDoubleArrView volumes_entrelaces = tab_volumes_entrelaces.view_ro();
126 double dt_stab_2 = dt_stab;
127 Kokkos::parallel_reduce(
128 start_gpu_timer(__KERNEL_NAME__),
129 range_1D(ndeb, nfin),
130 KOKKOS_LAMBDA(
const int num_face,
double& dtstab)
132 double dt_face = volumes_entrelaces(num_face) / (fluent(num_face) + DMINFLOAT);
133 if (dt_face < dtstab) dtstab = dt_face;
134 }, Kokkos::Min<double>(dt_stab_2));
135 end_gpu_timer(__KERNEL_NAME__);
136 if (dt_stab_2 < dt_stab) dt_stab = dt_stab_2;
154 DoubleTab& es_valeurs = espace_stockage.
valeurs();
157 if ((
bool(le_dom_vef)) && (
bool(la_zcl_vef)))
160 const Domaine_VEF& domaine_VEF = le_dom_vef.valeur();
171 for (
int n_bord=0; n_bord<domaine_VEF.
nb_front_Cl(); n_bord++)
180 int nfin = ndeb + le_bord.
nb_faces();
181 for (
int num_face=ndeb; num_face<nfin; num_face++)
183 dt_face = volumes_entrelaces_Cl(num_face)/(
fluent_[num_face]+1.e-30);
184 es_valeurs(num_face) = dt_face;
193 for (
int num_face=ndeb; num_face<nfin; num_face++)
195 dt_face = volumes_entrelaces_Cl(num_face)/(
fluent_[num_face]+1.e-30);
196 es_valeurs(num_face) = dt_face;
202 for (
int num_face=ndeb; num_face<nfin; num_face++)
204 dt_face = volumes_entrelaces(num_face)/(
fluent_[num_face]+1.e-30);
205 es_valeurs(num_face) = dt_face;
243 Cerr <<
"Initialization of the wheel for permutation of convection schemes" << finl;
247 le_dom_vef->creer_tableau_faces(
fluent_);
256 DoubleTab& resu)
const
259 return ajouter(transporte,resu);
267 DoubleTrav tmp(
equation().inconnue().valeurs());
282 const Domaine_VEF& domaine_VEF = le_dom_vef.valeur();
286 int nb_faces= domaine_VEF.
nb_faces();
287 dt_face=(volumes_entrelaces);
290 for (
int n_bord=0; n_bord<domaine_VEF.
nb_front_Cl(); n_bord++)
295 int nfin = ndeb + le_bord.
nb_faces();
296 for (
int num_face=ndeb; num_face<nfin; num_face++)
298 if( sup_strict(
fluent_[num_face], 1.e-30) )
299 dt_face(num_face)= volumes_entrelaces_Cl(num_face)/
fluent_[num_face];
301 dt_face(num_face) = -1.;
309 for (
int num_face=ndeb; num_face<nfin; num_face++)
311 if( sup_strict(
fluent_[num_face], 1.e-30) )
312 dt_face(num_face)= volumes_entrelaces(num_face)/
fluent_[num_face];
314 dt_face(num_face) = -1.;
320 for (
int num_face=ndeb; num_face<nfin; num_face++)
322 if( sup_strict(
fluent_[num_face], 1.e-30) )
323 dt_face(num_face)= volumes_entrelaces(num_face)/
fluent_[num_face];
325 dt_face(num_face) = -1.;
329 for(
int i=0; i<nb_faces; i++)
331 if(! sup_strict(dt_face(i), 1.e-16))
332 dt_face(i) = max_dt_local;
336 for (
int n_bord=0; n_bord<domaine_VEF.
nb_front_Cl(); n_bord++)
343 int nb_faces_bord=le_bord.
nb_faces();
344 for (
int ind_face=0; ind_face<nb_faces_bord; ind_face++)
347 int face = le_bord.
num_face(ind_face);
348 int face_associee = le_bord.
num_face(ind_face_associee);
349 if (!est_egal(dt_face(face),dt_face(face_associee),1.e-8))
351 dt_face(face) = std::min(dt_face(face),dt_face(face_associee));
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.
DoubleVect & volumes_entrelaces_Cl()
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
const Cond_lim & les_conditions_limites(int) const
Returns the i-th boundary condition.
int premiere_face_std() const
int nb_faces() const
Returns the total number of faces.
DoubleVect & volumes_entrelaces()
int premiere_face_int() const
A face is internal if and only if it separates two elements.
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
Class defining operators and methods for all reading operation in an input flow (file,...
class Equation_base The role of an equation is the calculation of one or more fields....
virtual const Champ_Inc_base & inconnue() const =0
const Nom & le_nom() const override
Returns the name of the field.
int num_premiere_face() const
int num_face(const int) const
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
virtual Motcle get_localisation_pour_post(const Nom &option) const
virtual void calculer_pour_post(Champ_base &espace_stockage, const Nom &option, int comp) const
A character string (Nom) in uppercase.
class Nom: a character string for naming TRUST objects.
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 const Nom & le_nom() const
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
int impr(Sortie &os) const override
DOES NOTHING - to override in derived classes.
int phi_u_transportant(const Equation_base &eq) const
Defines whether psi is convected with phi*u or with u.
void associer(const Domaine_dis_base &, const Domaine_Cl_dis_base &, const Champ_Inc_base &) override
DoubleTab & calculer(const DoubleTab &, DoubleTab &) const override
void calculer_pour_post(Champ_base &espace_stockage, const Nom &option, int comp) const override
const Champ_Inc_base & vitesse() const
virtual void remplir_fluent() const
void abortTimeStep() override
void associer_vitesse(const Champ_base &) override
double calculer_dt_stab() const override
Computes dt_stab.
void associer_domaine_cl_dis(const Domaine_Cl_dis_base &) override
ArrOfInt faces_entrelaces_Cl_
void calculer_dt_local(DoubleTab &) const override
Motcle get_localisation_pour_post(const Nom &option) const override
int impr(Sortie &, const Operateur_base &) const
Print the face fluxes of a VEF operator (e.g. diffusion, convection).
Operateur_Conv_base This class is the base of the hierarchy of operators representing.
void fixer_dt_stab_conv(double dt)
virtual void abortTimeStep()
virtual DoubleTab & ajouter(const DoubleTab &, DoubleTab &) const
class Periodique This class represents a periodic boundary condition.
int face_associee(int i) const
static double mp_min(double)
Base class for output streams.
_TYPE_ mp_max_abs_vect(Mp_vect_options opt=VECT_REAL_ITEMS) const
virtual void echange_espace_virtuel(IsExchangeBlocking exchange_type=IsExchangeBlocking::DefaultBlocking, const std::string kernel_name="noname")