19static int faces_sommets_rectangle[4][2] =
29template <
typename _SIZE_>
35template <
typename _SIZE_>
44template <
typename _SIZE_>
49 Cerr <<
"It is expected to treat rectangles but" << finl;
50 Cerr <<
"one of the elements is not rectangle!" << finl;
51 Cerr <<
"Check your mesh." << finl;
58template <
typename _SIZE_>
70 const int_t nb_elem=domaine.nb_elem();
71 for (
int_t num_poly=0; num_poly<nb_elem; num_poly++)
76 S[i] = elem(num_poly,i);
78 co(i,j) = dom.
coord(S[i], j);
81 xmin=std::min(co(0, 0), co(1, 0));
82 xmin=std::min(xmin, co(2, 0));
83 ymin=std::min(co(0, 1), co(1, 1));
84 ymin=std::min(ymin, co(2, 1));
87 if ( est_egal(co(i, 0),xmin) && est_egal(co(i, 1),ymin))
90 if ( !est_egal(co(i, 0),xmin) && est_egal(co(i, 1),ymin))
93 if ( est_egal(co(i, 0),xmin) && !est_egal(co(i, 1),ymin))
96 if ( !est_egal(co(i, 0),xmin) && !est_egal(co(i, 1),ymin))
100 if (min_array(NS)==-1)
102 Cerr <<
"The element " << num_poly <<
" is not a rectangle." << finl;
107 elem(num_poly, i)=NS[i];
116template <
typename _SIZE_>
119 static Nom nom=
"VOXEL8";
134template <
typename _SIZE_>
141 if ( inf_ou_egal(dom.
coord(som0,0),pos[0]) && inf_ou_egal(pos[0],dom.
coord(som3,0))
142 && inf_ou_egal(dom.
coord(som0,1),pos[1]) && inf_ou_egal(pos[1],dom.
coord(som3,1)) )
156template <
typename _SIZE_>
159 const Domaine_t& domaine=mon_dom.valeur();
160 if((domaine.sommet_elem(element,0)==som[0])&&
161 (domaine.sommet_elem(element,1)==som[1])&&
162 (domaine.sommet_elem(element,2)==som[2])&&
163 (domaine.sommet_elem(element,3)==som[3]))
174template <
typename _SIZE_>
179 Cerr <<
"Rectangle_32_64<_SIZE_>::calculer_volumes is not supported for 3D yet." << finl;
188 for (
int_t num_poly=0; num_poly<size_tot; num_poly++)
195 volumes[num_poly]= dx*dy;
205template <
typename _SIZE_>
208 const Domaine_t& domaine_geom = mon_dom.valeur();
213 for (
int_t numface=0; numface<nbfaces; numface++)
215 n0 = Face_sommets(numface,0);
216 n1 = Face_sommets(numface,1);
217 x1 = les_coords(n0,0) - les_coords(n1,0);
218 y1 = les_coords(n0,1) - les_coords(n1,1);
219 face_normales(numface,0) = -y1;
220 face_normales(numface,1) = x1;
227template <
typename _SIZE_>
230 faces_som_local.
resize(4,2);
231 for (
int i=0; i<4; i++)
232 for (
int j=0; j<2; j++)
233 faces_som_local(i,j) = faces_sommets_rectangle[i][j];
int_t nb_elem_tot() const
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 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 void exit(int exit_code=-1)
Exit routine for TRUST within a Kokkos region.
Rectangle class — represents the rectangular geometric element.
DoubleVect_T< _SIZE_ > DoubleVect_t
void calculer_normales(const IntTab_t &faces_sommets, DoubleTab_t &face_normales) const override
Computes the normals to the faces of the elements of the associated domain.
const Nom & nom_lml() const override
Returns the LML name of a rectangle = "VOXEL8".
void calculer_volumes(DoubleVect_t &vols) const override
Computes the volumes of the elements of the associated domain.
int get_tab_faces_sommets_locaux(IntTab &faces_som_local) const override
voir ElemGeomBase::get_tab_faces_sommets_locaux
int reordonner_elem()
Reorders and verifies that the elements are indeed rectangles.
int contient(const ArrOfDouble &pos, int_t elem) const override
Returns 1 if element ielem of the domain associated with the geometric element contains the point.
SmallArrOfTID_T< _SIZE_ > SmallArrOfTID_t
Domaine_32_64< _SIZE_ > Domaine_t
DoubleTab_T< _SIZE_ > DoubleTab_t
void reordonner() override
Reorders the vertices of the rectangle.
IntTab_T< _SIZE_ > IntTab_t
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