Arcane  v4.1.10.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
src/arcane/geometry/GeomShapeOperation.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/* GeomShapeOperation.h (C) 2000-2026 */
9/* */
10/* Opération sur une forme géométrique. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_GEOMETRIC_GEOMETRICOPERATION_H
13#define ARCANE_GEOMETRIC_GEOMETRICOPERATION_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/utils/TraceAccessor.h"
18
19#include "arcane/core/AbstractItemOperationByBasicType.h"
20
21#include "arcane/geometry/GeomShapeView.h"
22#include "arcane/geometry/GeomShapeMng.h"
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
27namespace Arcane::geometric
28{
29/*---------------------------------------------------------------------------*/
30/*---------------------------------------------------------------------------*/
62template<typename OperationFunction>
65{
66 public:
76 template<typename ... BuildArgs>
77 GeomShapeOperation(GeomShapeMng& shape_mng,BuildArgs ... compute_function_args)
78 : m_shape_mng(shape_mng),
79 m_operation_function(compute_function_args ...)
80 {
81 }
82
83 template<typename ShapeType>
84 void apply(ItemVectorView cells)
85 {
86 ShapeType generic;
87 ENUMERATE_CELL(i_cell,cells){
88 Cell cell = *i_cell;
89 m_shape_mng.initShape(generic,cell);
90 m_operation_function.apply(generic);
91 }
92 }
93
94 void applyTriangle3(ItemVectorView cells)
95 {
96 apply<TriangleShapeView>(cells);
97 }
98 void applyQuad4(ItemVectorView cells)
99 {
100 apply<QuadShapeView>(cells);
101 }
102 void applyPentagon5(ItemVectorView cells)
103 {
104 apply<PentagonShapeView>(cells);
105 }
106 void applyHexagon6(ItemVectorView cells)
107 {
108 apply<HexagonShapeView>(cells);
109 }
110
111 void applyTetraedron4(ItemVectorView cells)
112 {
113 apply<TetraShapeView>(cells);
114 }
115 void applyPyramid5(ItemVectorView cells)
116 {
117 apply<PyramidShapeView>(cells);
118 }
119 void applyPentaedron6(ItemVectorView cells)
120 {
121 apply<PentaShapeView>(cells);
122 }
123 void applyHexaedron8(ItemVectorView cells)
124 {
125 apply<HexaShapeView>(cells);
126 }
127 void applyHeptaedron10(ItemVectorView cells)
128 {
129 apply<Wedge7ShapeView>(cells);
130 }
131 void applyOctaedron12(ItemVectorView cells)
132 {
133 apply<Wedge8ShapeView>(cells);
134 }
135
136 public:
138 OperationFunction& operation() { return m_operation_function; }
140 GeomShapeMng& cellShapeMng() { return m_shape_mng; }
141 private:
142
143 GeomShapeMng m_shape_mng;
144 OperationFunction m_operation_function;
145};
146
147/*---------------------------------------------------------------------------*/
148/*---------------------------------------------------------------------------*/
149
150} // namespace Arcane::geometric
151
152/*---------------------------------------------------------------------------*/
153/*---------------------------------------------------------------------------*/
154
155#endif
#define ENUMERATE_CELL(name, group)
Enumérateur générique d'un groupe de mailles.
Opérateur abstrait sur des entités rangées par type.
Maille d'un maillage.
Definition Item.h:1214
Vue sur un vecteur d'entités.
Classe gérant les GeomShape des mailles d'un maillage.
void initShape(GeomShapeView &ge, Cell cell) const
Initialise la vue ge avec les informations de la maille cell.
OperationFunction & operation()
Instance de l'opérateur.
GeomShapeOperation(GeomShapeMng &shape_mng, BuildArgs ... compute_function_args)
Construit l'opérateur.