16#include <Champ_Generique_Interpolation.h>
17#include <Champ_Generique_Extraction.h>
18#include <Champ_Generique_refChamp.h>
19#include <Champ_front_uniforme.h>
20#include <Domaine_Cl_dis_base.h>
21#include <Discretisation_base.h>
22#include <Dirichlet_homogene.h>
23#include <Domaine_dis_cache.h>
24#include <Equation_base.h>
25#include <NettoieNoeuds.h>
26#include <Postraitement.h>
27#include <Synonyme_info.h>
28#include <TRUST_Deriv.h>
29#include <Domaine_VF.h>
52 Cerr <<
"Error in Champ_Generique_Extraction::readOn\n"
53 <<
" You must specify exactly 1 \"Source\"." << finl;
84 directive =
"champ_elem";
96 espace_stockage = creer_espace_stockage(nature_source,
nb_comp,es_tmp);
97 return espace_stockage;
109 const DoubleTab& source_valeurs = source_stockage.
valeurs();
111 const Nature_du_champ& nature_source = source_stockage.
nature_du_champ();
121 Cerr<<
"A boundary condition of type Dirichlet homogeneous does not use field boundary"<<finl;
122 Cerr<<
"The extraction of field "<<source_stockage.
le_nom()<<
" with the option champ_frontiere"<<finl;
123 Cerr<<
"is therefore not possible for this type of boundary condition"<<finl;
124 Cerr<<
"You can possibly remove the option champ_frontiere for postprocess the trace of the field"<<finl;
133 int nb_comp_source = source_stockage.
nb_comp();
136 Nom type_espace_stockage, disc;
148 Cerr<<
"Champ_Generique_Extraction::get_champ()"<<finl;
149 Cerr<<
"We do not recognize the type of area discretized"<<domaine_dis_source.
que_suis_je()<<finl;
153 type_espace_stockage =
"Champ_Fonc_P0_";
154 type_espace_stockage += disc;
165 const Frontiere& la_frontiere = fr_dis.
frontiere();
170 espace_stockage.typer(type_espace_stockage);
176 DoubleTab& espace_valeurs = espace_stockage->
valeurs();
177 const int N = source_valeurs.
line_size();
182 source_stockage.
trace(fr_dis,espace_valeurs,temps,0);
184 else if (
methode_==
"champ_frontiere")
192 for (
int j = 0; j < N; j++)
193 for (
int i=0; i<nb_ddl; i++)
194 espace_valeurs(i,j) = champ_fr.
valeurs()(0,j);
197 espace_valeurs = champ_fr.
valeurs();
203 return espace_stockage;
210 motcles[0] =
"composantes";
211 int rang = motcles.
search(query);
218 int nb_comp = source_compos.size();
240 Nom nom_post_source, nom_champ_source;
242 nom_champ_source = nom[0];
243 nom_post_source =
"Extraction_";
244 nom_post_source += nom_champ_source;
258 if (!sub_type(Domaine, ob))
260 Cerr <<
"Error in Champ_Generique_Extraction:get_champ"<<finl;
261 Cerr<<
"We do not retrieve domain"<<finl;
264 domaine_ = ref_cast(Domaine,ob);
275 Cerr<<
"The method "<<
methode_<<
" can be applied to extract only unknown fields of the problem."<<finl;
276 Cerr<<
"The field to extract "<<source_stockage.
le_nom()<<
" do not satisfied this requirement."<<finl;
283 Cerr<<
"The method "<<
methode_<<
" can be applied to extract only unknown fields of the problem."<<finl;
284 Cerr<<
"The source of the post-processing field "<<nom_champ[0]<<
" do not encapsulate an unknown field."<<finl;
291 if (dom==domaine_.valeur())
293 Cerr<<
"Error in Champ_Generique_Extraction:get_champ"<<finl;
294 Cerr<<
"The domain is the same as the source's domain."<<finl;
302 Cerr <<
"You can't extract a field onto a boundary of the domain " << dom.
le_nom() << finl;
303 Cerr <<
"because there is NO boundaries defined on it." << finl;
306 Cerr <<
"It is not possible to extract on a boundary a field interpolated other than the calculation domain." << finl;
307 Cerr <<
"So, change the domain in Interpolation definition into domain " << ref_cast(
Champ_Generique_Interpolation,source).get_source(0).get_ref_domain().le_nom() << finl;
312 const Frontiere& la_frontiere = fr_dis.
frontiere();
313 const Type_Face type_face_source = la_frontiere.
faces().
type_face();
314 int nb_faces = la_frontiere.
nb_faces();
316 const DoubleTab& sommets_source = dom.
les_sommets();
318 Entity index1,index2;
319 index1 = Entity::FACE;
320 index2 = Entity::NODE;
325 if (type_face_source==Type_Face::segment_2D || type_face_source==Type_Face::segment_2D_axi)
326 type_elem =
"Segment";
327 else if (type_face_source==Type_Face::quadrilatere_2D_axi)
328 type_elem =
"Segment";
329 else if (type_face_source==Type_Face::quadrangle_3D)
330 type_elem =
"Quadrangle";
331 else if (type_face_source==Type_Face::triangle_3D)
332 type_elem =
"Triangle";
333 else if (type_face_source==Type_Face::point_1D)
336 else if ((type_face_source==Type_Face::vide_0D) && (nb_faces==0))
339 type_elem =
"Rectangle";
341 type_elem =
"Triangle";
344 Cerr<<
"The type of domaine discretized"<<zvf_source.
que_suis_je()<<
" is not recognized"<<finl;
350 Cerr<<
"The type of faces of the boundary name "<<
nom_fr_<<
" is neither type Type_Face::quadrangle_3D nor Type_Face::triangle_3D"<<finl;
351 Cerr<<
"We do not realize the extraction"<<finl;
356 if (domaine_->nb_som()!=0)
358 if (domaine_->les_elems().dimension(0) != nb_faces ||
359 domaine_->les_elems().dimension(1) != nb_som_faces)
361 Cerr <<
"Error when extracting the field " <<
nom_post_ <<
": The " << domaine_->le_nom() <<
" domain can't be used cause already built with different support !" << finl;
362 Cerr <<
"You could create an empty domain with no operations on it before extracting this field." << finl;
366 domaine_->typer(type_elem);
368 IntTab& mes_elems_domaine = domaine_->les_elems();
369 mes_elems_domaine.
reset();
370 mes_elems_domaine.
resize(nb_faces, nb_som_faces);
373 domaine_->les_sommets().reset();
374 domaine_->les_sommets() = sommets_source;
375 for (
int face = 0; face < nb_faces; face++)
376 for (
int s = 0; s < nb_som_faces; s++)
377 mes_elems_domaine(face, s) = face_sommets(num_premiere_face + face, s);
387 return domaine_.valeur();
390 Cerr<<
"There is no extraction domain created to this Champ_Generique_Extraction"<<finl;
406 return le_dom_dis.valeur();
409 Cerr<<
"There is no domain associated to this Champ_Generique_Extraction"<<finl;
419 loc = Entity::ELEMENT;
434 if (type_discr ==
"VEFPreP1B") type_discr =
"VEF";
435 Nom type =
"NO_FACE_Domaine_";
class Champ_Fonc_base Base class of fields that are functions of a calculated quantity
Base class of generic fields having other generic fields as source. The use of the class methods reli...
virtual int get_nb_sources() const
const Noms get_property(const Motcle &query) const override
Returns the requested property.
virtual OWN_PTR(Champ_Fonc_base) &creer_espace_stockage(const Nature_du_champ &nature
void completer(const Postraitement_base &post) override
const Probleme_base & get_ref_pb_base() const override
Returns the problem that carries the target field.
virtual const Champ_Generique_base & get_source(int i) const
void set_param(Param ¶m) const override
virtual const int nb_comp
A generic field constructed as an interpolation of another generic field (interpolation at vertices o...
class Champ_Generique_base
virtual const Noms get_property(const Motcle &query) const
Returns the requested property.
virtual const Domaine_dis_base & get_ref_domaine_dis_base() const
Returns a ref to the discretized domain on which the storage space will be evaluated.
virtual const IntTab & get_ref_connectivity(Entity index1, Entity index2) const
Returns the connectivity array between the geometric entity index1 and entity index2.
virtual const Champ_base & get_champ(OWN_PTR(Champ_base) &espace_stockage) const =0
virtual double get_time() const
Returns the time of the Champ_Generique_base.
virtual const Champ_base & get_champ_without_evaluation(OWN_PTR(Champ_base)&espace_stockage) const =0
void nommer(const Nom &nom) override
Assigns a name to the Objet_U. Virtual method to override.
virtual const Domaine & get_ref_domain() const
Returns a ref to the domain on which the storage space will be evaluated.
virtual const Discretisation_base & get_discretisation() const
Returns the discretization associated with the problem.
Special field class that encapsulates a reference to a volume field of TRUST of type Champ_base.
virtual DoubleTab & valeurs()=0
class Champ_base This class is the base of the fields hierarchy.
virtual DoubleTab & trace(const Frontiere_dis_base &, DoubleTab &, double, int distant) const
Computes the trace of a field on a boundary at time tps.
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 Generic class used to represent any class
Classe Dirichlet_homogene This class is the base class of the hierarchy of homogeneous Dirichlet-type...
class Discretisation_base This class represents a spatial discretization scheme, which
virtual bool is_ef() const
virtual bool is_vdf() const
virtual bool is_vef() const
DoubleTab_t & les_sommets()
const Cond_lim & les_conditions_limites(int) const
Returns the i-th boundary condition.
int nb_frontiere_dis() const
int nb_som_face() const
Returns the number of vertices per face.
const Nom & le_nom() const override
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
const Frontiere_dis_base & frontiere_dis(const Nom &) const
Returns the boundary of Name nom.
int rang_frontiere(const Nom &)
static Domaine_dis_base & Build_or_get(const Nom &type, const Domaine &dom, const Discretisation_base *disc=nullptr)
Class defining operators and methods for all reading operation in an input flow (file,...
virtual Domaine_Cl_dis_base & domaine_Cl_dis()
Returns the discretized boundary condition domain associated with the equation.
Type_Face type_face() const
virtual void fixer_nb_comp(int i)
Sets the number of components of the field.
const Nom & le_nom() const override
Returns the name of the field.
virtual Nature_du_champ fixer_nature_du_champ(Nature_du_champ nat)
Sets the nature of a field: scalar, multiscalar, vectorial.
virtual int nb_comp() const
virtual Nature_du_champ nature_du_champ() const
int_t num_premiere_face() const
int_t nb_faces() const
Returns the number of faces of the boundary.
const Faces_t & faces() const
class Frontiere_dis_base Class representing a discretized boundary.
const Frontiere & frontiere() const
Returns the associated geometric boundary.
static Objet_U & objet(const Nom &)
See Interprete_bloc::objet_global(). BM: the Interprete class is not the best place for this.
const Equation_base & equation() const
Returns the reference to the equation pointed to by MorEqn::mon_equation.
A character string (Nom) in uppercase.
An array of Motcle objects.
int search(const Motcle &t) const
static void nettoie(Domaine_t &)
class Nom: a character string for naming TRUST objects.
An array of character strings (VECT(Nom)).
const Interprete & interprete() const
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.
Objet_U()
Default constructor: assigns a unique identifier to the object (object_id_) and registers the object ...
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
Helper class to factorize the readOn method of Objet_U classes.
void ajouter(const char *keyword, const int *value, Param::Nature nat=Param::OPTIONAL)
Register an integer parameter.
Base class for all post-processing objects.
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.
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Base class for output streams.
void resize(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)