29static int faces_sommets_hexa[6][4] =
47template <
typename _SIZE_>
59template <
typename _SIZE_>
67template <
typename _SIZE_>
72 Cerr <<
"This mesh is not composed of regular hexahedra\n";
73 Cerr <<
"This seems to be VEF hexahedra (Hexaedre_VEF)\n";
74 Cerr <<
"Check your mesh." << finl;
83template <
typename _SIZE_>
86 Domaine_t& domaine = this->mon_dom.valeur();
87 const DoubleTab_t& dom_coord = domaine.les_sommets();
88 IntTab_t& elem = domaine.les_elems();
93 const int_t nb_elem = domaine.nb_elem();
94 const int delta[3] = {1, 2, 4};
95 trustIdType changed_count = 0;
97 for (
int_t num_poly = 0; num_poly < nb_elem; num_poly++)
99 xmin[0] = xmin[1] = xmin[2] = 1e40;
100 for(
int i=0; i<8; i++)
102 int_t s = elem(num_poly,i);
105 for(
int j=0; j<3; j++)
107 double x = dom_coord(s, j);
116 for (
int i=0; i<8; i++)
119 for (
int j=0; j<3; j++)
121 double x = coord[i][j];
122 if (!est_egal(x, xmin[j]))
123 num_sommet += delta[j];
125 if (NS[num_sommet] == -1)
126 NS[num_sommet] = S[i];
131 if (min_array(NS)==-1)
135 for(
int i=0; i<8; i++)
139 elem(num_poly, i) = NS[i];
146 Cerr <<
"Hexaedre_32_64<_SIZE_>::reordonner : " << changed_count <<
" elements reversed" << finl;
154template <
typename _SIZE_>
157 static Nom nom=
"VOXEL8";
170template <
typename _SIZE_>
174 const Domaine_t& dom=this->mon_dom.valeur();
177 if ( inf_ou_egal(dom.
coord(som0,0),pos[0]) && inf_ou_egal(pos[0],dom.
coord(som7,0))
178 && inf_ou_egal(dom.
coord(som0,1),pos[1]) && inf_ou_egal(pos[1],dom.
coord(som7,1))
179 && inf_ou_egal(dom.
coord(som0,2),pos[2]) && inf_ou_egal(pos[2],dom.
coord(som7,2)) )
194template <
typename _SIZE_>
197 const Domaine_t& domaine=this->mon_dom.valeur();
198 if((domaine.sommet_elem(element,0)==som[0])&&
199 (domaine.sommet_elem(element,1)==som[1])&&
200 (domaine.sommet_elem(element,2)==som[2])&&
201 (domaine.sommet_elem(element,3)==som[3])&&
202 (domaine.sommet_elem(element,4)==som[4])&&
203 (domaine.sommet_elem(element,5)==som[5])&&
204 (domaine.sommet_elem(element,6)==som[6])&&
205 (domaine.sommet_elem(element,7)==som[7]))
215template <
typename _SIZE_>
218 const Domaine_t& domaine=this->mon_dom.valeur();
222 int_t size_tot = domaine.nb_elem_tot();
224 for (
int_t num_poly=0; num_poly<size_tot; num_poly++)
226 S1 = domaine.sommet_elem(num_poly,0);
227 S2 = domaine.sommet_elem(num_poly,1);
228 S3 = domaine.sommet_elem(num_poly,2);
229 S4 = domaine.sommet_elem(num_poly,4);
230 dx = domaine.coord(S2,0) - domaine.coord(S1,0);
231 dy = domaine.coord(S3,1) - domaine.coord(S1,1);
232 dz = domaine.coord(S4,2) - domaine.coord(S1,2);
233 volumes[num_poly]= dx*dy*dz;
242template <
typename _SIZE_>
245 const Domaine_t& domaine_geom = this->mon_dom.valeur();
248 double x1,y1,z1,x2,y2,z2;
250 for (
int numface=0; numface<nbfaces; numface++)
253 n0 = Face_sommets(numface,0);
254 n1 = Face_sommets(numface,1);
255 n2 = Face_sommets(numface,2);
257 x1 = les_coords(n0,0) - les_coords(n1,0);
258 y1 = les_coords(n0,1) - les_coords(n1,1);
259 z1 = les_coords(n0,2) - les_coords(n1,2);
261 x2 = les_coords(n2,0) - les_coords(n1,0);
262 y2 = les_coords(n2,1) - les_coords(n1,1);
263 z2 = les_coords(n2,2) - les_coords(n1,2);
265 face_normales(numface,0) = (y1*z2 - y2*z1);
266 face_normales(numface,1) = (-x1*z2 + x2*z1);
267 face_normales(numface,2) = (x1*y2 - x2*y1);
275template <
typename _SIZE_>
278 faces_som_local.
resize(6,4);
279 for (
int i=0; i<6; i++)
280 for (
int j=0; j<4; j++)
281 faces_som_local(i,j) = faces_sommets_hexa[i][j];
291template <
typename _SIZE_>
const DoubleTab_t & coord_sommets() const
double coord(int_t i, int j) const
int_t sommet_elem(int_t i, int j) const
Returns the (global) number of the j-th vertex of the i-th element.
Class Elem_geom_base This class is the base class for the definition of elements.
Class defining operators and methods for all reading operation in an input flow (file,...
Class Hexaedre: represents a geometric element with 6 faces, 8 vertices, and.
int reordonner_elem()
Reorders the vertices of the hexahedron element.
void calculer_normales(const IntTab_t &faces_sommets, DoubleTab_t &face_normales) const override
Computes the face normals of the elements of the associated domain.
int contient(const ArrOfDouble &pos, int_t elem) const override
Returns 1 if element "element" of the domain associated with this geometric element contains the poin...
DoubleVect_T< _SIZE_ > DoubleVect_t
int face_sommet1(int i) const
Returns the index of the i-th vertex of face 1.
int face_sommet(int i, int j) const override
Returns the index of the j-th vertex of the i-th face of the element.
int face_sommet2(int i) const
Returns the index of the i-th vertex of face 2.
int face_sommet0(int i) const
Returns the index of the i-th vertex of face 0.
void calculer_volumes(DoubleVect_t &vols) const override
Computes the volumes of the elements of the associated domain.
int face_sommet4(int i) const
Returns the index of the i-th vertex of face 4.
int get_tab_faces_sommets_locaux(IntTab &faces_som_local) const override
See ElemGeomBase::get_tab_faces_sommets_locaux.
Domaine_32_64< _SIZE_ > Domaine_t
const Nom & nom_lml() const override
Returns the LML name of a hexahedron = "VOXEL8".
int face_sommet5(int i) const
Returns the index of the i-th vertex of face 5.
void reordonner() override
Reorders the vertices of the hexahedron.
SmallArrOfTID_T< _SIZE_ > SmallArrOfTID_t
DoubleTab_T< _SIZE_ > DoubleTab_t
int face_sommet3(int i) const
Returns the index of the i-th vertex of face 3.
IntTab_T< _SIZE_ > IntTab_t
class Nom: a character string for naming TRUST objects.
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.
static double mp_sum(double)
Computes the sum of x over all processors in the current group.
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.
Base class for output streams.
_SIZE_ size_array() const
void resize(_SIZE_ n, RESIZE_OPTIONS opt=RESIZE_OPTIONS::COPY_INIT)
_SIZE_ dimension(int d) const
_SIZE_ size_totale() const