16#include <Connectivite_som_elem.h>
17#include <Static_Int_Lists.h>
18#include <Faces_builder.h>
19#include <Extruder_en3.h>
24Implemente_instanciable_sans_constructeur(
Extruder_en3,
"Extruder_en3",Interprete_geometrique_base);
36 direction_.resize(3,RESIZE_OPTIONS::NOCOPY_NOINIT);
59 Cerr <<
" We only can extruder_en3 the 2D meshes ! " << finl;
74 nb_dom=noms_dom.size();
86 for(
int i=0; i<nb_dom; i++)
113 int oldnbsom = dom.
nb_som();
123 Type_Face type_face = dom.type_elem()->type_face(0);
124 les_faces.
typer(type_face);
127 Static_Int_Lists connectivite_som_elem;
128 const IntTab& elements = dom.
les_elems();
131 construire_connectivite_som_elem(nb_sommets_tot,
133 connectivite_som_elem,
136 Faces_builder faces_builder;
139 connectivite_som_elem,
144 int newnbsom = oldnbsom*(
NZ_+1);
145 DoubleTab new_soms(newnbsom, 3);
150 for (
int i=0; i<oldnbsom; i++)
152 double x = coord_sommets(i,0);
153 double y = coord_sommets(i,1);
156 z=coord_sommets(i,2);
157 for (
int k=0; k<=
NZ_; k++)
159 new_soms(k*oldnbsom+i,0)=x;
160 new_soms(k*oldnbsom+i,1)=y;
161 new_soms(k*oldnbsom+i,2)=z;
172 int newnbelem = 3*
NZ_*oldsz;
173 IntTab new_elems(newnbelem, 4);
174 for (
int i=0; i<oldsz; i++)
176 int i1=les_elems(i,0);
177 int i2=les_elems(i,1);
178 int i3=les_elems(i,2);
187 for (
int k=0; k<
NZ_; k++)
190 if (ii1>ii2 && ii1>ii3)
198 new_elems(j+1,0) = i2;
199 new_elems(j+1,1) = i3;
200 new_elems(j+1,2) = i4;
201 new_elems(j+1,3) = i6;
203 new_elems(j+2,0) = i2;
204 new_elems(j+2,1) = i4;
205 new_elems(j+2,2) = i5;
206 new_elems(j+2,3) = i6;
210 new_elems(j+1,0) = i2;
211 new_elems(j+1,1) = i3;
212 new_elems(j+1,2) = i4;
213 new_elems(j+1,3) = i5;
215 new_elems(j+2,0) = i3;
216 new_elems(j+2,1) = i4;
217 new_elems(j+2,2) = i5;
218 new_elems(j+2,3) = i6;
222 if (ii2>ii1 && ii2>ii3)
230 new_elems(j+1,0) = i1;
231 new_elems(j+1,1) = i3;
232 new_elems(j+1,2) = i4;
233 new_elems(j+1,3) = i5;
235 new_elems(j+2,0) = i3;
236 new_elems(j+2,1) = i4;
237 new_elems(j+2,2) = i5;
238 new_elems(j+2,3) = i6;
242 new_elems(j+1,0) = i1;
243 new_elems(j+1,1) = i3;
244 new_elems(j+1,2) = i5;
245 new_elems(j+1,3) = i6;
247 new_elems(j+2,0) = i1;
248 new_elems(j+2,1) = i4;
249 new_elems(j+2,2) = i5;
250 new_elems(j+2,3) = i6;
254 if (ii3>ii1 && ii3>ii2)
262 new_elems(j+1,0) = i1;
263 new_elems(j+1,1) = i2;
264 new_elems(j+1,2) = i5;
265 new_elems(j+1,3) = i6;
267 new_elems(j+2,0) = i1;
268 new_elems(j+2,1) = i4;
269 new_elems(j+2,2) = i5;
270 new_elems(j+2,3) = i6;
274 new_elems(j+1,0) = i1;
275 new_elems(j+1,1) = i2;
276 new_elems(j+1,2) = i4;
277 new_elems(j+1,3) = i6;
279 new_elems(j+2,0) = i2;
280 new_elems(j+2,1) = i4;
281 new_elems(j+2,2) = i5;
282 new_elems(j+2,3) = i6;
297 dom.
typer(
"Tetraedre");
299 les_elems.
ref(new_elems);
303 Cerr <<
"TRUST doesn't know how to extrude " << dom.type_elem()->
que_suis_je() <<
"s"<<finl;
320 Faces& les_faces_du_bord = itr.faces();
327 Faces& les_faces_du_bord = itr->faces();
334 Cerr <<
"We don't associate any boundary to the front of the domain " << dom.
le_nom() << finl;
340 Faces& les_faces_dvt=devant.
faces();
341 les_faces_dvt.
typer(Type_Face::triangle_3D);
343 IntTab som_dvt(oldsz, 3);
347 for (
int i=0; i<oldsz; i++)
349 int i0=les_elems(3*i,0);
350 int i1=les_elems(3*i,1);
351 int i2=les_elems(3*i,2);
363 Cerr <<
"We don't associate any boundary to the back of the domain " << dom.
le_nom() << finl;
367 Bord& derriere = dom.
faces_bord().add(Bord());
369 Faces& les_faces_der=derriere.
faces();
370 les_faces_der.
typer(Type_Face::triangle_3D);
372 IntTab som_der(oldsz, 3);
376 for (
int i=0; i<oldsz; i++)
378 int i0=les_elems(3*i,0);
379 int i1=les_elems(3*i,1);
380 int i2=les_elems(3*i,2);
382 som_der(i,0) = i0+oldnbsom*
NZ_;
383 som_der(i,1) = i1+oldnbsom*
NZ_;
384 som_der(i,2) = i2+oldnbsom*
NZ_;
400 int nb_faces = les_faces_du_bord.
nb_faces();
401 IntTab les_sommets(2*nb_faces*
NZ_,3);
402 for (
int i=0; i<nb_faces; i++)
404 int i0=les_faces_du_bord.
sommet(i,0);
405 int i1=les_faces_du_bord.
sommet(i,1);
408 for (
int k=0; k<
NZ_; k++)
410 int j=2*nb_faces*k+2*i;
414 les_sommets(j,0) = i0;
415 les_sommets(j,1) = i1;
416 les_sommets(j,2) = i0+oldnbsom;
418 les_sommets(j+1,0) = i1;
419 les_sommets(j+1,1) = i0+oldnbsom;
420 les_sommets(j+1,2) = i1+oldnbsom;
424 les_sommets(j,0) = i0;
425 les_sommets(j,1) = i1;
426 les_sommets(j,2) = i1+oldnbsom;
428 les_sommets(j+1,0) = i0;
429 les_sommets(j+1,1) = i0+oldnbsom;
430 les_sommets(j+1,2) = i1+oldnbsom;
437 les_faces_du_bord.
typer(Type_Face::triangle_3D);
440 les_faces_du_bord.
voisins()=-1;
DoubleTab_t & les_sommets()
Raccords_t & faces_raccord()
void typer(const Nom &)
Sets the element type of the domain using the name passed as parameter.
const DoubleTab_t & coord_sommets() const
int_t nb_som_tot() const
Returns the total number of vertices of the domain i.e. the number of real and virtual vertices on th...
int_t nb_som() const
Returns the number of vertices of the domain.
void ajouter(const DoubleTab_t &soms)
Adds nodes (or vertices) to the domain (without checking for duplicates).
const Nom & le_nom() const override
Returns the name of the Objet_U. Virtual method to override: returns "neant" in this implementation.
Class defining operators and methods for all reading operation in an input flow (file,...
Class Extruder_en3 This class is an interpreter that serves to read and execute.
void construire_bord_lateral(Faces &, Faces &, int, const IntVect &)
Creates a lateral boundary.
void extruder(Domaine &, const IntVect &)
Extrudes a surface domain.
void construire_bords(Domaine &, Faces &, int, int, const IntVect &)
Creates the boundaries of the extruded domain.
Entree & interpreter_(Entree &) override
Main function of the Extruder_en3 interpreter.
void typer(const Motcle &)
Sets the type of the faces.
void associer_domaine(const Domaine_t &z)
IntTab_t & voisins()
Returns the array of neighbors (of the faces).
const IntTab_t & les_sommets() const
Returns the array of vertices of all faces.
int_t sommet(int_t, int) const
Returns the number of the j-th vertex of the i-th face.
void creer_faces_reeles(Domaine_t &domaine, const Static_Int_Lists_t &connect_som_elem, Faces_t &les_faces, IntTab_t &elem_faces)
From the description of the domain elements and boundaries (borders, connections, face groups,...
void nommer(const Nom &) override
Gives a name to the boundary.
const Faces_t & faces() const
void mettre_a_jour_sous_domaine(Domaine_t &domaine, int_t &elem, int_t num_premier_elem, int_t nb_elem) const
void associer_domaine(Nom &nom_dom)
Domaine_t & domaine(int i=0)
An array of character strings (VECT(Nom)).
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.
Helper class to factorize the readOn method of Objet_U classes.
void ajouter_arr_size_predefinie(const char *keyword, const ArrOfInt *value, Param::Nature nat=Param::OPTIONAL)
Register an ArrOfInt whose size has already been fixed.
void ajouter(const char *keyword, const int *value, Param::Nature nat=Param::OPTIONAL)
Register an integer parameter.
int lire_avec_accolades_depuis(Entree &is)
Parse the parameter block { ... } from is.
static void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
static void init_sequential_domain(Domaine_32_64< _SIZE_ > &dom)
Create parallel descriptors for the vertex and element arrays of the domain (necessary because Scatte...
static void uninit_sequential_domain(Domaine_32_64< _SIZE_ > &dom)
Method used by interpreters that modify the domain (sequential), destroys the descriptors of vertices...
Base class for output streams.
virtual void ref(const TRUSTTab &)
void resize(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
_SIZE_ dimension(int d) const