16#include <Op_Diff_VEF_base.h>
17#include <Champ_P1NC.h>
18#include <Champ_Q1NC.h>
19#include <Champ_Uniforme.h>
20#include <Milieu_base.h>
21#include <Probleme_base.h>
22#include <Schema_Temps_base.h>
23#include <Champ_Fonc_P0_base.h>
24#include <Discretisation_base.h>
25#include <Check_espace_virtuel.h>
26#include <Echange_externe_impose.h>
81 const Domaine_VEF& domaine_VEF = le_dom_vef.valeur();
98 double dt_stab = DMAXFLOAT;
99 const Domaine_VEF& domaine_VEF = le_dom_vef.valeur();
107 const DoubleVect& valeurs_diffusivite = champ_diffusivite.
valeurs();
108 double alpha_max = local_max_vect(valeurs_diffusivite);
111 double h_imp_max = -1, h_imp_temp=-2, max_conductivity = 0;
123 const DoubleVect& tab = le_ch_front.
valeurs();
126 h_imp_temp = local_max_vect(tab);
127 h_imp_temp = std::fabs(h_imp_temp);
128 h_imp_max = (h_imp_temp>h_imp_max) ? h_imp_temp : h_imp_max ;
135 if ((alpha_max == 0.)||(domaine_VEF.
nb_elem()==0))
145 max_conductivity = local_max_vect(tab_lambda);
147 double Bi = h_imp_max*sqrt(min_delta_h_carre)/max_conductivity;
150 alpha_max *= h_imp_max*sqrt(min_delta_h_carre)/max_conductivity;
152 dt_stab = min_delta_h_carre / (2. *
dimension * alpha_max);
163 const int nb_elem = domaine_VEF.
nb_elem();
165 CDoubleArrView valeurs_diffu =
static_cast<const DoubleVect&
>(champ_diffu.
valeurs()).view_ro();
166 CDoubleArrView valeurs_rho =
static_cast<const DoubleVect&
>(champ_rho.
valeurs()).view_ro();
167 Kokkos::parallel_reduce(start_gpu_timer(__KERNEL_NAME__),
168 range_1D(0, nb_elem), KOKKOS_LAMBDA(
169 const int elem,
double& dtstab)
171 const double h_carre = carre_pas_maille(elem);
172 const double diffu = valeurs_diffu(elem);
173 const double rho = valeurs_rho(elem);
174 const double dt = h_carre * rho / (deux_dim * (diffu+DMINFLOAT));
175 if (dt < dtstab) dtstab = dt;
176 }, Kokkos::Min<double>(dt_stab));
177 end_gpu_timer(__KERNEL_NAME__);
188 DoubleTab& es_valeurs = espace_stockage.
valeurs();
193 const Domaine_VEF& domaine_VEF = le_dom_vef.valeur();
198 const DoubleVect& valeurs_diffusivite = champ_diffusivite.
valeurs();
199 double alpha_max = local_max_vect(valeurs_diffusivite);
201 if ((alpha_max == 0.)||(domaine_VEF.
nb_elem()==0))
202 es_valeurs = DMAXFLOAT;
205 const int nb_elem = domaine_VEF.
nb_elem();
206 for (
int elem = 0; elem < nb_elem; elem++)
216 const DoubleTab& valeurs_diffu = champ_diffu.
valeurs();
218 const DoubleTab& valeurs_rho = champ_rho.
valeurs();
221 const int nb_elem = domaine_VEF.
nb_elem();
224 for (
int elem = 0; elem < nb_elem; elem++)
227 const double diffu = valeurs_diffu(elem);
228 const double rho = valeurs_rho(elem);
229 const double dt = h_carre * rho / (deux_dim * diffu);
230 es_valeurs(elem) = dt;
253 const Domaine_VEF& domaine_VEF = le_dom_vef.valeur();
266 CDoubleArrView diffu =
static_cast<const DoubleVect&
>(tab_diffu).view_ro();
267 DoubleTabView nu = tab_nu.
view_rw();
268 Kokkos::parallel_for(start_gpu_timer(__KERNEL_NAME__),
269 range_2D({0, 0}, {n, nb_comp}),
270 KOKKOS_LAMBDA(
const int i,
const int j)
274 end_gpu_timer(__KERNEL_NAME__);
279 assert_espace_virtuel_vect(tab_diffu);
281 mapToDevice(tab_diffu);
282 computeOnTheDevice(tab_nu);
DoubleTab & valeurs() override
Overrides Champ_base::valeurs() Returns the array of values.
DoubleTab & valeurs() override
Returns the array of field values at the current time.
virtual DoubleTab & valeurs()=0
class Champ_base This class is the base of the fields hierarchy.
class Champ_front_base Base class for the hierarchy of boundary fields.
virtual DoubleTab & valeurs() override
Returns the array of field values.
class Cond_lim_base Base class for the hierarchy of classes that represent the different boundary con...
virtual void creer_tableau_elements(Array_base &, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT) const
Creates a parallel array of values at elements.
class Domaine_Cl_dis_base Domaine_Cl_dis_base objects represent discretized boundary conditions
int nb_cond_lim() const
Returns the number of boundary conditions.
const Cond_lim & les_conditions_limites(int) const
Returns the i-th boundary condition.
double carre_pas_du_maillage() const
const DoubleVect & carre_pas_maille() const
int nb_faces_bord() const
Returns the number of faces on which boundary conditions are applied:
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
const Domaine & domaine() const
Classe Echange_externe_impose: This class represents the special case of the class.
virtual double h_imp(int num) const
Returns the value of the imposed heat exchange coefficient on the i-th component.
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 Milieu_base & milieu() const =0
virtual const Champ_Inc_base & inconnue() const =0
const Nom & le_nom() const override
Returns the name of the field.
Milieu_base This class is the base of the (physical) medium hierarchy.
virtual const Champ_Don_base & conductivite() const
Returns the conductivity of the medium (const version).
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 Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
int phi_psi_diffuse(const Equation_base &eq) const
Determine whether to compute div(phi nu grad Psi) or div(nu grad Phi psi).
void calculer_pour_post(Champ_base &espace_stockage, const Nom &option, int comp) const override
Motcle get_localisation_pour_post(const Nom &option) const override
OBS_PTR(Domaine_VEF) le_dom_vef
int impr(Sortie &os) const override
DOES NOTHING - to override in derived classes.
void associer(const Domaine_dis_base &, const Domaine_Cl_dis_base &, const Champ_Inc_base &) override
virtual void remplir_nu(DoubleTab &) const
double calculer_dt_stab() const override
Computes dt_stab.
int impr(Sortie &, const Operateur_base &) const
Print the face fluxes of a VEF operator (e.g. diffusion, convection).
Operateur_Diff_base This class is the base of the hierarchy of operators representing.
virtual const Champ_base & diffusivite() const =0
virtual const Champ_base & diffusivite_pour_pas_de_temps() const
Returns the field corresponding to the true diffusivity of the medium used for the time step computat...
static double mp_min(double)
static double mp_max(double)
Base class for output streams.
virtual const Champ_base & get_champ_masse_volumique() const
Returns the density field.
virtual int has_champ_masse_volumique() const
Returns 1 if the density field has been associated, 0 otherwise.
_SIZE_ size_array() const
TRUSTArray & inject_array(const TRUSTArray &source, _SIZE_ nb_elements=-1, _SIZE_ first_element_dest=0, _SIZE_ first_element_source=0)
void resize(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
_SIZE_ dimension_tot(int) const override
std::enable_if_t< is_default_exec_space< EXEC_SPACE >, View< _TYPE_, _SHAPE_ > > view_rw()
_SIZE_ dimension(int d) const
virtual const MD_Vector & get_md_vector() const