Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
CartesianMeshNumberingMng.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/* CartesianMeshNumberingMng.h (C) 2000-2026 */
9/* */
10/* Cartesian mesh numbering manager. The numbering used here is the same as */
11/* that used in V2 renumbering. */
12/*---------------------------------------------------------------------------*/
13/*---------------------------------------------------------------------------*/
14
15#ifndef ARCANE_CARTESIANMESH_CARTESIANMESHNUMBERINGMNG_H
16#define ARCANE_CARTESIANMESH_CARTESIANMESHNUMBERINGMNG_H
17
18/*---------------------------------------------------------------------------*/
19/*---------------------------------------------------------------------------*/
20
21#include "arcane/cartesianmesh/CartesianMeshGlobal.h"
22
23#include "arcane/utils/Ref.h"
24#include "arcane/core/Item.h"
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29namespace Arcane
30{
31
32/*---------------------------------------------------------------------------*/
33/*---------------------------------------------------------------------------*/
34
36
37/*---------------------------------------------------------------------------*/
38/*---------------------------------------------------------------------------*/
39
49class ARCANE_CARTESIANMESH_EXPORT CartesianMeshNumberingMng
50{
51 public:
52
53 explicit CartesianMeshNumberingMng(ICartesianMesh* mesh);
54
55 public:
56
60 void printStatus() const;
61
70 Int64 firstCellUniqueId(Int32 level) const;
71
80 Int64 firstNodeUniqueId(Int32 level) const;
81
90 Int64 firstFaceUniqueId(Int32 level) const;
91
98 CartCoord globalNbCellsX(Int32 level) const;
99
106 CartCoord globalNbCellsY(Int32 level) const;
107
114 CartCoord globalNbCellsZ(Int32 level) const;
115
122 CartCoord globalNbNodesX(Int32 level) const;
123
130 CartCoord globalNbNodesY(Int32 level) const;
131
138 CartCoord globalNbNodesZ(Int32 level) const;
139
158 CartCoord globalNbFacesX(Int32 level) const;
159
178 CartCoord globalNbFacesY(Int32 level) const;
179
197 CartCoord globalNbFacesZ(Int32 level) const;
198
247
258
269
276 Int64 nbCellInLevel(Int32 level) const;
277
284 Int64 nbNodeInLevel(Int32 level) const;
285
292 Int64 nbFaceInLevel(Int32 level) const;
293
300 Int32 pattern() const;
301
308 Int32 cellLevel(Int64 uid) const;
309
316 Int32 nodeLevel(Int64 uid) const;
317
324 Int32 faceLevel(Int64 uid) const;
325
339 CartCoord offsetLevelToLevel(CartCoord coord, Int32 level_from, Int32 level_to) const;
340
353 CartCoord faceOffsetLevelToLevel(CartCoord coord, Int32 level_from, Int32 level_to) const;
354
362 CartCoord3 cellUniqueIdToCoord(Int64 uid, Int32 level) const;
363
371
379 CartCoord cellUniqueIdToCoordX(Int64 uid, Int32 level) const;
380
388
396 CartCoord cellUniqueIdToCoordY(Int64 uid, Int32 level) const;
397
405
413 CartCoord cellUniqueIdToCoordZ(Int64 uid, Int32 level) const;
414
422
430 CartCoord nodeUniqueIdToCoordX(Int64 uid, Int32 level) const;
431
439
447 CartCoord nodeUniqueIdToCoordY(Int64 uid, Int32 level) const;
448
456
464 CartCoord nodeUniqueIdToCoordZ(Int64 uid, Int32 level) const;
465
473
484 CartCoord faceUniqueIdToCoordX(Int64 uid, Int32 level) const;
485
496
507 CartCoord faceUniqueIdToCoordY(Int64 uid, Int32 level) const;
508
519
530 CartCoord faceUniqueIdToCoordZ(Int64 uid, Int32 level) const;
531
542
550 Int64 cellUniqueId(CartCoord3 cell_coord, Int32 level) const;
551
559 Int64 cellUniqueId(CartCoord2 cell_coord, Int32 level) const;
560
568 Int64 nodeUniqueId(CartCoord3 node_coord, Int32 level) const;
569
577 Int64 nodeUniqueId(CartCoord2 node_coord, Int32 level) const;
578
589 Int64 faceUniqueId(CartCoord3 face_coord, Int32 level) const;
590
601 Int64 faceUniqueId(CartCoord2 face_coord, Int32 level) const;
602
608 Int32 nbNodeByCell() const;
609
624 void cellNodeUniqueIds(CartCoord3 cell_coord, Int32 level, ArrayView<Int64> uid) const;
625
640 void cellNodeUniqueIds(CartCoord2 cell_coord, Int32 level, ArrayView<Int64> uid) const;
641
656 void cellNodeUniqueIds(Int64 cell_uid, Int32 level, ArrayView<Int64> uid) const;
657
671 void cellNodeUniqueIds(Cell cell, ArrayView<Int64> uid) const;
672
678 Int32 nbFaceByCell() const;
679
694 void cellFaceUniqueIds(CartCoord3 cell_coord, Int32 level, ArrayView<Int64> uid) const;
695
710 void cellFaceUniqueIds(CartCoord2 cell_coord, Int32 level, ArrayView<Int64> uid) const;
711
726 void cellFaceUniqueIds(Int64 cell_uid, Int32 level, ArrayView<Int64> uid) const;
727
741 void cellFaceUniqueIds(Cell cell, ArrayView<Int64> uid) const;
742
755 void cellUniqueIdsAroundCell(CartCoord3 cell_coord, Int32 level, ArrayView<Int64> uid) const;
756
769 void cellUniqueIdsAroundCell(CartCoord2 cell_coord, Int32 level, ArrayView<Int64> uid) const;
770
783 void cellUniqueIdsAroundCell(Int64 cell_uid, Int32 level, ArrayView<Int64> uid) const;
784
796 void cellUniqueIdsAroundCell(Cell cell, ArrayView<Int64> uid) const;
797
810 void cellUniqueIdsAroundNode(CartCoord3 node_coord, Int32 level, ArrayView<Int64> uid) const;
811
824 void cellUniqueIdsAroundNode(CartCoord2 node_coord, Int32 level, ArrayView<Int64> uid) const;
825
838 void cellUniqueIdsAroundNode(Int64 node_uid, Int32 level, ArrayView<Int64> uid) const;
839
851 void cellUniqueIdsAroundNode(Node node, ArrayView<Int64> uid) const;
852
862 Int64 parentCellUniqueIdOfCell(Int64 uid, Int32 level, bool do_fatal = true) const;
863
872 Int64 parentCellUniqueIdOfCell(Cell cell, bool do_fatal = true) const;
873
881 Int64 childCellUniqueIdOfCell(Cell cell, CartCoord3 child_coord_in_parent) const;
882
890 Int64 childCellUniqueIdOfCell(Cell cell, CartCoord2 child_coord_in_parent) const;
891
899 Int64 childCellUniqueIdOfCell(Cell cell, Int32 child_index_in_parent) const;
900
908 Cell childCellOfCell(Cell cell, CartCoord3 child_coord_in_parent) const;
909
917 Cell childCellOfCell(Cell cell, CartCoord2 child_coord_in_parent) const;
918
928 Int64 parentNodeUniqueIdOfNode(Int64 uid, Int32 level, bool do_fatal = true) const;
929
938 Int64 parentNodeUniqueIdOfNode(Node node, bool do_fatal = true) const;
939
947 Int64 childNodeUniqueIdOfNode(Int64 uid, Int32 level) const;
948
956
966 Int64 parentFaceUniqueIdOfFace(Int64 uid, Int32 level, bool do_fatal = true) const;
967
976 Int64 parentFaceUniqueIdOfFace(Face face, bool do_fatal = true) const;
977
986 Int64 childFaceUniqueIdOfFace(Int64 uid, Int32 level, Int32 child_index_in_parent) const;
987
995 Int64 childFaceUniqueIdOfFace(Face face, Int32 child_index_in_parent) const;
996
997 public:
998
999 ICartesianMeshNumberingMngInternal* _internalApi() const;
1000
1001 private:
1002
1004};
1005
1006/*---------------------------------------------------------------------------*/
1007/*---------------------------------------------------------------------------*/
1008
1009} // End namespace Arcane
1010
1011/*---------------------------------------------------------------------------*/
1012/*---------------------------------------------------------------------------*/
1013
1014#endif
Modifiable view of an array of type T.
Int64 firstFaceUniqueId(Int32 level) const
Method allowing retrieval of the first unique ID used by the faces of a level. Calling this method wi...
Int64 parentFaceUniqueIdOfFace(Int64 uid, Int32 level, bool do_fatal=true) const
Method to retrieve the uniqueId of a face's parent.
CartCoord globalNbNodesZ(Int32 level) const
Method allowing retrieval of the global number of nodes in Z for a level.
Int64 cellUniqueId(CartCoord3 cell_coord, Int32 level) const
Method to retrieve the uniqueId of a cell from its position and level.
Int64 parentNodeUniqueIdOfNode(Int64 uid, Int32 level, bool do_fatal=true) const
Method to retrieve the uniqueId of a node's parent.
Int32 nbNodeByCell() const
Method to retrieve the number of nodes in a cell.
void cellUniqueIdsAroundCell(CartCoord3 cell_coord, Int32 level, ArrayView< Int64 > uid) const
Method to retrieve the uniqueIds of the cells around a cell.
CartCoord cellUniqueIdToCoordX(Int64 uid, Int32 level) const
Method to retrieve the X coordinate of a cell using its uniqueId.
Int64 childFaceUniqueIdOfFace(Int64 uid, Int32 level, Int32 child_index_in_parent) const
Method to retrieve the uniqueId of a child face of a parent face based on the child face's index with...
CartCoord nodeUniqueIdToCoordZ(Int64 uid, Int32 level) const
Method to retrieve the Z coordinate of a node using its uniqueId.
Int64 nbNodeInLevel(Int32 level) const
Method allowing retrieval of the total number of nodes in a level.
CartCoord globalNbFacesXCartesianView(Int32 level) const
Method allowing retrieval of the size of the "Cartesian grid" view containing the faces.
Int32 pattern() const
Method allowing retrieval of the refinement pattern used in each cell. For example,...
Cell childCellOfCell(Cell cell, CartCoord3 child_coord_in_parent) const
Method to retrieve a child cell of a parent cell based on the child cell's position within the parent...
Int64 firstCellUniqueId(Int32 level) const
Method allowing retrieval of the first unique ID used by the cells of a level. Calling this method wi...
CartCoord globalNbFacesY(Int32 level) const
Method allowing retrieval of the global number of faces in Y for a level.
CartCoord globalNbCellsX(Int32 level) const
Method allowing retrieval of the global number of cells in X for a level.
CartCoord globalNbFacesZCartesianView(Int32 level) const
Method allowing retrieval of the size of the "Cartesian grid" view containing the faces.
CartCoord globalNbNodesY(Int32 level) const
Method allowing retrieval of the global number of nodes in Y for a level.
Int64 childNodeUniqueIdOfNode(Int64 uid, Int32 level) const
Method to retrieve the uniqueId of a child node of a parent node.
Int64 parentCellUniqueIdOfCell(Int64 uid, Int32 level, bool do_fatal=true) const
Method to retrieve the uniqueId of a cell's parent.
Int64 nodeUniqueId(CartCoord3 node_coord, Int32 level) const
Method to retrieve the uniqueId of a node from its position and level.
CartCoord nodeUniqueIdToCoordX(Int64 uid, Int32 level) const
Method to retrieve the X coordinate of a node using its uniqueId.
void printStatus() const
Method allowing the description of the object's state.
Int64 childCellUniqueIdOfCell(Cell cell, CartCoord3 child_coord_in_parent) const
Method to retrieve the uniqueId of a child cell of a parent cell based on the child cell's position w...
Int64 firstNodeUniqueId(Int32 level) const
Method allowing retrieval of the first unique ID used by the nodes of a level. Calling this method wi...
CartCoord faceUniqueIdToCoordX(Int64 uid, Int32 level) const
Method to retrieve the X coordinate of a face using its uniqueId.
void cellFaceUniqueIds(CartCoord3 cell_coord, Int32 level, ArrayView< Int64 > uid) const
Method to retrieve the uniqueIds of the faces in a cell from its coordinates.
void cellNodeUniqueIds(CartCoord3 cell_coord, Int32 level, ArrayView< Int64 > uid) const
Method to retrieve the uniqueIds of the nodes in a cell from its coordinates.
CartCoord globalNbFacesYCartesianView(Int32 level) const
Method allowing retrieval of the size of the "Cartesian grid" view containing the faces.
CartCoord globalNbFacesX(Int32 level) const
Method allowing retrieval of the global number of faces in X for a level.
CartCoord globalNbCellsZ(Int32 level) const
Method allowing retrieval of the global number of cells in Z for a level.
Int64 faceUniqueId(CartCoord3 face_coord, Int32 level) const
Method to retrieve the uniqueId of a face from its position and level.
CartCoord faceUniqueIdToCoordZ(Int64 uid, Int32 level) const
Method to retrieve the Z coordinate of a face using its uniqueId.
CartCoord3 cellUniqueIdToCoord(Int64 uid, Int32 level) const
Method to retrieve the coordinates of a cell using its uniqueId.
CartCoord faceOffsetLevelToLevel(CartCoord coord, Int32 level_from, Int32 level_to) const
Method allowing retrieval of the position of the first child face starting from the position of the p...
CartCoord offsetLevelToLevel(CartCoord coord, Int32 level_from, Int32 level_to) const
Method allowing retrieval of the position of the first child node/cell starting from the position of ...
CartCoord nodeUniqueIdToCoordY(Int64 uid, Int32 level) const
Method to retrieve the Y coordinate of a node using its uniqueId.
Int32 nodeLevel(Int64 uid) const
Method allowing retrieval of the level of a node given its unique ID.
void cellUniqueIdsAroundNode(CartCoord3 node_coord, Int32 level, ArrayView< Int64 > uid) const
Method to retrieve the uniqueIds of the cells around a node.
Int64 nbFaceInLevel(Int32 level) const
Method allowing retrieval of the total number of faces in a level.
CartCoord globalNbFacesZ(Int32 level) const
Method allowing retrieval of the global number of faces in Z for a level.
CartCoord globalNbNodesX(Int32 level) const
Method allowing retrieval of the global number of nodes in X for a level.
CartCoord cellUniqueIdToCoordZ(Int64 uid, Int32 level) const
Method to retrieve the Z coordinate of a cell using its uniqueId.
Int32 cellLevel(Int64 uid) const
Method allowing retrieval of the level of a cell given its unique ID.
Int64 nbCellInLevel(Int32 level) const
Method allowing retrieval of the total number of cells in a level.
CartCoord cellUniqueIdToCoordY(Int64 uid, Int32 level) const
Method to retrieve the Y coordinate of a cell using its uniqueId.
CartCoord faceUniqueIdToCoordY(Int64 uid, Int32 level) const
Method to retrieve the Y coordinate of a face using its uniqueId.
Int32 faceLevel(Int64 uid) const
Method allowing retrieval of the level of a face given its unique ID.
CartCoord globalNbCellsY(Int32 level) const
Method allowing retrieval of the global number of cells in Y for a level.
Int32 nbFaceByCell() const
Method to retrieve the number of faces in a cell.
Cell of a mesh.
Definition Item.h:1300
Face of a cell.
Definition Item.h:1032
Interface for Cartesian mesh numbering manager.
Node of a mesh.
Definition Item.h:598
Reference to an instance.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 CartCoord
Represents a coordinate of an element in the Cartesian grid (in X or Y or Z).
std::int64_t Int64
Signed integer type of 64 bits.
Int32x2 CartCoord2
Represents the 2D coordinates of an element in the Cartesian grid {x, y}.
std::int32_t Int32
Signed integer type of 32 bits.
Int32x3 CartCoord3
Represents the 3D coordinates of an element in the Cartesian grid {x, y, z}.