16#include <Tetraedriser_par_prisme.h>
39static void decoupe(Domaine& dom, Faces& faces)
46 IntTab nouveaux(2 * nb_faces, 3);
49 for(
int i=0; i<nb_faces; i++)
51 int i1 = sommets(i, 0);
52 int i2 = sommets(i, 1);
53 int i3 = sommets(i, 2);
54 int i4 = sommets(i, 3);
57 if ((coord(i1, 0) == coord(i2, 0)) && (coord(i1, 0) == coord(i3, 0)))
62 nouveaux(nb_faces + i, 0) = i2;
63 nouveaux(nb_faces + i, 1) = i3;
64 nouveaux(nb_faces + i, 2) = i4;
68 if ((coord(i1, 2) == coord(i2, 2)) && (coord(i1, 2) == coord(i3, 2)))
73 nouveaux(nb_faces + i, 0) = i2;
74 nouveaux(nb_faces + i, 1) = i3;
75 nouveaux(nb_faces + i, 2) = i4;
78 if ((coord(i1, 1) == coord(i2, 1)) && (coord(i1, 1) == coord(i3, 1)))
83 nouveaux(nb_faces + i, 0) = i1;
84 nouveaux(nb_faces + i, 1) = i3;
85 nouveaux(nb_faces + i, 2) = i4;
89 sommets.
ref(nouveaux);
105 if (
domaine.type_elem()->que_suis_je() ==
"Hexaedre")
108 IntTab& les_elems =
domaine.les_elems();
110 IntTab new_elems(6 * oldsz, 4);
111 for (
int i = 0; i < oldsz; i++)
113 int i0 = les_elems(i, 0);
114 int i1 = les_elems(i, 1);
115 int i2 = les_elems(i, 2);
116 int i3 = les_elems(i, 3);
117 int i4 = les_elems(i, 4);
118 int i5 = les_elems(i, 5);
119 int i6 = les_elems(i, 6);
120 int i7 = les_elems(i, 7);
122 new_elems(i, 0) = i0;
123 new_elems(i, 1) = i1;
124 new_elems(i, 2) = i2;
125 new_elems(i, 3) = i5;
127 new_elems(i + oldsz, 0) = i0;
128 new_elems(i + oldsz, 1) = i2;
129 new_elems(i + oldsz, 2) = i4;
130 new_elems(i + oldsz, 3) = i5;
133 new_elems(i + 2 * oldsz, 0) = i1;
134 new_elems(i + 2 * oldsz, 1) = i2;
135 new_elems(i + 2 * oldsz, 2) = i3;
136 new_elems(i + 2 * oldsz, 3) = i5;
139 new_elems(i + 3 * oldsz, 0) = i2;
140 new_elems(i + 3 * oldsz, 1) = i3;
141 new_elems(i + 3 * oldsz, 2) = i5;
142 new_elems(i + 3 * oldsz, 3) = i7;
145 new_elems(i + 4 * oldsz, 0) = i2;
146 new_elems(i + 4 * oldsz, 1) = i4;
147 new_elems(i + 4 * oldsz, 2) = i5;
148 new_elems(i + 4 * oldsz, 3) = i6;
151 new_elems(i + 5 * oldsz, 0) = i2;
152 new_elems(i + 5 * oldsz, 1) = i5;
153 new_elems(i + 5 * oldsz, 2) = i6;
154 new_elems(i + 5 * oldsz, 3) = i7;
158 les_elems.
ref(new_elems);
161 Cerr <<
"We do not yet know how to Tetraedriser_par_prisme the " <<
domaine.type_elem()->que_suis_je() <<
"s" << finl;
163 for (
auto &itr :
domaine.faces_bord())
165 Faces& les_faces = itr.faces();
166 les_faces.
typer(Type_Face::triangle_3D);
170 for (
auto &itr :
domaine.faces_raccord())
172 Faces& les_faces = itr->faces();
173 les_faces.
typer(Type_Face::triangle_3D);
177 for (
auto &itr :
domaine.bords_int())
179 Faces& les_faces = itr.faces();
180 les_faces.
typer(Type_Face::triangle_3D);
184 for (
auto &itr :
domaine.groupes_faces())
186 Faces& les_faces = itr.faces();
187 les_faces.
typer(Type_Face::triangle_3D);
const DoubleTab_t & coord_sommets() const
Class defining operators and methods for all reading operation in an input flow (file,...
void typer(const Motcle &)
Sets the type of the faces.
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.
void mettre_a_jour_sous_domaine(Domaine_t &domaine, int_t &elem, int_t num_premier_elem, int_t nb_elem) const
Domaine_t & domaine(int i=0)
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.
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
Class Tetra_par_prisme This class is an interpreter that serves to read and execute.
void trianguler(Domaine &) const override
Tetrahedralises all elements of a domain: transforms the geometric elements of the domain into IDENTI...
Triangulation_base Base class intended to factor out the triangulation action of interpreters.