12#ifndef ARCANE_CARTESIANMESH_CELLDIRECTIONMNG_H
13#define ARCANE_CARTESIANMESH_CELLDIRECTIONMNG_H
17#include "arcane/ArcaneTypes.h"
19#include "arcane/Item.h"
20#include "arcane/ItemEnumerator.h"
21#include "arcane/IndexedItemConnectivityView.h"
23#include "arcane/cartesianmesh/CartesianMeshGlobal.h"
24#include "arcane/cartesianmesh/CartesianItemDirectionInfo.h"
41class ARCANE_CARTESIANMESH_EXPORT DirCell
55 CellLocalId
previousId()
const {
return CellLocalId(m_previous.localId()); }
59 CellLocalId
nextId()
const {
return CellLocalId(m_next.localId()); }
76class ARCANE_CARTESIANMESH_EXPORT DirCellLocalId
80 constexpr ARCCORE_HOST_DEVICE DirCellLocalId(CellLocalId n, CellLocalId p)
88 constexpr ARCCORE_HOST_DEVICE CellLocalId
previous()
const {
return m_previous; }
90 constexpr ARCCORE_HOST_DEVICE CellLocalId
previousId()
const {
return m_previous; }
92 constexpr ARCCORE_HOST_DEVICE CellLocalId
next()
const {
return m_next; }
94 constexpr ARCCORE_HOST_DEVICE CellLocalId
nextId()
const {
return m_next; }
98 CellLocalId m_previous;
111class ARCANE_CARTESIANMESH_EXPORT DirCellNode
113 friend CellDirectionMng;
114 using Int8 = std::int8_t;
118 DirCellNode(
Cell c,
const Int8* nodes_indirection)
120 , m_nodes_indirection(nodes_indirection)
128 CellLocalId
cellId()
const {
return CellLocalId(m_cell.localId()); }
131 Node nextLeft()
const {
return m_cell.node(m_nodes_indirection[CNP_NextLeft]); }
133 Node nextRight()
const {
return m_cell.node(m_nodes_indirection[CNP_NextRight]); }
140 NodeLocalId
nextLeftId()
const {
return NodeLocalId(m_cell.nodeId(m_nodes_indirection[CNP_NextLeft])); }
142 NodeLocalId
nextRightId()
const {
return NodeLocalId(m_cell.nodeId(m_nodes_indirection[CNP_NextRight])); }
144 NodeLocalId
previousRightId()
const {
return NodeLocalId(m_cell.nodeId(m_nodes_indirection[CNP_PreviousRight])); }
146 NodeLocalId
previousLeftId()
const {
return NodeLocalId(m_cell.nodeId(m_nodes_indirection[CNP_PreviousLeft])); }
149 Node topNextLeft()
const {
return m_cell.node(m_nodes_indirection[CNP_TopNextLeft]); }
158 NodeLocalId
topNextLeftId()
const {
return NodeLocalId(m_cell.nodeId(m_nodes_indirection[CNP_TopNextLeft])); }
160 NodeLocalId
topNextRightId()
const {
return NodeLocalId(m_cell.nodeId(m_nodes_indirection[CNP_TopNextRight])); }
162 NodeLocalId
topPreviousRightId()
const {
return NodeLocalId(m_cell.nodeId(m_nodes_indirection[CNP_TopPreviousRight])); }
164 NodeLocalId
topPreviousLeftId()
const {
return NodeLocalId(m_cell.nodeId(m_nodes_indirection[CNP_TopPreviousLeft])); }
169 const Int8* m_nodes_indirection;
181class ARCANE_CARTESIANMESH_EXPORT DirCellNodeLocalId
183 friend CellDirectionMng;
184 using Int8 = std::int8_t;
188 ARCCORE_HOST_DEVICE DirCellNodeLocalId(CellLocalId c,
const Int8* nodes_indirection, IndexedCellNodeConnectivityView view)
190 , m_nodes_indirection(nodes_indirection)
197 ARCCORE_HOST_DEVICE CellLocalId
cellId()
const {
return m_cell; }
200 ARCCORE_HOST_DEVICE NodeLocalId
nextLeftId()
const {
return m_view.nodeId(m_cell, m_nodes_indirection[CNP_NextLeft]); }
202 ARCCORE_HOST_DEVICE NodeLocalId
nextRightId()
const {
return m_view.nodeId(m_cell, m_nodes_indirection[CNP_NextRight]); }
204 ARCCORE_HOST_DEVICE NodeLocalId
previousRightId()
const {
return m_view.nodeId(m_cell, m_nodes_indirection[CNP_PreviousRight]); }
206 ARCCORE_HOST_DEVICE NodeLocalId
previousLeftId()
const {
return m_view.nodeId(m_cell, m_nodes_indirection[CNP_PreviousLeft]); }
209 ARCCORE_HOST_DEVICE NodeLocalId
topNextLeftId()
const {
return m_view.nodeId(m_cell, m_nodes_indirection[CNP_TopNextLeft]); }
211 ARCCORE_HOST_DEVICE NodeLocalId
topNextRightId()
const {
return m_view.nodeId(m_cell, m_nodes_indirection[CNP_TopNextRight]); }
213 ARCCORE_HOST_DEVICE NodeLocalId
topPreviousRightId()
const {
return m_view.nodeId(m_cell, m_nodes_indirection[CNP_TopPreviousRight]); }
215 ARCCORE_HOST_DEVICE NodeLocalId
topPreviousLeftId()
const {
return m_view.nodeId(m_cell, m_nodes_indirection[CNP_TopPreviousLeft]); }
220 const Int8* m_nodes_indirection;
221 IndexedCellNodeConnectivityView m_view;
233class ARCANE_CARTESIANMESH_EXPORT DirCellFace
235 friend CellDirectionMng;
239 DirCellFace(
Cell c,
Int32 next_face_index,
Int32 previous_face_index)
241 , m_next_face_index(next_face_index)
242 , m_previous_face_index(previous_face_index)
251 CellLocalId
cellId()
const {
return m_cell.itemLocalId(); }
254 Face next()
const {
return m_cell.face(m_next_face_index); }
256 FaceLocalId
nextId()
const {
return m_cell.faceId(m_next_face_index); }
261 FaceLocalId
previousId()
const {
return m_cell.faceId(m_previous_face_index); }
272 Int32 m_next_face_index;
273 Int32 m_previous_face_index;
285class ARCANE_CARTESIANMESH_EXPORT DirCellFaceLocalId
287 friend CellDirectionMng;
291 ARCCORE_HOST_DEVICE DirCellFaceLocalId(CellLocalId c,
Int32 next_face_index,
292 Int32 previous_face_index,
293 IndexedCellFaceConnectivityView view)
295 , m_next_face_index(next_face_index)
296 , m_previous_face_index(previous_face_index)
304 ARCCORE_HOST_DEVICE CellLocalId
cell()
const {
return m_cell; }
306 ARCCORE_HOST_DEVICE CellLocalId
cellId()
const {
return m_cell; }
309 ARCCORE_HOST_DEVICE FaceLocalId
next()
const {
return m_view.faceId(m_cell, m_next_face_index); }
311 ARCCORE_HOST_DEVICE FaceLocalId
nextId()
const {
return m_view.faceId(m_cell, m_next_face_index); }
314 ARCCORE_HOST_DEVICE FaceLocalId
previous()
const {
return m_view.faceId(m_cell, m_previous_face_index); }
316 ARCCORE_HOST_DEVICE FaceLocalId
previousId()
const {
return m_view.faceId(m_cell, m_previous_face_index); }
327 Int32 m_next_face_index;
328 Int32 m_previous_face_index;
329 IndexedCellFaceConnectivityView m_view;
363 friend CartesianMeshImpl;
364 friend CartesianMeshPatch;
366 static const int MAX_NB_NODE = 8;
367 using Int8 = std::int8_t;
392 return _cell(c.localId());
397 return _cell(c.localId());
402 return _dirCellId(c);
414 return DirCellNode(m_cells[c.localId()], m_nodes_indirection);
420 return DirCellNode(m_cells[c.localId()], m_nodes_indirection);
432 return DirCellFace(c, m_next_face_index, m_previous_face_index);
437 return DirCellFace(m_cells[c.localId()], m_next_face_index, m_previous_face_index);
443 return DirCellFaceLocalId(c, m_next_face_index, m_previous_face_index, m_cell_face_view);
474 return _cell(c.localId());
491 Int64 globalNbCell()
const;
501 Int32 ownNbCell()
const;
521 Int32 subDomainOffset()
const;
541 Int64 ownCellOffset()
const;
548 ItemDirectionInfo d = m_infos_view[local_id];
549 return DirCell(m_cells[d.m_next_lid], m_cells[d.m_previous_lid]);
553 ARCCORE_HOST_DEVICE DirCellLocalId _dirCellId(Int32 local_id)
const
555 ItemDirectionInfo d = m_infos_view[local_id];
556 return DirCellLocalId(CellLocalId(d.m_next_lid), CellLocalId(d.m_previous_lid));
559 void setNodesIndirection(ConstArrayView<Int8> nodes_indirection);
568 void _internalComputeInnerAndOuterItems(
const ItemGroup& items);
574 void _internalInit(ICartesianMesh* cm, eMeshDirection dir, Integer patch_index);
580 void _internalDestroy();
586 void _internalSetLocalFaceIndex(Int32 next_index, Int32 previous_index)
588 m_next_face_index = next_index;
589 m_previous_face_index = previous_index;
597 void _internalResizeInfos(Int32 new_size);
599 void _internalSetOffsetAndNbCellInfos(Int64 global_nb_cell, Int32 own_nb_cell,
600 Int32 sub_domain_offset, Int64 own_cell_offset);
615 Int32 m_next_face_index;
616 Int32 m_previous_face_index;
617 Int8 m_nodes_indirection[MAX_NB_NODE];
619 IndexedCellNodeConnectivityView m_cell_node_view;
620 IndexedCellFaceConnectivityView m_cell_face_view;
eMeshDirection direction() const
Valeur de la direction.
__host__ __device__ DirCellNodeLocalId dirCellNodeId(CellLocalId c) const
Maille avec infos directionnelles aux noeuds correspondant à la maille c.
DirCellFace cellFace(Cell c) const
Maille avec infos directionnelles aux faces correspondant à la maille c.
DirCell cell(CellLocalId c) const
Maille direction correspondant à la maille c.
DirCellFace cellFace(CellLocalId c) const
Maille avec infos directionnelles aux faces correspondant à la maille c.
DirCellNode cellNode(Cell c) const
Maille avec infos directionnelles aux noeuds correspondant à la maille c.
DirCell dirCell(CellLocalId c) const
Maille direction correspondant à la maille c.
DirCell cell(Cell c) const
Maille direction correspondant à la maille c.
DirCellNode cellNode(CellLocalId c) const
Maille avec infos directionnelles aux noeuds correspondant à la maille c.
DirCellNode dirCellNode(CellLocalId c) const
Maille avec infos directionnelles aux noeuds correspondant à la maille c.
DirCell operator[](CellEnumerator icell) const
Maille direction correspondant à l'itérateur de la maille icell.
DirCell operator[](CellLocalId c) const
Maille direction correspondant à la maille c.
CellDirectionMng()
Créé une instance vide.
__host__ __device__ DirCellFaceLocalId dirCellFaceId(CellLocalId c) const
Maille avec infos directionnelles aux faces correspondant à la maille c.
DirCell operator[](Cell c) const
Maille direction correspondant à la maille c.
__host__ __device__ DirCellLocalId dirCellId(CellLocalId c) const
Maille direction correspondant à la maille c.
Vue sur les informations des mailles.
Maille avec info directionnelle des faces.
__host__ __device__ FaceLocalId next() const
Face connectée à la maille d'après la maille courante dans la direction.
__host__ __device__ CellLocalId cellId() const
Maille associée.
__host__ __device__ CellLocalId cell() const
Maille associée.
__host__ __device__ FaceLocalId nextId() const
Face connectée à la maille d'après la maille courante dans la direction.
__host__ __device__ FaceLocalId previousId() const
Face connectée à la maille d'avant la maille courante dans la direction.
__host__ __device__ FaceLocalId previous() const
Face connectée à la maille d'avant la maille courante dans la direction.
__host__ __device__ Int32 nextLocalIndex() const
Indice locale dans la maille de la face next()
__host__ __device__ Int32 previousLocalIndex() const
Indice locale dans la maille de la face previous()
Maille avec info directionnelle des faces.
Int32 nextLocalIndex() const
Indice locale dans la maille de la face next()
Face next() const
Face connectée à la maille d'après la maille courante dans la direction.
Cell cell() const
Maille associée.
FaceLocalId nextId() const
Face connectée à la maille d'après la maille courante dans la direction.
Face previous() const
Face connectée à la maille d'avant la maille courante dans la direction.
FaceLocalId previousId() const
Face connectée à la maille d'avant la maille courante dans la direction.
CellLocalId cellId() const
Maille associée.
Int32 previousLocalIndex() const
Indice locale dans la maille de la face previous()
Maille avant et après une maille suivant une direction.
constexpr __host__ __device__ CellLocalId previousId() const
Maille avant.
constexpr __host__ __device__ CellLocalId nextId() const
Maille après.
constexpr __host__ __device__ CellLocalId next() const
Maille après.
constexpr __host__ __device__ CellLocalId previous() const
Maille avant.
Maille avec info directionnelle des noeuds.
__host__ __device__ NodeLocalId nextRightId() const
Noeud devant à droite dans la direction.
__host__ __device__ NodeLocalId topNextLeftId() const
Noeud devant à gauche dans la direction.
__host__ __device__ NodeLocalId previousLeftId() const
Noeud derrière à gauche dans la direction.
__host__ __device__ NodeLocalId topPreviousLeftId() const
Noeud derrière à gauche dans la direction.
__host__ __device__ NodeLocalId nextLeftId() const
Noeud devant à gauche dans la direction.
__host__ __device__ NodeLocalId topNextRightId() const
Noeud devant à droite dans la direction.
__host__ __device__ NodeLocalId previousRightId() const
Noeud derrière à droite dans la direction.
__host__ __device__ CellLocalId cellId() const
Maille associée.
__host__ __device__ NodeLocalId topPreviousRightId() const
Noeud derrière à droite dans la direction.
Maille avec info directionnelle des noeuds.
Node nextRight() const
Noeud devant à droite dans la direction.
CellLocalId cellId() const
Maille associée.
Node previousRight() const
Noeud derrière à droite dans la direction.
NodeLocalId topNextLeftId() const
Noeud devant à gauche dans la direction.
NodeLocalId nextRightId() const
Noeud devant à droite dans la direction.
NodeLocalId topNextRightId() const
Noeud devant à droite dans la direction.
NodeLocalId nextLeftId() const
Noeud devant à gauche dans la direction.
Node nextLeft() const
Noeud devant à gauche dans la direction.
Node topNextRight() const
Noeud devant à droite dans la direction.
NodeLocalId topPreviousLeftId() const
Noeud derrière à gauche dans la direction.
NodeLocalId topPreviousRightId() const
Noeud derrière à droite dans la direction.
NodeLocalId previousLeftId() const
Noeud derrière à gauche dans la direction.
NodeLocalId previousRightId() const
Noeud derrière à droite dans la direction.
Node topPreviousRight() const
Noeud derrière à droite dans la direction.
Cell cell() const
Maille associée.
Node topNextLeft() const
Noeud devant à gauche dans la direction.
Node previousLeft() const
Noeud derrière à gauche dans la direction.
Node topPreviousLeft() const
Noeud derrière à gauche dans la direction.
Maille avant et après une maille suivant une direction.
CellLocalId nextId() const
Maille après.
CellLocalId previousId() const
Maille avant.
Cell previous() const
Maille avant.
Cell next() const
Maille après.
constexpr Int32 localId() const
Identifiant local de l'entité dans le sous-domaine du processeur.
Vue d'un tableau d'éléments de type T.
Structure interne contenant l'entité devant et derriére dans une direction.
ItemGroupT< Cell > CellGroup
Groupe de mailles.
ItemEnumeratorT< Cell > CellEnumerator
Enumérateurs sur des mailles.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
std::int8_t Int8
Type entier signé sur 8 bits.
std::int64_t Int64
Type entier signé sur 64 bits.
eMeshDirection
Type de la direction pour un maillage structuré
std::int32_t Int32
Type entier signé sur 32 bits.