16#include <Synonyme_info.h>
17#include <Objet_U_ptr.h>
31 else os <<
"vide" << finl;
42 if (nom_type !=
"vide")
44 objet =
typer(nom_type);
49 if (objet) is >> (*objet);
79 assert(ptr !=
nullptr);
96 if (cle_ != -1 || ptr_object_id_ != -1)
101 if (
id == ptr_object_id_)
105 Cerr <<
"(PE" <<
me() <<
") ";
106 Cerr <<
"Error in Objet_U_ptr::get_Objet_U_ptr_check() : id != ptr_object_id_\n";
107 Cerr <<
" Pointer type " <<
le_type();
108 Cerr <<
"\n cle_ = " << cle_;
109 Cerr <<
"\n ptr_object_id_ = " << ptr_object_id_;
110 Cerr <<
"\n id = " << id;
111 std::cerr <<
"\n &la_memoire().objet_u(cle_) = " << addr << std::endl;
125 if (ptr ==
nullptr)
return 1;
134 if (! type_info_ptr.
can_cast(&type_info_obj))
136 Cerr <<
"(PE" <<
me() <<
") ";
137 Cerr <<
"Error in Objet_U_ptr::get_Objet_U_ptr_check() : Type error\n";
138 Cerr <<
" Pointer type " <<
le_type();
139 Cerr <<
"\n cle_ = " << cle_;
140 Cerr <<
"\n ptr_object_id_ = " << ptr_object_id_;
141 std::cerr <<
"\n &memoire.objet_u(cle_) = " << ptr;
142 Cerr <<
"\n Type accepted by the pointer : " << type_info_ptr.
name();
143 Cerr <<
"\n Object type in reference : " << type_info_obj.
name();
163 cle_ = new_ones[cle_];
192 objet = & memoire.
objet_u(cle_);
240 Cerr <<
"Error in Deriv_::typer_(const char* const type)" << finl << type <<
" is not a type." << finl;
241 Cerr <<
"Type required : derived from " << type_base.
name() << finl << finl;
242 Cerr << type <<
" is not a recognized keyword." << finl <<
"Check your data set." << finl;
244 if (nompb.
find(
"TURBULENT") != -1 || nompb.
find(
"TURBULENCE") != -1)
245 Cerr << finl <<
"*** NOTE :: Since TRUST V1.8.0, turbulence models are in TrioCFD and not anymore in TRUST.\nTry using TrioCFD executable or contact TRUST support." << finl;
251 Cerr <<
"Error in Deriv_::typer_(const char* const type).\n" << type <<
" is not instanciable." << finl;
255 if (! type_info->
has_base(&type_base))
256 Cerr <<
"Error in Deriv_::typer_(const char* const type).\n " << type <<
" is not a subtype of " << type_base.
name() << finl;
Class defining operators and methods for all reading operation in an input flow (file,...
Objet_U & objet_u(int)
Returns a reference to the Objet_U at index num in memory.
static Memoire & Instance()
Returns a pointer to the memory instance. Creates a new memory object if no instance has been created...
class Nom: a character string for naming TRUST objects.
virtual int find(const char *const n) const
int associer_(Objet_U &objet) override
Associates the Objet_U with another Objet_U. Virtual method to override.
int change_num(const int *const) override
Updates keys when Objet_U objects have been renumbered.
Objet_U * get_Objet_U_ptr_check() const
Checks if the pointer is valid.
virtual void set_Objet_U_ptr(Objet_U *)
Makes *this point to the object *ptr. The address may be null (null pointer).
void recopie(const Objet_U &)
Duplicates the Objet_U obj and then changes the pointer to this copy.
int check_Objet_U_ptr_type(const Objet_U *ptr) const
Verifies that the object pointed to by ptr is of an acceptable type for the pointer (via get_info_ptr...
~Objet_U_ptr() override
Destructor.
Objet_U_ptr()
Builds a null pointer (key set to -1).
Objet_U * typer(const char *nom_type)
Tries to create an instance of type "type".
virtual Objet_U * get_Objet_U_ptr() const
Returns a pointer to the associated Objet_U. WARNING: the address may be null (if the pointer is null...
virtual const Type_info & get_info_ptr() const =0
Base class for TRUST objects (Objet_U).
virtual int duplique() const =0
virtual int associer_(Objet_U &)
Associates the Objet_U with another Objet_U. Virtual method to override.
int numero() const
Returns the index of the object in Memoire::data.
virtual Entree & readOn(Entree &)
Reads an Objet_U from an input stream. Virtual method to override.
virtual int change_num(const int *const)
Changes the internal number of the Objet_U.
const char * le_type() const
Returns the type name of the Objet_U.
Objet_U()
Default constructor: assigns a unique identifier to the object (object_id_) and registers the object ...
int get_object_id() const
Returns the unique identifier of the object (object_id_).
virtual const Type_info * get_info() const
Returns type information for the Objet_U.
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
static int me()
Returns the rank of the local processor in the current communication group. See Comm_Group::rank() an...
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Base class for output streams.
Models synonym information for Objet_U objects.
static const Synonyme_info * synonyme_info_from_name(const char *synonyme_name)
Static method that returns a pointer to the Synonyme_info whose name is "synonyme_name".
const char * org_name_() const
Models type information for Objet_U objects.
int instanciable() const
Returns 1 if the associated type is instantiable (cree_instance is non-null), 0 otherwise.
Objet_U * instance() const
Creates an instance of the class associated with the type_info.
int has_base(const Type_info *p, int direct=0) const
Tests whether a type belongs to the base types of the considered type. If direct == 0,...
int can_cast(const Type_info *p) const
Traverses the type hierarchy. Returns 1 if p points to a subtype of the current type.
static const Type_info * type_info_from_name(const char *type_name)
Static method that returns a pointer to the Type_info whose name is "type_name".