14#include "arcane/IMesh.h"
16#include "arcane/AbstractItemOperationByBasicType.h"
18#include "arcane/geometric/BarycentricGeomShapeComputer.h"
19#include "arcane/geometric/GeomShapeMng.h"
25GEOMETRIC_BEGIN_NAMESPACE
32template <>
void BarycentricGeomShapeComputer::
33compute<GeomType::Quad4>(GeomShapeMutableView elem)
35 const Real3 nul_vector = Real3(0.,0.,0.);
40 for( Integer i = 0; i<4; ++i ){
43 elem.setCenter(0.25 * c);
46 _setFace2D(0, elem, 0 , 1);
47 _setFace2D(1, elem, 1 , 2);
48 _setFace2D(2, elem, 2 , 3);
49 _setFace2D(3, elem, 3 , 0);
55void BarycentricGeomShapeComputer::
58 compute<GeomType::Quad4>(elem);
68template <>
void BarycentricGeomShapeComputer::
76 for( Integer i = 0; i<3; ++i )
79 elem.setCenter(c / 3.0);
82 _setFace2D(0, elem, 0 , 1);
83 _setFace2D(1, elem, 1 , 2);
84 _setFace2D(2, elem, 2 , 0);
86 elem.setFace(3, elem.node(0));
94void BarycentricGeomShapeComputer::
97 compute<GeomType::Triangle3>(elem);
105template <>
void BarycentricGeomShapeComputer::
111 Real3 c = nul_vector;
113 for( Integer i = 0; i<8; ++i )
116 elem.setCenter(0.125 * c);
119 _setFace3D(0, elem, 0 , 3 , 2 , 1);
120 _setFace3D(1, elem, 0 , 4 , 7 , 3);
121 _setFace3D(2, elem, 0 , 1 , 5 , 4);
122 _setFace3D(3, elem, 4 , 5 , 6 , 7);
123 _setFace3D(4, elem, 1 , 2 , 6 , 5);
124 _setFace3D(5, elem, 2 , 3 , 7 , 6);
130void BarycentricGeomShapeComputer::
133 compute<GeomType::Hexaedron8>(elem);
141template<>
void BarycentricGeomShapeComputer::
147 Real3 c = nul_vector;
149 for( Integer i = 0; i<5; ++i )
151 elem.setCenter(0.2 * c);
154 _setFace3D(0, elem, 0, 3, 2, 1);
155 _setFace3D(1, elem, 0, 4, 3);
156 _setFace3D(2, elem, 0, 1, 4);
157 _setFace3D(3, elem, 1, 2, 4);
158 _setFace3D(4, elem, 2, 3, 4);
161 elem.setFace(5, elem.node(4));
167void BarycentricGeomShapeComputer::
170 compute<GeomType::Pyramid5>(elem);
178template<>
void BarycentricGeomShapeComputer::
184 Real3 c = nul_vector;
186 for( Integer i = 0; i<6; ++i )
189 elem.setCenter( (1./6.) * c );
191 _setFace3D(0, elem, 0, 2, 1);
192 _setFace3D(1, elem, 0, 3, 5, 2);
193 _setFace3D(2, elem, 0, 1, 4, 3);
194 _setFace3D(3, elem, 3, 4, 5);
195 _setFace3D(4, elem, 1, 2, 5, 4);
201void BarycentricGeomShapeComputer::
204 compute<GeomType::Pentaedron6>(elem);
212template<>
void BarycentricGeomShapeComputer::
218 Real3 c = nul_vector;
220 for( Integer i = 0; i<4; ++i ){
224 elem.setCenter(0.25 * c);
226 _setFace3D(0, elem, 0, 2, 1);
227 _setFace3D(1, elem, 0, 3, 2);
228 _setFace3D(2, elem, 0, 1, 3);
229 _setFace3D(3, elem, 3, 1, 2);
235void BarycentricGeomShapeComputer::
238 compute<GeomType::Tetraedron4>(elem);
246template<>
void BarycentricGeomShapeComputer::
252 Real3 c = nul_vector;
254 for( Integer i = 0; i<10; ++i )
258 elem.setCenter( 0.1 * c );
260 elem.setFace(0, 0.2 * ( elem.node(0) + elem.node(4) + elem.node(3) + elem.node(2) + elem.node(1) ));
261 elem.setFace(1, 0.2 * ( elem.node(5) + elem.node(6) + elem.node(7) + elem.node(8) + elem.node(9) ));
263 _setFace3D(2, elem, 0, 1, 6, 5);
264 _setFace3D(3, elem, 1, 2, 7, 6);
265 _setFace3D(4, elem, 2, 3, 8, 7);
266 _setFace3D(5, elem, 3, 4, 9, 8);
267 _setFace3D(6, elem, 4, 0, 5, 9);
273void BarycentricGeomShapeComputer::
276 compute<GeomType::Heptaedron10>(elem);
284template<>
void BarycentricGeomShapeComputer::
290 Real3 c = nul_vector;
292 for( Integer i = 0; i<12; ++i ){
296 elem.setCenter( (1./12.) * c );
298 elem.setFace(0, (1./6.) * ( elem.node(0) + elem.node(5) + elem.node( 4) + elem.node( 3) + elem.node( 2) + elem.node( 1) ));
299 elem.setFace(1, (1./6.) * ( elem.node(6) + elem.node(7) + elem.node( 8) + elem.node( 9) + elem.node(10) + elem.node(11) ));
300 _setFace3D(2, elem, 0, 1, 7, 6);
301 _setFace3D(3, elem, 1, 2, 8, 7);
302 _setFace3D(4, elem, 2, 3, 9, 8);
303 _setFace3D(5, elem, 3, 4, 10, 9);
304 _setFace3D(6, elem, 4, 5, 11, 10);
305 _setFace3D(7, elem, 5, 0, 6, 11);
311void BarycentricGeomShapeComputer::
314 compute<GeomType::Octaedron12>(elem);
320void BarycentricGeomShapeComputer::
323 setNodes(elem,coords,cell);
326 case GeomType::Hexaedron8: computeHexaedron8(elem);
return;
327 case GeomType::Pyramid5: computePyramid5(elem);
return;
328 case GeomType::Pentaedron6: computePentaedron6(elem);
return;
329 case GeomType::Tetraedron4: computeTetraedron4(elem);
return;
330 case GeomType::Heptaedron10: computeHeptaedron10(elem);
return;
331 case GeomType::Octaedron12: computeOctaedron12(elem);
return;
332 case GeomType::Quad4: computeQuad4(elem);
return;
333 case GeomType::Triangle3: computeTriangle3(elem);
return;
349 : m_shape_mng(shape_mng), m_node_coords(node_coords)
353 template<GeomType ItemType>
void
359 BarycentricGeomShapeComputer::setNodes(shape_view,m_node_coords,cell);
360 BarycentricGeomShapeComputer::compute<ItemType>(shape_view);
366 ARCANE_UNUSED(cells);
371 ARCANE_UNUSED(cells);
376 ARCANE_UNUSED(cells);
381 ARCANE_UNUSED(cells);
387 _applyGeneric<GeomType::Quad4>(cells);
391 _applyGeneric<GeomType::Triangle3>(cells);
396 _applyGeneric<GeomType::Hexaedron8>(cells);
401 _applyGeneric<GeomType::Pyramid5>(cells);
406 _applyGeneric<GeomType::Pentaedron6>(cells);
411 _applyGeneric<GeomType::Tetraedron4>(cells);
416 _applyGeneric<GeomType::Heptaedron10>(cells);
421 _applyGeneric<GeomType::Octaedron12>(cells);
429void BarycentricGeomShapeComputer::
439GEOMETRIC_END_NAMESPACE
Opérateur abstrait sur des entités rangées par type.
void applyOperation(IItemOperationByBasicType *operation) const
Applique l'opération operation sur les entités du groupe.
Vue sur un vecteur d'entités.
Int16 type() const
Type de l'entité
Classe gérant un vecteur de réel de dimension 3.
Classe gérant les GeomShape des mailles d'un maillage.
GeomShapeMutableView mutableShapeView(Cell cell)
Retourne une vue modifiable sur la GeomShape de la maille cell.
Vue modifiable sur un GeomShape.
Enumération spécifiant le type de polygone ou polyèdre associé à un élément ou une forme géométrique.
Exception lorsqu'une erreur fatale est survenue.