40 param.ajouter_non_std(
"velocity_shape_IBM_function",(
this),
Param::OPTIONAL);
53 param.ajouter_flag(
"local",&
local_);
57 param.ajouter_non_std(
"vitesse_imposee_fonction",(
this),
Param::OPTIONAL);
61 param.ajouter_non_std(
"variable_imposee_fonction",(
this),
Param::OPTIONAL);
63 param.lire_avec_accolades_depuis(is);
66 Cerr <<
"PDF_model: you must specify either 'variable(vitesse)_imposee_data' or 'variable(vitesse)_imposee_fonction'" << finl;
75 Cerr <<
" PDF_model is reading imposed variable... " << finl;
76 if (un_mot ==
"variable_imposee_fonction" || un_mot ==
"vitesse_imposee_fonction")
85 std::string sx(expr_vit_imp);
86 std::transform(sx.begin(), sx.end(), sx.begin(), ::toupper);
87 parsers_[i].setString(sx);
88 parsers_[i].setNbVar(4);
89 parsers_[i].addVar(
"x");
90 parsers_[i].addVar(
"y");
91 parsers_[i].addVar(
"z");
92 parsers_[i].addVar(
"t");
93 parsers_[i].parseString();
96 else if (un_mot ==
"variable_imposee_data" || un_mot ==
"vitesse_imposee_data")
99 is >> variable_imposee_lu_;
100 dim_variable_ = variable_imposee_lu_->valeurs().dimension(1);
102 else if (un_mot ==
"velocity_shape_IBM_function")
108 int dim_vitesse_shape;
109 is >> dim_vitesse_shape;
111 parsers_vitesse_shape_.dimensionner(dim_vitesse_shape);
112 for (
int i = 0; i < dim_vitesse_shape; i++)
114 is >> expr_vit_shape;
115 std::string sx(expr_vit_shape);
116 std::transform(sx.begin(), sx.end(), sx.begin(), ::toupper);
117 parsers_vitesse_shape_[i].setString(sx);
118 parsers_vitesse_shape_[i].setNbVar(4);
119 parsers_vitesse_shape_[i].addVar(
"x");
120 parsers_vitesse_shape_[i].addVar(
"y");
121 parsers_vitesse_shape_[i].addVar(
"z");
122 parsers_vitesse_shape_[i].addVar(
"t");
123 parsers_vitesse_shape_[i].parseString();
128 Cerr <<
"PDF_model: token not understood: " << un_mot << finl;
132 if (un_mot ==
"vitesse_imposee_fonction" || un_mot ==
"vitesse_imposee_data")
136 Cerr <<
"PDF_model for a vector: Objet_U::dimension != dim_variable_: " <<
dim_variable_ << finl;
140 Cerr <<
" imposed variable dimension = " <<
dim_variable_ << finl;
143 Cerr <<
"PDF_model with local system for a vector only (Objet_U::dimension != dim_variable_) = " <<
dim_variable_ << finl;
153 Noms nom_c11(nb_comp);
154 Noms unites11(nb_comp);
156 vitesse_shape_IBM_->valeurs() = 0.;
166 DoubleTab& variable_imposee_ref = variable_imposee_->valeurs();
172 for (
int i = 0; i < nb_som_tot; i++)
174 for (
int j = 0; j < dim; j++)
187 Cerr << __FILE__ <<
", line " << (int)__LINE__ <<
" : Unexpected error." << finl;
195 const Domaine& le_dom = le_dom_VF.
domaine();
198 const IntTab& elems = le_dom.
les_elems() ;
200 DoubleTab& vitesse_depl_ref = vitesse_shape_IBM_->valeurs();
205 for (
int elem = 0; elem < nb_elem_tot; elem++)
207 for (
int k = 0; k < dim; k++)
210 for (
int nod=0; nod<nb_som_elem; nod++)
212 int nod_glob = elems(elem, nod);
213 x[k] += coords(nod_glob,k) / nb_som_elem;
217 for (
int k = 0; k < dim; k++)
219 for (
int i = 0; i < dim; i++) parsers_vitesse_shape_[k].setVar(i,x[i]);
220 parsers_vitesse_shape_[k].setVar(3, temps);
221 vitesse_depl_ref(elem,k) = parsers_vitesse_shape_[k].eval();
230 for (
int i = 0; i < dim; i++)
232 parsers_[comp].setVar(i,x[i]);
234 return parsers_[comp].eval();
void discretiser_champ(const Motcle &directive, const Domaine_dis_base &z, const Nom &nom, const Nom &unite, int nb_comp, int nb_pas_dt, double temps, OWN_PTR(Champ_Inc_base)&champ, const Nom &sous_type=NOM_VIDE) const
int nb_som_elem() const
Returns the number of vertices of the geometric elements that make up the domain.
int_t nb_elem_tot() const
const Domaine & domaine() const
Class defining operators and methods for all reading operation in an input flow (file,...
A character string (Nom) in uppercase.
class Nom: a character string for naming TRUST objects.
An array of character strings (VECT(Nom)).
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.
double get_variable_imposee(ArrOfDouble &, int)
void affecter_vitesse_shape_IBM(Domaine_VF &, const DoubleTab &, double)
bool use_pseudo_level_set_moving_PDF_
void discretiser_vitesse_shape_IBM(const Probleme_base &)
int type_variable_imposee_
void affecter_variable_imposee(Domaine_VF &, const DoubleTab &)
int lire_motcle_non_standard(const Motcle &, Entree &) override
Reads non-simple-type parameters of an Objet_U from an input stream.
class Probleme_base It is a Probleme_U that is not a coupling.
const Discretisation_base & discretisation() const
Returns the discretization associated with the problem.
const Domaine_dis_base & domaine_dis() const
Returns the discretized domain associated with the problem (const version).
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Base class for output streams.