Arcane  v4.1.2.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
src/arcane/cartesianmesh/FaceDirectionMng.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2025 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/* FaceDirectionMng.cc (C) 2000-2025 */
9/* */
10/* Infos sur les faces d'une direction X Y ou Z d'un maillage structuré. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CARTESIANMESH_FACEDIRECTIONMNG_H
13#define ARCANE_CARTESIANMESH_FACEDIRECTIONMNG_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "arcane/ArcaneTypes.h"
18#include "arcane/Item.h"
19#include "arcane/VariableTypedef.h"
20#include "arcane/ItemEnumerator.h"
21
22#include "arcane/cartesianmesh/CartesianMeshGlobal.h"
23#include "arcane/cartesianmesh/CartesianItemDirectionInfo.h"
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28namespace Arcane
29{
30
31/*---------------------------------------------------------------------------*/
32/*---------------------------------------------------------------------------*/
40class ARCANE_CARTESIANMESH_EXPORT DirFace
41{
42 friend FaceDirectionMng;
43
44 private:
45
46 DirFace(Cell n,Cell p) : m_previous(p), m_next(n){}
47
48 public:
49
51 Cell previousCell() const { return m_previous; }
53 CellLocalId previousCellId() const { return m_previous.itemLocalId(); }
55 Cell nextCell() const { return m_next; }
57 CellLocalId nextCellId() const { return m_next.itemLocalId(); }
58
59 private:
60
61 Cell m_previous;
62 Cell m_next;
63};
64
65/*---------------------------------------------------------------------------*/
66/*---------------------------------------------------------------------------*/
74class ARCANE_CARTESIANMESH_EXPORT DirFaceLocalId
75{
76 friend FaceDirectionMng;
77
78 private:
79
80 ARCCORE_HOST_DEVICE DirFaceLocalId(CellLocalId n, CellLocalId p)
81 : m_previous(p)
82 , m_next(n)
83 {}
84
85 public:
86
88 ARCCORE_HOST_DEVICE CellLocalId previousCell() const { return m_previous; }
90 ARCCORE_HOST_DEVICE CellLocalId previousCellId() const { return m_previous; }
92 ARCCORE_HOST_DEVICE CellLocalId nextCell() const { return m_next; }
94 ARCCORE_HOST_DEVICE CellLocalId nextCellId() const { return m_next; }
95
96 private:
97
98 CellLocalId m_previous;
99 CellLocalId m_next;
100};
101
102/*---------------------------------------------------------------------------*/
103/*---------------------------------------------------------------------------*/
109class ARCANE_CARTESIANMESH_EXPORT FaceDirectionMng
110{
111 friend CartesianMeshImpl;
112 friend CartesianMeshPatch;
113 class Impl;
114
115 private:
116
117 using ItemDirectionInfo = impl::CartesianItemDirectionInfo;
118
119 public:
120
127
128 public:
129
132 {
133 return _face(f.localId());
134 }
135
136 DirFace face(FaceLocalId f) const
137 {
138 return _face(f.localId());
139 }
140
142 ARCCORE_HOST_DEVICE DirFaceLocalId dirFaceId(FaceLocalId f) const
143 {
144 return _dirFaceId(f);
145 }
146
148 FaceGroup allFaces() const;
149
171 FaceGroup overallFaces() const;
172
184 FaceGroup inPatchFaces() const;
185
193 FaceGroup innerFaces() const;
194
205 FaceGroup outerFaces() const;
206
209 {
210 return _face(f.localId());
211 }
212
214 DirFace operator[](FaceLocalId f) const
215 {
216 return _face(f.localId());
217 }
218
221 {
222 return _face(iface.itemLocalId());
223 }
224
227 {
228 return m_direction;
229 }
230
231 private:
232
234 DirFace _face(Int32 local_id) const
235 {
236 ItemDirectionInfo d = m_infos_view[local_id];
237 return DirFace(m_cells[d.m_next_lid], m_cells[d.m_previous_lid]);
238 }
239
241 ARCCORE_HOST_DEVICE DirFaceLocalId _dirFaceId(FaceLocalId local_id) const
242 {
243 ItemDirectionInfo d = m_infos_view[local_id];
244 return DirFaceLocalId(CellLocalId(d.m_next_lid), CellLocalId(d.m_previous_lid));
245 }
246
247 private:
248
255 void _internalComputeInfos(const CellDirectionMng& cell_dm,
256 const VariableCellReal3& cells_center,
257 const VariableFaceReal3& faces_center);
258
259 void _internalComputeInfos(const CellDirectionMng& cell_dm);
260
265 void _internalInit(ICartesianMesh* cm, eMeshDirection dir, Integer patch_index);
266
271 void _internalDestroy();
272
278 void _internalResizeInfos(Int32 new_size);
279
280 void _computeCellInfos(const CellDirectionMng& cell_dm,
281 const VariableCellReal3& cells_center,
282 const VariableFaceReal3& faces_center);
283 void _computeCellInfos() const;
284 bool _hasFace(Cell cell, Int32 face_local_id) const;
285
286 private:
287
288 SmallSpan<ItemDirectionInfo> m_infos_view;
289 CellInfoListView m_cells;
290 eMeshDirection m_direction;
291 Impl* m_p;
292};
293
294/*---------------------------------------------------------------------------*/
295/*---------------------------------------------------------------------------*/
296
297} // End namespace Arcane
298
299/*---------------------------------------------------------------------------*/
300/*---------------------------------------------------------------------------*/
301
302#endif
303
Infos sur les mailles d'une direction spécifique X,Y ou Z d'un maillage structuré.
Vue sur les informations des mailles.
Maille d'un maillage.
Definition Item.h:1214
Infos sur maille avant et après une face suivant une direction.
__host__ __device__ CellLocalId previousCellId() const
Maille avant.
__host__ __device__ CellLocalId nextCell() const
Maille après.
__host__ __device__ CellLocalId previousCell() const
Maille avant.
__host__ __device__ CellLocalId nextCellId() const
Maille après.
Infos sur maille avant et après une face suivant une direction.
CellLocalId previousCellId() const
Maille avant.
CellLocalId nextCellId() const
Maille après.
DirFace _face(Int32 local_id) const
Face direction correspondant à la face de numéro local local_id.
DirFace face(Face f) const
Face direction correspondant à la face f.
__host__ __device__ DirFaceLocalId dirFaceId(FaceLocalId f) const
Face direction correspondant à la face f.
DirFace operator[](FaceLocalId f) const
Face direction correspondant à la face f.
FaceDirectionMng()
Créé une instance vide.
DirFace face(FaceLocalId f) const
Face direction correspondant à la face f.
DirFace operator[](Face f) const
Face direction correspondant à la face f.
__host__ __device__ DirFaceLocalId _dirFaceId(FaceLocalId local_id) const
Face direction correspondant à la face de numéro local local_id.
DirFace operator[](FaceEnumerator iface) const
Face direction correspondant à l'itérateur de la face iface.
eMeshDirection direction() const
Valeur de la direction.
Face d'une maille.
Definition Item.h:964
Interface d'un maillage cartésien.
Int32 itemLocalId() const
localId() de l'entité courante.
constexpr Int32 localId() const
Identifiant local de l'entité dans le sous-domaine du processeur.
Definition Item.h:219
Vue d'un tableau d'éléments de type T.
Definition Span.h:801
Structure interne contenant l'entité devant et derriére dans une direction.
ItemLocalId m_next_lid
entité après l'entité courante dans la direction
ItemLocalId m_previous_lid
entité avant l'entité courante dans la direction
ItemGroupT< Face > FaceGroup
Groupe de faces.
Definition ItemTypes.h:178
ItemEnumeratorT< Face > FaceEnumerator
Enumérateurs sur des faces.
Definition ItemTypes.h:265
MeshVariableScalarRefT< Cell, Real3 > VariableCellReal3
Grandeur au centre des mailles de type coordonnées.
MeshVariableScalarRefT< Face, Real3 > VariableFaceReal3
Grandeur aux faces de type coordonnées.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
Int32 Integer
Type représentant un entier.
eMeshDirection
Type de la direction pour un maillage structuré
std::int32_t Int32
Type entier signé sur 32 bits.