Arcane  v3.14.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
BarycentricGeomShapeComputer.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2022 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-2016 */
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/VariableTypes.h"
18
19#include "arcane/geometric/GeomShapeView.h"
20
21/*---------------------------------------------------------------------------*/
22/*---------------------------------------------------------------------------*/
23
24ARCANE_BEGIN_NAMESPACE
25GEOMETRIC_BEGIN_NAMESPACE
26
27/*---------------------------------------------------------------------------*/
28/*---------------------------------------------------------------------------*/
29
30/*---------------------------------------------------------------------------*/
31/*---------------------------------------------------------------------------*/
52class ARCANE_CEA_GEOMETRIC_EXPORT BarycentricGeomShapeComputer
53{
54 public:
55
57 static void computeAll(GeomShapeMutableView elem,const VariableNodeReal3& coords,Cell cell);
58
60 static void computeAll(GeomShapeMng& shape_mng,VariableNodeReal3& coords,const CellGroup& cells);
61
68 static void computeTriangle3(GeomShapeMutableView elem);
69 static void computeQuad4(GeomShapeMutableView elem);
70 static void computeTetraedron4(GeomShapeMutableView elem);
71 static void computePyramid5(GeomShapeMutableView elem);
72 static void computePentaedron6(GeomShapeMutableView elem);
73 static void computeHexaedron8(GeomShapeMutableView elem);
74 static void computeHeptaedron10(GeomShapeMutableView elem);
75 static void computeOctaedron12(GeomShapeMutableView elem);
77
97 template<GeomType ItemType> static
99
102 {
103 Integer nb_node = cell.nbNode();
104 for( Integer node_id=0; node_id<nb_node; ++node_id){
105 elem.setNode(node_id,node_coord[cell.node(node_id)]);
106 }
107 }
108
109 private:
110
111 inline static void
112 _setFace3D(Integer fid,GeomShapeMutableView& elem,Integer id1,Integer id2,Integer id3,Integer id4)
113 {
114 elem.setFace(fid, 0.25 * ( elem.node(id1) + elem.node(id2) + elem.node(id3) + elem.node(id4) ));
115 }
116
117 inline static void
118 _setFace3D(Integer fid,GeomShapeMutableView& elem,Integer id1,Integer id2,Integer id3)
119 {
120 elem.setFace(fid, (1.0/3.0) * ( elem.node(id1) + elem.node(id2) + elem.node(id3) ));
121 }
122
123 inline static void
124 _setFace2D(Integer fid,GeomShapeMutableView& elem,Integer id1,Integer id2)
125 {
126 elem.setFace(fid,
127 Real3( 0.5 * ( elem.node(id1).x + elem.node(id2).x ),
128 0.5 * ( elem.node(id1).y + elem.node(id2).y ),
129 0.0));
130 }
131};
132
133/*---------------------------------------------------------------------------*/
134/*---------------------------------------------------------------------------*/
135
136GEOMETRIC_END_NAMESPACE
137ARCANE_END_NAMESPACE
138
139/*---------------------------------------------------------------------------*/
140/*---------------------------------------------------------------------------*/
141
142#endif
Calcul des GeomShape en utilisant les barycentres.
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 compute(GeomShapeMutableView elem)
Méthode template.
Maille d'un maillage.
Definition Item.h:1178
Classe gérant les GeomShape des mailles d'un maillage.
Vue modifiable sur un GeomShape.
Node node(Int32 i) const
i-ème noeud de l'entité
Definition Item.h:768
Int32 nbNode() const
Nombre de noeuds de l'entité
Definition Item.h:765
Lecteur des fichiers de maillage via la bibliothèque LIMA.
Definition Lima.cc:120