Arcane  4.1.12.0
User 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
35class ICartesianMeshNumberingMngInternal;
36
37/*---------------------------------------------------------------------------*/
38/*---------------------------------------------------------------------------*/
39
40/*!
41 * \brief Numbering manager interface for Cartesian mesh.
42 *
43 * In these managers, it is assumed that there is an interval of unique IDs
44 * assigned to each mesh level.
45 *
46 * \warning The mesh must not be renumbered if this numbering is
47 * used.
48 */
49class ARCANE_CARTESIANMESH_EXPORT CartesianMeshNumberingMng
50{
51 public:
52
53 explicit CartesianMeshNumberingMng(ICartesianMesh* mesh);
54
55 public:
56
57 /*!
58 * \brief Method allowing the description of the object's state.
59 */
60 void printStatus() const;
61
62 /*!
63 * \brief Method allowing retrieval of the first unique ID used by the cells of a level.
64 * Calling this method with level and level+1 allows retrieval of the unique ID interval
65 * for a level.
66 *
67 * \param level The level.
68 * \return The first UID of the cells of the level.
69 */
70 Int64 firstCellUniqueId(Int32 level) const;
71
72 /*!
73 * \brief Method allowing retrieval of the first unique ID used by the nodes of a level.
74 * Calling this method with level and level+1 allows retrieval of the unique ID interval
75 * for a level.
76 *
77 * \param level The level.
78 * \return The first UID of the nodes of the level.
79 */
80 Int64 firstNodeUniqueId(Int32 level) const;
81
82 /*!
83 * \brief Method allowing retrieval of the first unique ID used by the faces of a level.
84 * Calling this method with level and level+1 allows retrieval of the unique ID interval
85 * for a level.
86 *
87 * \param level The level.
88 * \return The first UID of the faces of the level.
89 */
90 Int64 firstFaceUniqueId(Int32 level) const;
91
92 /*!
93 * \brief Method allowing retrieval of the global number of cells in X for a level.
94 *
95 * \param level The level.
96 * \return The number of cells in X.
97 */
98 CartCoord globalNbCellsX(Int32 level) const;
99
100 /*!
101 * \brief Method allowing retrieval of the global number of cells in Y for a level.
102 *
103 * \param level The level.
104 * \return The number of cells in Y.
105 */
106 CartCoord globalNbCellsY(Int32 level) const;
107
108 /*!
109 * \brief Method allowing retrieval of the global number of cells in Z for a level.
110 *
111 * \param level The level.
112 * \return The number of cells in Z.
113 */
114 CartCoord globalNbCellsZ(Int32 level) const;
115
116 /*!
117 * \brief Method allowing retrieval of the global number of nodes in X for a level.
118 *
119 * \param level The level.
120 * \return The number of nodes in X.
121 */
122 CartCoord globalNbNodesX(Int32 level) const;
123
124 /*!
125 * \brief Method allowing retrieval of the global number of nodes in Y for a level.
126 *
127 * \param level The level.
128 * \return The number of nodes in Y.
129 */
130 CartCoord globalNbNodesY(Int32 level) const;
131
132 /*!
133 * \brief Method allowing retrieval of the global number of nodes in Z for a level.
134 *
135 * \param level The level.
136 * \return The number of nodes in Z.
137 */
138 CartCoord globalNbNodesZ(Int32 level) const;
139
140 /*!
141 * \brief Method allowing retrieval of the global number of faces in X for a level.
142 *
143 * Let's assume we have the following faces:
144 * ┌─0──┬──2─┐
145 * 4│ 6│ 8│
146 * ├─5──┼─7──┤
147 * 9│ 11│ 13│
148 * └─10─┴─12─┘
149 *
150 * So, we have 2x2 cells.
151 * In X, we have 3 faces.
152 *
153 * For the number of faces in the Cartesian view, see \a globalNbFacesXCartesianView.
154 *
155 * \param level The level.
156 * \return The number of faces in X.
157 */
158 CartCoord globalNbFacesX(Int32 level) const;
159
160 /*!
161 * \brief Method allowing retrieval of the global number of faces in Y for a level.
162 *
163 * Let's assume we have the following faces:
164 * ┌─0──┬──2─┐
165 * 4│ 6│ 8│
166 * ├─5──┼─7──┤
167 * 9│ 11│ 13│
168 * └─10─┴─12─┘
169 *
170 * So, we have 2x2 cells.
171 * In Y, we have 3 faces.
172 *
173 * For the number of faces in the Cartesian view, see \a globalNbFacesYCartesianView.
174 *
175 * \param level The level.
176 * \return The number of faces in Y.
177 */
178 CartCoord globalNbFacesY(Int32 level) const;
179
180 /*!
181 * \brief Method allowing retrieval of the global number of faces in Z for a level.
182 *
183 * Let's assume we have the following faces:
184 * ┌─0──┬──2─┐
185 * 4│ 6│ 8│
186 * ├─5──┼─7──┤
187 * 9│ 11│ 13│
188 * └─10─┴─12─┘
189 *
190 * If we have 2x2x2 cells, we will have 3 faces in Z.
191 *
192 * For the number of faces in the Cartesian view, see \a globalNbFacesZCartesianView.
193 *
194 * \param level The level.
195 * \return The number of faces in Z.
196 */
197 CartCoord globalNbFacesZ(Int32 level) const;
198
199 /*!
200 * \brief Method allowing retrieval of the size of the "Cartesian grid"
201 * view containing the faces.
202 *
203 * In 2D, we can have this view (for a 2x2 cell mesh):
204 * x = 0 1 2 3 4
205 * ┌──┬──┬──┬──┬──┐
206 * y = -1 │ 0│ │ 2│ │ 4│
207 * ┌──┬──┬──┬──┬──┐
208 * y │ │ 1│ │ 3│ │
209 * ├──┼──┼──┼──┼──┤
210 * y = 1 │ 5│ │ 7│ │ 9│
211 * ├──┼──┼──┼──┼──┤
212 * y = 2 │ │ 6│ │ 8│ │
213 * ├──┼──┼──┼──┼──┤
214 * y = 3 │10│ │12│ │14│
215 * ├──┼──┼──┼──┼──┤
216 * y = 4 │ │11│ │13│ │
217 * └──┴──┴──┴──┴──┘
218 * (in this view, the cells are located at odd X and Y
219 * (so here, [1, 1], [3, 1], [1, 3] and [3, 3])).
220 *
221 * \note In 2D, it is considered that we have an imaginary level y=-1.
222 * \warning To start the numbering at 0, in methods returning a 2D face unique ID, we use FaceUID-1.
223 *
224 * And in 3D (for a 2x2x2 cell mesh):
225 * z │ z = 1 │ z = 2 │ z = 3 │ z = 4
226 * x = 0 1 2 3 4 │ 0 1 2 3 4 │ 0 1 2 3 4 │ 0 1 2 3 4 │ 0 1 2 3 4
227 * ┌──┬──┬──┬──┬──┐ │ ┌──┬──┬──┬──┬──┐ │ ┌──┬──┬──┬──┬──┐ │ ┌──┬──┬──┬──┬──┐ │ ┌──┬──┬──┬──┬──┐
228 * y │ │ │ │ │ │ │ │ │24│ │25│ │ │ │ │ │ │ │ │ │ │ │30│ │31│ │ │ │ │ │ │ │ │
229 * ├──┼──┼──┼──┼──┤ │ ├──┼──┼──┼──┼──┤ │ ├──┼──┼──┼──┼──┤ │ ├──┼──┼──┼──┼──┤ │ ├──┼──┼──┼──┼──┤
230 * y = 1 │ │ 0│ │ 1│ │ │ │12│ │13│ │14│ │ │ │ 4│ │ 5│ │ │ │18│ │19│ │20│ │ │ │ 8│ │ 9│ │
231 * ├──┼──┼──┼──┼──┤ │ ├──┼──┼──┼──┼──┤ │ ├──┼──┼──┼──┼──┤ │ ├──┼──┼──┼──┼──┤ │ ├──┼──┼──┼──┼──┤
232 * y = 2 │ │ │ │ │ │ │ │ │26│ │27│ │ │ │ │ │ │ │ │ │ │ │32│ │33│ │ │ │ │ │ │ │ │
233 * ├──┼──┼──┼──┼──┤ │ ├──┼──┼──┼──┼──┤ │ ├──┼──┼──┼──┼──┤ │ ├──┼──┼──┼──┼──┤ │ ├──┼──┼──┼──┼──┤
234 * y = 3 │ │ 2│ │ 3│ │ │ │15│ │16│ │17│ │ │ │ 6│ │ 7│ │ │ │21│ │22│ │23│ │ │ │10│ │11│ │
235 * ├──┼──┼──┼──┼──┤ │ ├──┼──┼──┼──┼──┤ │ ├──┼──┼──┼──┼──┤ │ ├──┼──┼──┼──┼──┤ │ ├──┼──┼──┼──┼──┤
236 * y = 4 │ │ │ │ │ │ │ │ │28│ │29│ │ │ │ │ │ │ │ │ │ │ │34│ │35│ │ │ │ │ │ │ │ │
237 * └──┴──┴──┴──┴──┘ │ └──┴──┴──┴──┴──┘ │ └──┴──┴──┴──┴──┘ │ └──┴──┴──┴──┴──┘ │ └──┴──┴──┴──┴──┘
238 * │ │ │ │
239 *
240 * (in this view, the cells are located at odd X, Y, and Z
241 * (so here, [1, 1, 1], [3, 1, 1], [1, 3, 1], &c)).
242 *
243 * \param level The level.
244 * \return The size of the grid in X.
245 */
247
248 /*!
249 * \brief Method allowing retrieval of the size of the "Cartesian grid"
250 * view containing the faces.
251 *
252 * An example of this view is available in the documentation of \a globalNbFacesXCartesianView.
253 *
254 * \param level The level.
255 * \return The size of the grid in Y.
256 */
258
259 /*!
260 * \brief Method allowing retrieval of the size of the "Cartesian grid"
261 * view containing the faces.
262 *
263 * An example of this view is available in the documentation of \a globalNbFacesXCartesianView.
264 *
265 * \param level The level.
266 * \return The size of the grid in Z.
267 */
269
270 /*!
271 * \brief Method allowing retrieval of the total number of cells in a level.
272 *
273 * \param level The level.
274 * \return The number of cells in the level.
275 */
276 Int64 nbCellInLevel(Int32 level) const;
277
278 /*!
279 * \brief Method allowing retrieval of the total number of nodes in a level.
280 *
281 * \param level The level.
282 * \return The number of nodes in the level.
283 */
284 Int64 nbNodeInLevel(Int32 level) const;
285
286 /*!
287 * \brief Method allowing retrieval of the total number of faces in a level.
288 *
289 * \param level The level.
290 * \return The number of faces in the level.
291 */
292 Int64 nbFaceInLevel(Int32 level) const;
293
294 /*!
295 * \brief Method allowing retrieval of the refinement pattern used in each cell.
296 * For example, if the pattern is 2, each parent cell will have 2*2 child cells (2*2*2 in 3D).
297 *
298 * \return The refinement pattern.
299 */
300 Int32 pattern() const;
301
302 /*!
303 * \brief Method allowing retrieval of the level of a cell given its unique ID.
304 *
305 * \param uid The unique ID of the cell.
306 * \return The level of the cell.
307 */
308 Int32 cellLevel(Int64 uid) const;
309
310 /*!
311 * \brief Method allowing retrieval of the level of a node given its unique ID.
312 *
313 * \param uid The unique ID of the node.
314 * \return The level of the node.
315 */
316 Int32 nodeLevel(Int64 uid) const;
317
318 /*!
319 * \brief Method allowing retrieval of the level of a face given its unique ID.
320 *
321 * \param uid The unique ID of the face.
322 * \return The level of the face.
323 */
324 Int32 faceLevel(Int64 uid) const;
325
326 /*!
327 * \brief Method allowing retrieval of the position of the first child node/cell starting from the position
328 * of the parent node/cell.
329 *
330 * Example: if we have a 2D mesh of 2*2 cells and a refinement pattern of 2,
331 * we know that the level 1 grid (for level 1 patches) will be 4*4 cells.
332 * The first child node/cell of the parent node/cell (Xp=1,Yp=0) will have the position Xf=Xp*Pattern=2 (same for Y).
333 *
334 * \param coord The X, Y, or Z position of the parent node/cell.
335 * \param level_from The parent level.
336 * \param level_to The child level.
337 * \return The position of the first child of the parent node/cell.
338 */
339 CartCoord offsetLevelToLevel(CartCoord coord, Int32 level_from, Int32 level_to) const;
340
341 /*!
342 * \brief Method allowing retrieval of the position of the first child face starting from the position
343 * of the parent face.
344 *
345 * Note: The coordinates used here are the coordinates of the faces in the "Cartesian view"
346 * (see \a globalNbFacesXCartesianView ).
347 *
348 * \param coord The X, Y, or Z position of the parent face.
349 * \param level_from The parent level.
350 * \param level_to The child level.
351 * \return The position of the parent face's first child.
352 */
353 CartCoord faceOffsetLevelToLevel(CartCoord coord, Int32 level_from, Int32 level_to) const;
354
355 /*!
356 * \brief Method to retrieve the coordinates of a cell using its uniqueId.
357 *
358 * \param uid The uniqueId of the cell.
359 * \param level The level of the cell.
360 * \return The position of the cell.
361 */
362 CartCoord3 cellUniqueIdToCoord(Int64 uid, Int32 level) const;
363
364 /*!
365 * \brief Method to retrieve the coordinates of a cell.
366 *
367 * \param cell The cell.
368 * \return The position of the cell.
369 */
371
372 /*!
373 * \brief Method to retrieve the X coordinate of a cell using its uniqueId.
374 *
375 * \param uid The uniqueId of the cell.
376 * \param level The level of the cell.
377 * \return The X position of the cell.
378 */
379 CartCoord cellUniqueIdToCoordX(Int64 uid, Int32 level) const;
380
381 /*!
382 * \brief Method to retrieve the X coordinate of a cell.
383 *
384 * \param cell The cell.
385 * \return The X position of the cell.
386 */
388
389 /*!
390 * \brief Method to retrieve the Y coordinate of a cell using its uniqueId.
391 *
392 * \param uid The uniqueId of the cell.
393 * \param level The level of the cell.
394 * \return The Y position of the cell.
395 */
396 CartCoord cellUniqueIdToCoordY(Int64 uid, Int32 level) const;
397
398 /*!
399 * \brief Method to retrieve the Y coordinate of a cell.
400 *
401 * \param cell The cell.
402 * \return The Y position of the cell.
403 */
405
406 /*!
407 * \brief Method to retrieve the Z coordinate of a cell using its uniqueId.
408 *
409 * \param uid The uniqueId of the cell.
410 * \param level The level of the cell.
411 * \return The Z position of the cell.
412 */
413 CartCoord cellUniqueIdToCoordZ(Int64 uid, Int32 level) const;
414
415 /*!
416 * \brief Method to retrieve the Z coordinate of a cell.
417 *
418 * \param cell The cell.
419 * \return The Z position of the cell.
420 */
422
423 /*!
424 * \brief Method to retrieve the X coordinate of a node using its uniqueId.
425 *
426 * \param uid The uniqueId of the node.
427 * \param level The level of the node.
428 * \return The X position of the node.
429 */
430 CartCoord nodeUniqueIdToCoordX(Int64 uid, Int32 level) const;
431
432 /*!
433 * \brief Method to retrieve the X coordinate of a node.
434 *
435 * \param node The node.
436 * \return The X position of the node.
437 */
439
440 /*!
441 * \brief Method to retrieve the Y coordinate of a node using its uniqueId.
442 *
443 * \param uid The uniqueId of the node.
444 * \param level The level of the node.
445 * \return The Y position of the node.
446 */
447 CartCoord nodeUniqueIdToCoordY(Int64 uid, Int32 level) const;
448
449 /*!
450 * \brief Method to retrieve the Y coordinate of a node.
451 *
452 * \param node The node.
453 * \return The Y position of the node.
454 */
456
457 /*!
458 * \brief Method to retrieve the Z coordinate of a node using its uniqueId.
459 *
460 * \param uid The uniqueId of the node.
461 * \param level The level of the node.
462 * \return The Z position of the node.
463 */
464 CartCoord nodeUniqueIdToCoordZ(Int64 uid, Int32 level) const;
465
466 /*!
467 * \brief Method to retrieve the Z coordinate of a node.
468 *
469 * \param node The node.
470 * \return The Z position of the node.
471 */
473
474 /*!
475 * \brief Method to retrieve the X coordinate of a face using its uniqueId.
476 *
477 * Note: The coordinates used here are the coordinates of the faces in "Cartesian view"
478 * (see \a globalNbFacesXCartesianView ).
479 *
480 * \param uid The uniqueId of the face.
481 * \param level The level of the face.
482 * \return The X position of the face.
483 */
484 CartCoord faceUniqueIdToCoordX(Int64 uid, Int32 level) const;
485
486 /*!
487 * \brief Method to retrieve the X coordinate of a face.
488 *
489 * Note: The coordinates used here are the coordinates of the faces in "Cartesian view"
490 * (see \a globalNbFacesXCartesianView ).
491 *
492 * \param face The face.
493 * \return The X position of the face.
494 */
496
497 /*!
498 * \brief Method to retrieve the Y coordinate of a face using its uniqueId.
499 *
500 * Note: The coordinates used here are the coordinates of the faces in "Cartesian view"
501 * (see \a globalNbFacesXCartesianView ).
502 *
503 * \param uid The uniqueId of the face.
504 * \param level The level of the face.
505 * \return The Y position of the face.
506 */
507 CartCoord faceUniqueIdToCoordY(Int64 uid, Int32 level) const;
508
509 /*!
510 * \brief Method to retrieve the Y coordinate of a face.
511 *
512 * Note: The coordinates used here are the coordinates of the faces in "Cartesian view"
513 * (see \a globalNbFacesXCartesianView ).
514 *
515 * \param face The face.
516 * \return The Y position of the face.
517 */
519
520 /*!
521 * \brief Method to retrieve the Z coordinate of a face using its uniqueId.
522 *
523 * Note: The coordinates used here are the coordinates of the faces in "Cartesian view"
524 * (see \a globalNbFacesXCartesianView ).
525 *
526 * \param uid The uniqueId of the face.
527 * \param level The level of the face.
528 * \return The Z position of the face.
529 */
530 CartCoord faceUniqueIdToCoordZ(Int64 uid, Int32 level) const;
531
532 /*!
533 * \brief Method to retrieve the Z coordinate of a face.
534 *
535 * Note: The coordinates used here are the coordinates of the faces in "Cartesian view"
536 * (see \a globalNbFacesXCartesianView ).
537 *
538 * \param face The face.
539 * \return The Z position of the face.
540 */
542
543 /*!
544 * \brief Method to retrieve the uniqueId of a cell from its position and level.
545 *
546 * \param cell_coord The position of the cell.
547 * \param level The level of the cell.
548 * \return The uniqueId of the cell.
549 */
550 Int64 cellUniqueId(CartCoord3 cell_coord, Int32 level) const;
551
552 /*!
553 * \brief Method to retrieve the uniqueId of a cell from its position and level.
554 *
555 * \param cell_coord The position of the cell.
556 * \param level The level of the cell.
557 * \return The uniqueId of the cell.
558 */
559 Int64 cellUniqueId(CartCoord2 cell_coord, Int32 level) const;
560
561 /*!
562 * \brief Method to retrieve the uniqueId of a node from its position and level.
563 *
564 * \param node_coord The position of the node.
565 * \param level The level of the node.
566 * \return The uniqueId of the node.
567 */
568 Int64 nodeUniqueId(CartCoord3 node_coord, Int32 level) const;
569
570 /*!
571 * \brief Method to retrieve the uniqueId of a node from its position and level.
572 *
573 * \param node_coord The position of the node.
574 * \param level The level of the node.
575 * \return The uniqueId of the node.
576 */
577 Int64 nodeUniqueId(CartCoord2 node_coord, Int32 level) const;
578
579 /*!
580 * \brief Method to retrieve the uniqueId of a face from its position and level.
581 *
582 * Note: The coordinates used here are the coordinates of the faces in "Cartesian view"
583 * (see \a globalNbFacesXCartesianView ).
584 *
585 * \param face_coord The position of the face.
586 * \param level The level of the face.
587 * \return The uniqueId of the face.
588 */
589 Int64 faceUniqueId(CartCoord3 face_coord, Int32 level) const;
590
591 /*!
592 * \brief Method to retrieve the uniqueId of a face from its position and level.
593 *
594 * Note: The coordinates used here are the coordinates of the faces in "Cartesian view"
595 * (see \a globalNbFacesXCartesianView ).
596 *
597 * \param face_coord The position of the face.
598 * \param level The level of the face.
599 * \return The uniqueId of the face.
600 */
601 Int64 faceUniqueId(CartCoord2 face_coord, Int32 level) const;
602
603 /*!
604 * \brief Method to retrieve the number of nodes in a cell.
605 *
606 * \return The number of nodes in a cell.
607 */
608 Int32 nbNodeByCell() const;
609
610 /*!
611 * \brief Method to retrieve the uniqueIds of the nodes in a cell from its coordinates.
612 *
613 * The order in which the uniqueIds are placed corresponds to the enumeration order of the nodes
614 * of an Arcane cell.
615 * 3--2
616 * ^y | |
617 * | 0--1
618 * ->x
619 *
620 * \param cell_coord The position of the cell.
621 * \param level The level of the cell (and thus of the nodes).
622 * \param uid [OUT] The uniqueIds of the cell. The size of the ArrayView must be equal to nbNodeByCell().
623 */
624 void cellNodeUniqueIds(CartCoord3 cell_coord, Int32 level, ArrayView<Int64> uid) const;
625
626 /*!
627 * \brief Method to retrieve the uniqueIds of the nodes in a cell from its coordinates.
628 *
629 * The order in which the uniqueIds are placed corresponds to the enumeration order of the nodes
630 * of an Arcane cell.
631 * 3--2
632 * ^y | |
633 * | 0--1
634 * ->x
635 *
636 * \param cell_coord The position of the cell.
637 * \param level The level of the cell (and thus of the nodes).
638 * \param uid [OUT] The uniqueIds of the cell. The size of the ArrayView must be equal to nbNodeByCell().
639 */
640 void cellNodeUniqueIds(CartCoord2 cell_coord, Int32 level, ArrayView<Int64> uid) const;
641
642 /*!
643 * \brief Method to retrieve the uniqueIds of the nodes in a cell from its uniqueId.
644 *
645 * The order in which the uniqueIds are placed corresponds to the enumeration order of the nodes
646 * of an Arcane cell.
647 * 3--2
648 * ^y | |
649 * | 0--1
650 * ->x
651 *
652 * \param cell_uid The uniqueId of the cell.
653 * \param level The level of the cell (and thus of the nodes).
654 * \param uid [OUT] The uniqueIds of the cell. The size of the ArrayView must be equal to nbNodeByCell().
655 */
656 void cellNodeUniqueIds(Int64 cell_uid, Int32 level, ArrayView<Int64> uid) const;
657
658 /*!
659 * \brief Method to retrieve the uniqueIds of the nodes in a cell.
660 *
661 * The order in which the uniqueIds are placed corresponds to the enumeration order of the nodes
662 * of an Arcane cell.
663 * 3--2
664 * ^y | |
665 * | 0--1
666 * ->x
667 *
668 * \param cell The cell.
669 * \param uid [OUT] The uniqueIds of the cell. The size of the ArrayView must be equal to nbNodeByCell().
670 */
671 void cellNodeUniqueIds(Cell cell, ArrayView<Int64> uid) const;
672
673 /*!
674 * \brief Method to retrieve the number of faces in a cell.
675 *
676 * \return The number of faces in a cell.
677 */
678 Int32 nbFaceByCell() const;
679
680 /*!
681 * \brief Method to retrieve the uniqueIds of the faces in a cell from its coordinates.
682 *
683 * The order in which the uniqueIds are placed corresponds to the enumeration order of the faces
684 * of an Arcane cell.
685 * -2-
686 * ^y 3 1
687 * | -0-
688 * ->x
689 *
690 * \param cell_coord The position of the cell.
691 * \param level The level of the cell (and thus of the faces).
692 * \param uid [OUT] The uniqueIds of the cell. The size of the ArrayView must be equal to nbFaceByCell().
693 */
694 void cellFaceUniqueIds(CartCoord3 cell_coord, Int32 level, ArrayView<Int64> uid) const;
695
696 /*!
697 * \brief Method to retrieve the uniqueIds of the faces of a cell from its coordinates.
698 *
699 * The order in which the uniqueIds are placed corresponds to the enumeration order of the faces
700 * of an Arcane cell.
701 * -2-
702 * ^y 3 1
703 * | -0-
704 * ->x
705 *
706 * \param cell_coord The position of the cell.
707 * \param level The level of the cell (and thus of the faces).
708 * \param uid [OUT] The uniqueIds of the cell. The size of the ArrayView must be equal to nbFaceByCell().
709 */
710 void cellFaceUniqueIds(CartCoord2 cell_coord, Int32 level, ArrayView<Int64> uid) const;
711
712 /*!
713 * \brief Method to retrieve the uniqueIds of the faces of a cell from its uniqueId.
714 *
715 * The order in which the uniqueIds are placed corresponds to the enumeration order of the faces
716 * of an Arcane cell.
717 * -2-
718 * ^y 3 1
719 * | -0-
720 * ->x
721 *
722 * \param cell_uid The uniqueId of the cell.
723 * \param level The level of the cell (and thus of the faces).
724 * \param uid [OUT] The uniqueIds of the cell. The size of the ArrayView must be equal to nbFaceByCell().
725 */
726 void cellFaceUniqueIds(Int64 cell_uid, Int32 level, ArrayView<Int64> uid) const;
727
728 /*!
729 * \brief Method to retrieve the uniqueIds of the faces of a cell.
730 *
731 * The order in which the uniqueIds are placed corresponds to the enumeration order of the faces
732 * of an Arcane cell.
733 * -2-
734 * ^y 3 1
735 * | -0-
736 * ->x
737 *
738 * \param cell The cell.
739 * \param uid [OUT] The uniqueIds of the cell. The size of the ArrayView must be equal to nbFaceByCell().
740 */
741 void cellFaceUniqueIds(Cell cell, ArrayView<Int64> uid) const;
742
743 /*!
744 * \brief Method to retrieve the uniqueIds of the cells around a cell.
745 *
746 * If there is no cell in a surrounding location (e.g., if we are at the edge of the mesh),
747 * a uniqueId of -1 is set.
748 *
749 * The passed view must have a size of 27.
750 *
751 * \param cell_coord The position of the cell.
752 * \param level The level of the cell at the center.
753 * \param uid [OUT] The uniqueIds of the surrounding cells.
754 */
755 void cellUniqueIdsAroundCell(CartCoord3 cell_coord, Int32 level, ArrayView<Int64> uid) const;
756
757 /*!
758 * \brief Method to retrieve the uniqueIds of the cells around a cell.
759 *
760 * If there is no cell in a surrounding location (e.g., if we are at the edge of the mesh),
761 * a uniqueId of -1 is set.
762 *
763 * The passed view must have a size of 9.
764 *
765 * \param cell_coord The position of the cell.
766 * \param level The level of the cell at the center.
767 * \param uid [OUT] The uniqueIds of the surrounding cells.
768 */
769 void cellUniqueIdsAroundCell(CartCoord2 cell_coord, Int32 level, ArrayView<Int64> uid) const;
770
771 /*!
772 * \brief Method to retrieve the uniqueIds of the cells around the cell passed as a parameter.
773 *
774 * If there is no cell in a surrounding location (e.g., if we are at the edge of the mesh),
775 * a uniqueId of -1 is set.
776 *
777 * The passed view must have a size of 9 in 2D and 27 in 3D.
778 *
779 * \param cell_uid The uniqueId of the cell at the center.
780 * \param level The level of the cell at the center.
781 * \param uid [OUT] The uniqueIds of the surrounding cells.
782 */
783 void cellUniqueIdsAroundCell(Int64 cell_uid, Int32 level, ArrayView<Int64> uid) const;
784
785 /*!
786 * \brief Method to retrieve the uniqueIds of the cells around the cell passed as a parameter.
787 *
788 * If there is no cell in a surrounding location (e.g., if we are at the edge of the mesh),
789 * a uniqueId of -1 is set.
790 *
791 * The passed view must have a size of 9 in 2D and 27 in 3D.
792 *
793 * \param cell The cell at the center.
794 * \param uid [OUT] The uniqueIds of the surrounding cells.
795 */
796 void cellUniqueIdsAroundCell(Cell cell, ArrayView<Int64> uid) const;
797
798 /*!
799 * \brief Method to retrieve the uniqueIds of the cells around a node.
800 *
801 * If there is no cell in a surrounding location (e.g., if we are at the edge of the mesh),
802 * a uniqueId of -1 is set.
803 *
804 * The passed view must have a size of 8.
805 *
806 * \param node_coord The position of the node.
807 * \param level The level of the node.
808 * \param uid [OUT] The uniqueIds of the surrounding cells.
809 */
810 void cellUniqueIdsAroundNode(CartCoord3 node_coord, Int32 level, ArrayView<Int64> uid) const;
811
812 /*!
813 * \brief Method to retrieve the uniqueIds of the cells around a node.
814 *
815 * If there is no cell in a surrounding location (e.g., if we are at the edge of the mesh),
816 * a uniqueId of -1 is set.
817 *
818 * The passed view must have a size of 4.
819 *
820 * \param node_coord The position of the node.
821 * \param level The level of the node.
822 * \param uid [OUT] The uniqueIds of the surrounding cells.
823 */
824 void cellUniqueIdsAroundNode(CartCoord2 node_coord, Int32 level, ArrayView<Int64> uid) const;
825
826 /*!
827 * \brief Method to retrieve the uniqueIds of the cells around the node passed as a parameter.
828 *
829 * If there is no cell in a surrounding location (e.g., if we are at the edge of the mesh),
830 * a uniqueId of -1 is set.
831 *
832 * The passed view must have a size of 4 in 2D or 8 in 3D.
833 *
834 * \param node_uid The uniqueId of the node.
835 * \param level The level of the node.
836 * \param uid [OUT] The uniqueIds of the surrounding cells.
837 */
838 void cellUniqueIdsAroundNode(Int64 node_uid, Int32 level, ArrayView<Int64> uid) const;
839
840 /*!
841 * \brief Method to retrieve the uniqueIds of the cells around the node passed as a parameter.
842 *
843 * If there is no cell in a surrounding location (e.g., if we are at the edge of the mesh),
844 * a uniqueId of -1 is set.
845 *
846 * The passed view must have a size of 4 in 2D or 8 in 3D.
847 *
848 * \param node The node.
849 * \param uid [OUT] The uniqueIds of the surrounding cells.
850 */
851 void cellUniqueIdsAroundNode(Node node, ArrayView<Int64> uid) const;
852
853 /*!
854 * \brief Method to retrieve the uniqueId of a cell's parent.
855 *
856 * If \a do_fatal is true, a fatal error is generated if the parent does not exist; otherwise, the returned uniqueId has the value NULL_ITEM_UNIQUE_ID.
857 *
858 * \param uid The uniqueId of the child cell.
859 * \param level The level of the child cell.
860 * \return The uniqueId of the parent cell of the cell passed as a parameter.
861 */
862 Int64 parentCellUniqueIdOfCell(Int64 uid, Int32 level, bool do_fatal = true) const;
863
864 /*!
865 * \brief Method to retrieve the uniqueId of a cell's parent.
866 *
867 * If \a do_fatal is true, a fatal error is generated if the parent does not exist; otherwise, the returned uniqueId has the value NULL_ITEM_UNIQUE_ID.
868 *
869 * \param cell The child cell.
870 * \return The uniqueId of the parent cell of the cell passed as a parameter.
871 */
872 Int64 parentCellUniqueIdOfCell(Cell cell, bool do_fatal = true) const;
873
874 /*!
875 * \brief Method to retrieve the uniqueId of a child cell of a parent cell based on the child cell's position within the parent cell.
876 *
877 * \param cell The parent cell.
878 * \param child_coord_in_parent The position of the child within the parent cell.
879 * \return The uniqueId of the requested child cell.
880 */
881 Int64 childCellUniqueIdOfCell(Cell cell, CartCoord3 child_coord_in_parent) const;
882
883 /*!
884 * \brief Method to retrieve the uniqueId of a child cell of a parent cell based on the child cell's position within the parent cell.
885 *
886 * \param cell The parent cell.
887 * \param child_coord_in_parent The position of the child within the parent cell.
888 * \return The uniqueId of the requested child cell.
889 */
890 Int64 childCellUniqueIdOfCell(Cell cell, CartCoord2 child_coord_in_parent) const;
891
892 /*!
893 * \brief Method to retrieve the uniqueId of a child cell of a parent cell based on the child cell's index within the parent cell.
894 *
895 * \param cell The parent cell.
896 * \param child_index_in_parent The index of the child within the parent cell.
897 * \return The uniqueId of the requested child cell.
898 */
899 Int64 childCellUniqueIdOfCell(Cell cell, Int32 child_index_in_parent) const;
900
901 /*!
902 * \brief Method to retrieve a child cell of a parent cell based on the child cell's position within the parent cell.
903 *
904 * \param cell The parent cell.
905 * \param child_coord_in_parent The position of the child within the parent cell.
906 * \return The requested child cell.
907 */
908 Cell childCellOfCell(Cell cell, CartCoord3 child_coord_in_parent) const;
909
910 /*!
911 * \brief Method to retrieve a child cell of a parent cell based on the child cell's position within the parent cell.
912 *
913 * \param cell The parent cell.
914 * \param child_coord_in_parent The position of the child within the parent cell.
915 * \return The requested child cell.
916 */
917 Cell childCellOfCell(Cell cell, CartCoord2 child_coord_in_parent) const;
918
919 /*!
920 * \brief Method to retrieve the uniqueId of a node's parent.
921 *
922 * If \a do_fatal is true, a fatal error is generated if the parent does not exist; otherwise, the returned uniqueId has the value NULL_ITEM_UNIQUE_ID.
923 *
924 * \param uid The uniqueId of the child node.
925 * \param level The level of the child node.
926 * \return The uniqueId of the parent node of the child node.
927 */
928 Int64 parentNodeUniqueIdOfNode(Int64 uid, Int32 level, bool do_fatal = true) const;
929
930 /*!
931 * \brief Method to retrieve the uniqueId of a node's parent.
932 *
933 * If \a do_fatal is true, a fatal error is generated if the parent does not exist; otherwise, the returned uniqueId has the value NULL_ITEM_UNIQUE_ID.
934 *
935 * \param node The child node.
936 * \return The uniqueId of the parent node of the node passed as a parameter.
937 */
938 Int64 parentNodeUniqueIdOfNode(Node node, bool do_fatal = true) const;
939
940 /*!
941 * \brief Method to retrieve the uniqueId of a child node of a parent node.
942 *
943 * \param uid The uniqueId of the child node.
944 * \param level The level of the child node.
945 * \return The uniqueId of the requested child node.
946 */
947 Int64 childNodeUniqueIdOfNode(Int64 uid, Int32 level) const;
948
949 /*!
950 * \brief Method to retrieve the uniqueId of a child node of a parent node.
951 *
952 * \param node The parent node.
953 * \return The uniqueId of the requested child node.
954 */
956
957 /*!
958 * \brief Method to retrieve the uniqueId of a face's parent.
959 *
960 * If \a do_fatal is true, a fatal error is generated if the parent does not exist; otherwise, the returned uniqueId has the value NULL_ITEM_UNIQUE_ID.
961 *
962 * \param uid The uniqueId of the child face.
963 * \param level The level of the child face.
964 * \return The uniqueId of the parent face of the child face.
965 */
966 Int64 parentFaceUniqueIdOfFace(Int64 uid, Int32 level, bool do_fatal = true) const;
967
968 /*!
969 * \brief Method to retrieve the uniqueId of a face's parent.
970 *
971 * If \a do_fatal is true, a fatal error is generated if the parent does not exist; otherwise, the returned uniqueId has the value NULL_ITEM_UNIQUE_ID.
972 *
973 * \param face The child face.
974 * \return The uniqueId of the parent face of the face passed as a parameter.
975 */
976 Int64 parentFaceUniqueIdOfFace(Face face, bool do_fatal = true) const;
977
978 /*!
979 * \brief Method to retrieve the uniqueId of a child face of a parent face based on the child face's index within the parent face.
980 *
981 * \param uid The uniqueId of the parent face.
982 * \param level The level of the parent face.
983 * \param child_index_in_parent The index of the child within the parent face.
984 * \return The uniqueId of the requested child face.
985 */
986 Int64 childFaceUniqueIdOfFace(Int64 uid, Int32 level, Int32 child_index_in_parent) const;
987
988 /*!
989 * \brief Method to retrieve the uniqueId of a child face of a parent face based on the child face's index within the parent face.
990 *
991 * \param face The parent face.
992 * \param child_index_in_parent The index of the child within the parent face.
993 * \return The uniqueId of the requested child face.
994 */
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
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}.