16#include <Octree_Double.h>
17#include <Probleme_base.h>
20#include <Equation_base.h>
22#include <Domaine_VF.h>
26OBS_PTR(
Debog_Pb) Debog_Pb::instance_debog_;
63 Cerr <<
"Error found in Debog_Pb (see debog.log files)" << finl;
84 param.dictionnaire(
"write", 0);
85 param.dictionnaire(
"read", 1);
87 param.lire_avec_accolades(is);
92 Cerr <<
"Error in Debog::interpreter: " << obj <<
" is not a Problem_base object" << finl;
96 Probleme_base& pb = ref_cast(Probleme_base, obj);
118 instance_debog_ = *
this;
146 while (dummy !=
"msg");
151 Cerr <<
"Error in Debog_Pb::goto_msg(" << msg <<
")\n invalid data in DEBOG file" << finl;
159 Cerr <<
"Error in Debog_Pb::goto_msg(" << msg <<
")\n invalid data in DEBOG file" << finl;
166 if (dummy ==
"FinMsg")
175 log_file_ <<
"Skipping message " << n <<
" (looking for " << msg <<
")" << finl;
188 Cerr <<
"Error in Debog.cpp: cannot write geometry data in parallel." << finl;
191 const Domaine& dom = ref_pb_->domaine();
205 if (zvf.
xa().dimension(0) > 0)
229 Octree_Double octree;
239 Cerr <<
"Internal error in Debog::add_renum_item: coordinate array does not match md descriptor" << finl;
243 ArrOfDouble center(dim);
247 for (
int i = 0; i < n; i++)
249 for (
int j = 0; j < dim; j++)
250 center[j] = coord_par(i,j);
258 Cerr <<
"Debog::add_renum_item: Error. Id=" <<
id
259 <<
"\n Item " << i <<
" with following coordinates was found " << k <<
" times within epsilon=" << epsilon <<
" in the reference geometry: " << center << finl;
262 Cerr <<
"If you want to discard nodes comparison in the mesh, add 'noeuds_doubles_ignores 1' option in debog_pb keyword." << finl;
267 Cerr <<
"Warning, this item will be ignored during the comparison..." << finl;
274 renum[i] = elements[0];
281 const Domaine& dom = ref_pb_->domaine();
285 DoubleTab coord_som_seq;
290 ArrOfInt liste_procs(1);
298 const Elem_geom_base& elem = dom_seq.type_elem().valeur();
306 envoyer_broadcast(coord_som_seq, 0);
309 envoyer_broadcast(xp_seq, 0);
315 const DoubleTab& xp = zvf.
xp();
347 envoyer_broadcast(xv_seq, 0);
348 const DoubleTab& xv = zvf.
xv();
352 envoyer_broadcast(avec_aretes, 0);
355 envoyer_broadcast(xa_seq, 0);
356 const DoubleTab& xa = zvf.
xa();
363enum Debog_Exceptions { RENUM_ARRAY_NOT_FOUND };
368 for (
int i = 0; i < n; i++)
377 Cerr <<
"Error, we don't find renum_vector for the array on item: "<<
id << finl;
378 throw RENUM_ARRAY_NOT_FOUND;
397 DoubleVect vecteur_i;
405 if (nbc0 > std::numeric_limits<int>::max())
406 Process::exit(
"Debog_Pb::verifier_matrice() - total number of items too big!");
407 const int nb_colonnes =
static_cast<int>(nbc0);
409 for (
int i = 0; i < nb_colonnes; i++)
425 for (
int j = 0; j < sz; j++)
427 if (renum_colonnes[j] == i)
435 vecteur_i[renum_i] = 1.;
438 msg2 +=
" produit avec base ";
442 vecteur_i[renum_i] = 0.;
452 for (i = 0; i < n; i++)
459 Cerr <<
"Error in Debog_Pb::verifier_Mat_elems no registered MD_Vector for ELEM type" << finl;
482 Nom nom_pb, nom_fic, nom_fic_faces, seuil;
485 is >> nom_fic >> nom_fic_faces >> seuil >> mode_db;
487 Nom n(
"Debog_pb debog Lire debog { nom_pb ");
489 n +=
" fichier_domaine ";
491 n +=
" fichier_faces ";
493 n +=
" fichier_debog DEBOG";
494 n +=
" seuil_absolu ";
496 n +=
" seuil_relatif ";
499 if (mode_db == 0) n +=
"write";
503 if (
je_suis_maitre()) Cerr <<
"Debog_Pb_Wrapper: convert to new syntax: " << finl << n << finl;
: This class describes a group of processors on which
Entree & interpreter(Entree &is) override
SFichier write_debog_data_file_
void add_renum_item(const DoubleTab &coord_ref, const DoubleTab &coord_par, const MD_Vector &md, const Nom &id)
int noeuds_doubles_ignores_
void verifier_Mat_elems(const char *const msg, const Matrice_Base &la_matrice)
const IntVect & find_renum_vector(const MD_Vector &, Nom &id) const
void goto_msg(const char *const msg)
void verifier_matrice(const char *const msg, const Matrice_Base &, const MD_Vector &md_lignes, const MD_Vector &md_colonnes)
md_lignes: descriptor of row indices (i.e. descriptor of vector b in A*x=b) md_colonnes: same,...
EFichier debog_data_file_
EcrFicCollecte detailed_log_file_
void register_item(const MD_Vector &md, const Nom &id)
void error_function()
Method called as soon as an error is found in real space.
void set_nom_pb_actuel(const Nom &nom)
std::enable_if_t<(std::is_convertible< _TYPE_, double >::value)||(std::is_convertible< _TYPE_, int >::value), void > verifier(const char *const msg, _TYPE_, _TYPE_ *refvalue=0)
void write_geometry_data()
void read_geometry_data()
int test_ignore_msg(const char *const msg)
virtual const MD_Vector & md_vector_sommets() const
const DoubleTab_t & coord_sommets() const
virtual const MD_Vector & md_vector_elements() const
Returns the parallel descriptor of element arrays of the domain.
const MD_Vector & md_vector_faces() const
const MD_Vector & md_vector_aretes() const
double xa(int num_arete, int k) const
double xv(int num_face, int k) const
int elem_faces(int i, int j) const
Returns the index of the i-th face of element num_elem; the face numbering convention is.
double xp(int num_elem, int k) const
int face_voisins(int num_face, int i) const
Returns the neighbouring element of num_face in direction i.
class Domaine_dis_base This class is the base of the hierarchy of discretized domains.
An input stream whose source is a character string.
File for reading. This class is to the C++ ifstream class what the Entree class is to the.
virtual void calculer_centres_gravite(DoubleTab_t &) const
Compute all centers of mass of all elements in the domain.
Class defining operators and methods for all reading operation in an input flow (file,...
virtual void set_error_action(Error_Action)
Changes the error behaviour of the input; see error_handle_() and get_error_action().
Entree & interpreter_bloc(Entree &is, Bloc_Type bloc_type, int verifier_sans_interpreter)
Interprets a block of instructions read from input is.
static Interprete_bloc & interprete_courant()
Returns the Interprete_bloc currently being read from the data set.
Base class for "interpreter" objects.
static Objet_U & objet(const Nom &)
See Interprete_bloc::objet_global(). BM: the Interprete class is not the best place for this.
virtual trustIdType nb_items_seq_tot() const
: This class is an OWN_PTR but the pointed object is shared among multiple
Matrice_Base class - Base class of the matrix hierarchy.
virtual DoubleVect & multvect(const DoubleVect &, DoubleVect &) const
Multiplication of a vector by the matrix.
class Nom: a character string for naming TRUST objects.
virtual int finit_par(const char *const n) const
virtual int debute_par(const char *const n) const
Nom & prefix(const char *const)
Nom & suffix(const char *const)
Suffix extraction: Nom x("azerty");.
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.
static double precision_geom
virtual Sortie & printOn(Sortie &) const
Writes the object to an output stream. Virtual method to override.
static int_t search_nodes_close_to(double x, double y, double z, const DoubleTab_t &coords, ArrOfInt_t &node_list, double epsilon)
Non-member method. Searches among the vertices in node_list for those within a distance.
void build_nodes(const DoubleTab_t &coords, const bool include_virtual, const double epsilon=0.)
builds an octree containing the points with coordinates coords.
int_t search_elements_box(double xmin, double ymin, double zmin, double xmax, double ymax, double zmax, ArrOfInt_t &elements) const
searches for all elements or points potentially having a non-empty intersection with the given box.
static int enter_group(const Comm_Group &group)
If the local processor belongs to the group, the current group for this processor becomes "group" and...
static void create_group(const ArrOfInt &liste_pe, OWN_PTR(Comm_Group) &group, int force_Comm_Group_NoParallel=0)
Creates a new processor group (can be called anywhere in the code).
static void exit_group()
Returns to the group that was active before the last successful enter_group() call (which returned 1)...
Helper class to factorize the readOn method of Objet_U classes.
class Probleme_base It is a Probleme_U that is not a coupling.
static bool is_parallel()
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
static int je_suis_maitre()
Returns 1 if on the master processor of the current group (i.e. me() == 0), 0 otherwise.
SFichier is to the C++ ofstream class what Sortie is to the C++ ostream class.
void precision(int pre) override
Base class for output streams.
_SIZE_ size_array() const
void set_md_vector(const MD_Vector &) override
_SIZE_ dimension_tot(int) const override
_SIZE_ dimension(int d) const
_SIZE_ size_totale() const
virtual const MD_Vector & get_md_vector() const