16#include <Reordonner_faces_periodiques.h>
17#include <Domaine_Cl_dis_base.h>
19#include <Domaine_VF.h>
20#include <Periodique.h>
35 le_champ_front.typer(
"Champ_front_uniforme");
42 Cerr <<
"Initialization for periodic on " << frontiere.
le_nom() << finl;
54 for (i = 0; i < dim; i++)
66 Cerr <<
"Periodic direction not aligned on an axis" << finl;
68 Cerr <<
"Periodic direction aligned on the axis " <<
direction_xyz_ << finl;
70 const Domaine& domaine = frontiere.
domaine();
73 IntTab tab_face_associee;
76 tab_face_associee = -1;
79 const int nb_faces = frontiere.
nb_faces();
80 const int nb_faces_2_ = nb_faces / 2;
82 const int nb_faces_virt = faces_virt.
size_array();
87 for (i = 0; i < nb_faces_2_; i++)
89 const int i1 = i_premiere_face + i;
90 const int i2 = i_premiere_face + i + nb_faces_2_;
91 tab_face_associee[i1] = i2;
92 tab_face_associee[i2] = i1;
99 const ArrOfInt& ind_faces_virt_bord = domaine.ind_faces_virt_bord();
102 const int nb_faces_front_tot = tab_face_associee.
size_totale();
103 ArrOfInt index(nb_faces_front_tot);
106 for (i = 0; i < nb_faces_virt; i++)
108 const int face_domaine = frontiere.
face_virt(i);
109 const int face_front = ind_faces_virt_bord[face_domaine - nb_faces_domaine];
110 index[face_front] = nb_faces + i;
115 for (i = 0; i < nb_faces + nb_faces_virt; i++)
119 resu = i + nb_faces_2_;
120 else if (i < nb_faces)
121 resu = i - nb_faces_2_;
125 const int face_domaine = frontiere.
face_virt(i - nb_faces);
126 const int face_front = ind_faces_virt_bord[face_domaine - nb_faces_domaine];
128 const int face_front_associee = tab_face_associee[face_front];
129 if (face_front_associee >= 0)
132 const int face_asso = index[face_front_associee];
133 assert(face_asso >= 0);
139 Cerr <<
"Error in Periodique::completer()" << finl;
151 Cerr <<
"Error in Periodique::direction_periodicite():\n" <<
" An algorithm seems to assume that the periodic direction is aligned in X, Y or Z\n" <<
" and this is not the case !" << finl;
class Cond_lim_base Base class for the hierarchy of classes that represent the different boundary con...
Domaine_Cl_dis_base & domaine_Cl_dis()
Returns the domain of discretized boundary conditions to which the object belongs.
virtual Frontiere_dis_base & frontiere_dis()
Returns the discretized boundary to which the boundary conditions apply.
Domaine_dis_base & domaine_dis()
Returns a reference to the discretized domain associated with the boundary conditions.
void creer_tableau_faces_bord(Array_base &, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT) const
virtual IntTab & face_sommets()
Class defining operators and methods for all reading operation in an input flow (file,...
const ArrOfInt_t & get_faces_virt() const
const Domaine_t & domaine() const
Returns the domain associated with the boundary (const version).
int_t face_virt(int_t i) const
int_t num_premiere_face() const
const Nom & le_nom() const override
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
int_t nb_faces() const
Returns the number of faces of the boundary.
const Frontiere & frontiere() const
Returns the associated geometric boundary.
: This class is an OWN_PTR but the pointed object is shared among multiple
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.
class Periodique This class represents a periodic boundary condition.
void completer() override
DOES NOTHING must be overridden in derived classes.
ArrOfDouble direction_perio_
int est_periodique_selon_un_axe() const
ArrOfInt face_front_associee_
int direction_periodicite() const
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
static int check_faces_periodiques(const Frontiere_32_64< int > &frontiere, ArrOfDouble &vecteur_delta, ArrOfDouble &erreur, bool verbose=false)
static void construire_espace_virtuel_traduction(const MD_Vector &md_indice, const MD_Vector &md_valeur, IntTab &tableau, const int error_is_fatal=1)
Builds the items_communs + virtual space structure of an array containing indices of geometric items,...
Base class for output streams.
_SIZE_ size_array() const
_SIZE_ dimension(int d) const
_SIZE_ size_totale() const
virtual const MD_Vector & get_md_vector() const