7#include <arcane/geometry/euclidian/Euclidian3Geometry.h>
12#include <arcane/utils/FatalErrorException.h>
13#include <arcane/utils/NotImplementedException.h>
16NUMERICS_BEGIN_NAMESPACE
25 switch (item.
type()) {
70 switch (item.
type()) {
116 switch (item.
type()) {
144 case IT_Heptaedron10:
155Real Euclidian3Geometry::
162Real Euclidian3Geometry::
167 switch (item.
type()) {
186 case IT_Heptaedron10:
191 case IT_AntiWedgeLeft6:
192 case IT_AntiWedgeRight6:
207 switch (item.
type()) {
228 case IT_Heptaedron10:
243 case IT_AntiWedgeLeft6:
246 case IT_AntiWedgeRight6:
259computeSurfaceCenter(Integer n,
const Real3 * coords)
262 return computeTriangleCenter(coords[0],coords[1],coords[2]);
266 for(Integer i=1;i<n-1;++i)
268 Real
local_area = math::normeR3(computeTriangleNormal(coords[0],coords[i],coords[i+1]));
269 center +=
local_area * computeTriangleCenter(coords[0],coords[i],coords[i+1]);
277computeOrientedArea(Integer n,
const Real3 * coords)
279 Real3 normal(0.,0.,0.);
280 for(Integer i=1;i<n-1;++i)
281 normal += computeTriangleNormal(coords[0],coords[i],coords[i+1]);
289 const Real3 d = m-n ;
290 return math::sqrt(math::scaMul(d,d)) ;
296Euclidian3Geometry::ComputeLine2::
300 center = 0.5 * (m_coords[item.
node(1)] + m_coords[item.
node(0)]);
304Euclidian3Geometry::ComputeTriangle3::
308 computeTriangleNormal(m_coords[item.
node(0)],
309 m_coords[item.
node(1)],
310 m_coords[item.
node(2)]);
313 computeTriangleCenter(m_coords[item.
node(0)],
314 m_coords[item.
node(1)],
315 m_coords[item.
node(2)]);
319Euclidian3Geometry::ComputeQuad4::
323 computeTriangleNormal(m_coords[item.
node(0)],
324 m_coords[item.
node(1)],
325 m_coords[item.
node(2)]) +
326 computeTriangleNormal(m_coords[item.
node(0)],
327 m_coords[item.
node(2)],
328 m_coords[item.
node(3)]);
331 computeQuadrilateralCenter(m_coords[item.
node(0)],
332 m_coords[item.
node(1)],
333 m_coords[item.
node(2)],
334 m_coords[item.
node(3)]);
338Euclidian3Geometry::ComputePentagon5::
342 computeTriangleNormal(m_coords[item.
node(0)],
343 m_coords[item.
node(1)],
344 m_coords[item.
node(2)]) +
345 computeTriangleNormal(m_coords[item.
node(0)],
346 m_coords[item.
node(2)],
347 m_coords[item.
node(3)]) +
348 computeTriangleNormal(m_coords[item.
node(0)],
349 m_coords[item.
node(3)],
350 m_coords[item.
node(4)]);
353 computePentagonalCenter(m_coords[item.
node(0)],
354 m_coords[item.
node(1)],
355 m_coords[item.
node(2)],
356 m_coords[item.
node(3)],
357 m_coords[item.
node(4)]);
362Euclidian3Geometry::ComputeHexagon6::
366 computeTriangleNormal(m_coords[item.
node(0)],
367 m_coords[item.
node(1)],
368 m_coords[item.
node(2)]) +
369 computeTriangleNormal(m_coords[item.
node(0)],
370 m_coords[item.
node(2)],
371 m_coords[item.
node(3)]) +
372 computeTriangleNormal(m_coords[item.
node(0)],
373 m_coords[item.
node(3)],
374 m_coords[item.
node(4)]) +
375 computeTriangleNormal(m_coords[item.
node(0)],
376 m_coords[item.
node(4)],
377 m_coords[item.
node(5)]);
380 computeHexagonalCenter(m_coords[item.
node(0)],
381 m_coords[item.
node(1)],
382 m_coords[item.
node(2)],
383 m_coords[item.
node(3)],
384 m_coords[item.
node(4)],
385 m_coords[item.
node(5)]);
390Euclidian3Geometry::ComputeTetraedron4::
393 ARCANE_ASSERT((item.
type() == IT_Tetraedron4),(
"Bad item type: %d vs %d (Tetra4)",item.
type(),IT_Tetraedron4));
394 measure = computeTetraedronVolume(m_coords[item.
node(0)],
395 m_coords[item.
node(1)],
396 m_coords[item.
node(2)],
397 m_coords[item.
node(3)]);
398 center = computeTetraedronCenter(m_coords[item.
node(0)],
399 m_coords[item.
node(1)],
400 m_coords[item.
node(2)],
401 m_coords[item.
node(3)]);
405Euclidian3Geometry::ComputeTetraedron4::
408 ARCANE_ASSERT((item.
type() == IT_Tetraedron4),(
"Bad item type: %d vs %d (Tetra4)",item.
type(),IT_Tetraedron4));
410 for(Integer i=0;i<4;++i)
413 area += math::abs(computeTriangleSurface(m_coords[face.
node(0)],
414 m_coords[face.
node(1)],
415 m_coords[face.
node(2)]));
422Euclidian3Geometry::ComputeGenericVolume::
427 for(Integer i=0;i<item.
nbNode();++i) {
433 center =
Real3(0,0,0);
437 for(Integer i=0;i<cell.
nbFace();++i)
444 m_coords[face.
node(1)],
445 m_coords[face.
node(2)],
447 center += v * computeTetraedronCenter(m_coords[face.
node(0)],
448 m_coords[face.
node(1)],
449 m_coords[face.
node(2)],
452 }
else if (face.
nbNode() == 4) {
454 const Real3 coords[5] = { m_coords[face.
node(0)],
455 m_coords[face.
node(1)],
456 m_coords[face.
node(2)],
457 m_coords[face.
node(3)],
458 m_coords[face.
node(0)] };
459 const Real3 fcenter = computeQuadrilateralCenter(coords[0],coords[1],coords[2],coords[3]);
460 for(Integer
j=0;
j<4;++
j) {
462 center += v * computeTetraedronCenter(coords[
j], coords[
j+1],
fcenter,
vcenter);
477Euclidian3Geometry::ComputeGenericVolume::
481 for(Integer i=0;i<cell.
nbFace();++i)
485 area += math::abs(computeTriangleSurface(m_coords[face.
node(0)],
486 m_coords[face.
node(1)],
487 m_coords[face.
node(2)]));
488 }
else if (face.
nbNode() == 4) {
489 area += math::abs(computeTriangleSurface(m_coords[item.
node(0)],
490 m_coords[item.
node(1)],
491 m_coords[item.
node(2)]))
492 + math::abs(computeTriangleSurface(m_coords[item.
node(0)],
493 m_coords[item.
node(3)],
494 m_coords[item.
node(3)]));
504NUMERICS_END_NAMESPACE
#define ARCANE_THROW(exception_class,...)
Macro pour envoyer une exception avec formattage.
Face face(Int32 i) const
i-ème face de la maille
Int32 nbFace() const
Nombre de faces de la maille.
Cell frontCell() const
Maille devant la face (maille nulle si aucune)
Elément de maillage s'appuyant sur des noeuds (Edge,Face,Cell).
Node node(Int32 i) const
i-ème noeud de l'entité
Int32 nbNode() const
Nombre de noeuds de l'entité
Cell toCell() const
Converti l'entité en le genre Cell.
Int16 type() const
Type de l'entité
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Classe gérant un vecteur de réel de dimension 3.
Exception lorsqu'une erreur fatale est survenue.
Exception lorsqu'une fonction n'est pas implémentée.
Exception lorsqu'une opération n'est pas supportée.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-