Arcane  v4.1.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
src/arcane/geometry/BarycentricGeomShapeComputer.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* BarycentricGeomShapeComputer.h (C) 2000-2026 */
9/* */
10/* Calcul des GeomShape en utilisant les barycentres. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_GEOMETRIC_BARYCENTRICGEOMSHAPECOMPUTER_H
13#define ARCANE_GEOMETRIC_BARYCENTRICGEOMSHAPECOMPUTER_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/core/VariableTypes.h"
18
19#include "arcane/geometry/GeomShapeView.h"
20
21/*---------------------------------------------------------------------------*/
22/*---------------------------------------------------------------------------*/
23
24namespace Arcane::geometric
25{
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29/*---------------------------------------------------------------------------*/
30/*---------------------------------------------------------------------------*/
51class ARCANE_GEOMETRY_EXPORT BarycentricGeomShapeComputer
52{
53 public:
54
56 static void computeAll(GeomShapeMutableView elem,const VariableNodeReal3& coords,Cell cell);
57
59 static void computeAll(GeomShapeMng& shape_mng,VariableNodeReal3& coords,const CellGroup& cells);
60
67 static void computeTriangle3(GeomShapeMutableView elem);
68 static void computeQuad4(GeomShapeMutableView elem);
70 static void computePyramid5(GeomShapeMutableView elem);
76
96 template<GeomType ItemType> static
98
100 static void setNodes(GeomShapeMutableView elem,const VariableNodeReal3& node_coord,Cell cell)
101 {
102 Integer nb_node = cell.nbNode();
103 for( Integer node_id=0; node_id<nb_node; ++node_id){
104 elem.setNode(node_id,node_coord[cell.node(node_id)]);
105 }
106 }
107
108 private:
109
110 inline static void
111 _setFace3D(Integer fid,GeomShapeMutableView& elem,Integer id1,Integer id2,Integer id3,Integer id4)
112 {
113 elem.setFace(fid, 0.25 * ( elem.node(id1) + elem.node(id2) + elem.node(id3) + elem.node(id4) ));
114 }
115
116 inline static void
117 _setFace3D(Integer fid,GeomShapeMutableView& elem,Integer id1,Integer id2,Integer id3)
118 {
119 elem.setFace(fid, (1.0/3.0) * ( elem.node(id1) + elem.node(id2) + elem.node(id3) ));
120 }
121
122 inline static void
123 _setFace2D(Integer fid,GeomShapeMutableView& elem,Integer id1,Integer id2)
124 {
125 elem.setFace(fid,
126 Real3( 0.5 * ( elem.node(id1).x + elem.node(id2).x ),
127 0.5 * ( elem.node(id1).y + elem.node(id2).y ),
128 0.0));
129 }
130};
131
132/*---------------------------------------------------------------------------*/
133/*---------------------------------------------------------------------------*/
134
135} // namespace Arcane::geometric
136
137/*---------------------------------------------------------------------------*/
138/*---------------------------------------------------------------------------*/
139
140#endif
Maille d'un maillage.
Definition Item.h:1214
Node node(Int32 i) const
i-ème noeud de l'entité
Definition Item.h:791
Int32 nbNode() const
Nombre de noeuds de l'entité
Definition Item.h:788
static void computeTetraedron4(GeomShapeMutableView elem)
Calcul des positions des noeuds d'une maille tétraédrique.
static void computeOctaedron12(GeomShapeMutableView elem)
Calcul des positions des noeuds d'une maille prismatique à base hexagonale.
static void setNodes(GeomShapeMutableView elem, const VariableNodeReal3 &node_coord, Cell cell)
Remplit les informations des noeuds de la maille cell avec les coordonnées de node_coord.
static void computeAll(GeomShapeMutableView elem, const VariableNodeReal3 &coords, Cell cell)
Calcul les informations pour la maille cell.
static void computeTriangle3(GeomShapeMutableView elem)
Calcul des positions des noeuds d'une maille triangulaire.
static void computeQuad4(GeomShapeMutableView elem)
Calcul des positions des noeuds d'une maille quadrangulaire.
static void computeHeptaedron10(GeomShapeMutableView elem)
Calcul des positions des noeuds d'une maille prismatique à base pentagonale.
static void compute(GeomShapeMutableView elem)
Méthode template.
static void computePentaedron6(GeomShapeMutableView elem)
Calcul des positions des noeuds d'une maille pentaédrique.
static void computePyramid5(GeomShapeMutableView elem)
Calcul des positions des noeuds d'une maille pyramidale.
static void computeHexaedron8(GeomShapeMutableView elem)
Calcul des positions des noeuds d'une maille hexaédrique.
Classe gérant les GeomShape des mailles d'un maillage.
ItemGroupT< Cell > CellGroup
Groupe de mailles.
Definition ItemTypes.h:183
MeshVariableScalarRefT< Node, Real3 > VariableNodeReal3
Grandeur au noeud de type coordonnées.
Int32 Integer
Type représentant un entier.