17#include "arcane/cartesianmesh/internal/CartesianMeshNumberingMngInternal.h"
19#include "arcane/utils/Vector2.h"
20#include "arcane/utils/ITraceMng.h"
22#include "arcane/core/IMesh.h"
23#include "arcane/core/IParallelMng.h"
24#include "arcane/core/VariableTypes.h"
25#include "arcane/core/ICartesianMeshGenerationInfo.h"
26#include "arcane/core/IItemFamily.h"
27#include "arcane/core/IMeshModifier.h"
28#include "arcane/core/Properties.h"
39CartesianMeshNumberingMngInternal::
40CartesianMeshNumberingMngInternal(
IMesh*
mesh)
43, m_dimension(
mesh->dimension())
47, m_converting_numbering_face(true)
51 const auto* m_generation_info = ICartesianMeshGenerationInfo::getReference(m_mesh,
true);
52 ConstArrayView<Int64> global_nb_cells_by_direction = m_generation_info->globalNbCells();
54 const Int64x3 nb_cell_ground = {
55 global_nb_cells_by_direction[
MD_DirX],
56 global_nb_cells_by_direction[
MD_DirY],
57 ((m_dimension == 2) ? 1 : global_nb_cells_by_direction[
MD_DirZ])
60 m_nb_cell_ground.x =
static_cast<CartCoordType
>(nb_cell_ground.x);
61 m_nb_cell_ground.y =
static_cast<CartCoordType
>(nb_cell_ground.y);
62 m_nb_cell_ground.z =
static_cast<CartCoordType
>(nb_cell_ground.z);
64 if (nb_cell_ground.x <= 0)
65 ARCANE_FATAL(
"Bad value '{0}' for globalNbCells()[MD_DirX] (should be >0)", nb_cell_ground.x);
66 if (nb_cell_ground.y <= 0)
67 ARCANE_FATAL(
"Bad value '{0}' for globalNbCells()[MD_DirY] (should be >0)", nb_cell_ground.y);
68 if (nb_cell_ground.z <= 0)
69 ARCANE_FATAL(
"Bad value '{0}' for globalNbCells()[MD_DirZ] (should be >0)", nb_cell_ground.z);
71 if (m_dimension == 2) {
72 m_latest_cell_uid = nb_cell_ground.x * nb_cell_ground.y;
73 m_latest_node_uid = (nb_cell_ground.x + 1) * (nb_cell_ground.y + 1);
74 m_latest_face_uid = (nb_cell_ground.x * nb_cell_ground.y) * 2 + nb_cell_ground.x * 2 + nb_cell_ground.y;
77 m_latest_cell_uid = nb_cell_ground.x * nb_cell_ground.y * nb_cell_ground.z;
78 m_latest_node_uid = (nb_cell_ground.x + 1) * (nb_cell_ground.y + 1) * (nb_cell_ground.z + 1);
79 m_latest_face_uid = (nb_cell_ground.x + 1) * nb_cell_ground.y * nb_cell_ground.z + (nb_cell_ground.y + 1) * nb_cell_ground.z * nb_cell_ground.x + (nb_cell_ground.z + 1) * nb_cell_ground.x * nb_cell_ground.y;
83 m_first_cell_uid_level.add(0);
84 m_first_node_uid_level.add(0);
85 m_first_face_uid_level.add(0);
90 if (m_converting_numbering_face) {
91 UniqueArray<Int64> face_uid(CartesianMeshNumberingMngInternal::nbFaceByCell());
92 ENUMERATE_ (Cell, icell, m_mesh->allLevelCells(0)) {
93 CartesianMeshNumberingMngInternal::cellFaceUniqueIds(icell->uniqueId(), 0, face_uid);
94 for (Integer i = 0; i < CartesianMeshNumberingMngInternal::nbFaceByCell(); ++i) {
95 m_face_ori_numbering_to_new[icell->face(i).uniqueId()] = face_uid[i];
96 m_face_new_numbering_to_ori[face_uid[i]] = icell->face(i).uniqueId();
106void CartesianMeshNumberingMngInternal::
109 m_properties =
makeRef(
new Properties(*(m_mesh->properties()),
"CartesianMeshNumberingMngInternal"));
115void CartesianMeshNumberingMngInternal::
116saveInfosInProperties()
118 m_properties->set(
"Version", 1);
119 m_properties->set(
"FirstCellUIDByLevel", m_first_cell_uid_level);
122 m_properties->set(
"FirstNodeUIDByLevel", m_first_node_uid_level);
123 m_properties->set(
"FirstFaceUIDByLevel", m_first_face_uid_level);
125 m_properties->set(
"OriginalGroundLevelForConverting", m_ori_level);
131void CartesianMeshNumberingMngInternal::
134 Int32 v = m_properties->getInt32(
"Version");
136 ARCANE_FATAL(
"Bad numbering mng version: trying to read from incompatible checkpoint v={0} expected={1}", v, 1);
138 m_properties->get(
"FirstCellUIDByLevel", m_first_cell_uid_level);
139 m_properties->get(
"FirstNodeUIDByLevel", m_first_node_uid_level);
140 m_properties->get(
"FirstFaceUIDByLevel", m_first_face_uid_level);
142 m_properties->get(
"OriginalGroundLevelForConverting", m_ori_level);
143 if (m_ori_level == -1) {
144 m_converting_numbering_face =
false;
145 m_face_ori_numbering_to_new.clear();
146 m_face_new_numbering_to_ori.clear();
149 m_nb_cell_ground = { globalNbCellsX(0), globalNbCellsY(0), globalNbCellsZ(0) };
151 m_max_level = m_first_cell_uid_level.size() - 1;
157 for (
const Int64 elem : m_first_cell_uid_level) {
164 m_latest_cell_uid = m_first_cell_uid_level[pos] + nbCellInLevel(pos);
165 m_latest_node_uid = m_first_node_uid_level[pos] + nbNodeInLevel(pos);
166 m_latest_face_uid = m_first_face_uid_level[pos] + nbFaceInLevel(pos);
173void CartesianMeshNumberingMngInternal::
174renumberingFacesLevel0FromOriginalArcaneNumbering()
176 if (!m_converting_numbering_face)
184 icell->face(i).mutableItemBase().setUniqueId(face_uid[i]);
187 m_mesh->faceFamily()->notifyItemsUniqueIdChanged();
188 m_mesh->modifier()->endUpdate();
189 m_mesh->checkValidMesh();
191 m_converting_numbering_face =
false;
193 m_face_ori_numbering_to_new.clear();
194 m_face_new_numbering_to_ori.clear();
200void CartesianMeshNumberingMngInternal::
206 tm->
info() <<
"CartesianMeshNumberingMngInternal status :";
212 tm->
info() <<
"LatestCellUID : " << m_latest_cell_uid;
213 tm->
info() <<
"LatestNodeUID : " << m_latest_node_uid;
214 tm->
info() <<
"LatestFaceUID : " << m_latest_face_uid;
216 tm->
info() <<
"MinLevel : " << m_min_level;
217 tm->
info() <<
"MaxLevel : " << m_max_level;
219 tm->
info() <<
"GroundLevelNbCells : " << m_nb_cell_ground;
221 if (m_ori_level == -1) {
222 tm->
info() <<
"Ground Level is renumbered";
225 tm->
info() <<
"Ground Level is not renumbered -- OriginalGroundLevel : " << m_ori_level;
228 for (
Integer i = m_min_level; i <= m_max_level; ++i) {
229 tm->
info() <<
"Level " << i <<
" : ";
235 const auto* m_generation_info = ICartesianMeshGenerationInfo::getReference(m_mesh,
true);
238 tm->
info() <<
"global_nb_cells_by_direction.x : " << global_nb_cells_by_direction[
MD_DirX];
239 tm->
info() <<
"global_nb_cells_by_direction.y : " << global_nb_cells_by_direction[
MD_DirY];
240 tm->
info() <<
"global_nb_cells_by_direction.z : " << global_nb_cells_by_direction[
MD_DirZ];
246void CartesianMeshNumberingMngInternal::
247prepareLevel(
Int32 level)
249 if (level <= m_max_level && level >= m_min_level)
251 if (level == m_max_level + 1) {
253 m_first_cell_uid_level.add(m_latest_cell_uid);
254 m_first_node_uid_level.add(m_latest_node_uid);
255 m_first_face_uid_level.add(m_latest_face_uid);
257 else if (level == m_min_level - 1) {
259 _pushFront(m_first_cell_uid_level, m_latest_cell_uid);
260 _pushFront(m_first_node_uid_level, m_latest_node_uid);
261 _pushFront(m_first_face_uid_level, m_latest_face_uid);
275void CartesianMeshNumberingMngInternal::
278 const Int32 nb_levels_to_add = -m_min_level;
279 m_ori_level += nb_levels_to_add;
281 if (nb_levels_to_add == 0) {
285 m_max_level += nb_levels_to_add;
286 m_min_level += nb_levels_to_add;
288 const Integer to_div = m_pattern * nb_levels_to_add;
289 if (m_dimension == 2) {
290 m_nb_cell_ground.x /= to_div;
291 m_nb_cell_ground.y /= to_div;
295 m_nb_cell_ground /= to_div;
301 auto* cmgi = ICartesianMeshGenerationInfo::getReference(m_mesh,
false);
307 cmgi->setOwnCellOffsets(v[0] / to_div, v[1] / to_div, v[2] / to_div);
311 cmgi->setGlobalNbCells(v[0] / to_div, v[1] / to_div, v[2] / to_div);
315 cmgi->setOwnNbCells(v[0] / to_div, v[1] / to_div, v[2] / to_div);
325Int64 CartesianMeshNumberingMngInternal::
326firstCellUniqueId(
Int32 level)
const
328 return m_first_cell_uid_level[level - m_min_level];
334Int64 CartesianMeshNumberingMngInternal::
335firstNodeUniqueId(
Int32 level)
const
337 return m_first_node_uid_level[level - m_min_level];
343Int64 CartesianMeshNumberingMngInternal::
344firstFaceUniqueId(
Int32 level)
const
346 return m_first_face_uid_level[level - m_min_level];
352CartCoordType CartesianMeshNumberingMngInternal::
353globalNbCellsX(
Int32 level)
const
355 return static_cast<CartCoordType
>(
static_cast<Real>(m_nb_cell_ground.x) * std::pow(m_pattern, level));
361CartCoordType CartesianMeshNumberingMngInternal::
362globalNbCellsY(
Int32 level)
const
364 return static_cast<CartCoordType
>(
static_cast<Real>(m_nb_cell_ground.y) * std::pow(m_pattern, level));
370CartCoordType CartesianMeshNumberingMngInternal::
371globalNbCellsZ(
Int32 level)
const
373 return static_cast<CartCoordType
>(
static_cast<Real>(m_nb_cell_ground.z) * std::pow(m_pattern, level));
379CartCoordType CartesianMeshNumberingMngInternal::
380globalNbNodesX(
Int32 level)
const
388CartCoordType CartesianMeshNumberingMngInternal::
389globalNbNodesY(
Int32 level)
const
397CartCoordType CartesianMeshNumberingMngInternal::
398globalNbNodesZ(
Int32 level)
const
406CartCoordType CartesianMeshNumberingMngInternal::
407globalNbFacesX(
Int32 level)
const
415CartCoordType CartesianMeshNumberingMngInternal::
416globalNbFacesY(
Int32 level)
const
424CartCoordType CartesianMeshNumberingMngInternal::
425globalNbFacesZ(
Int32 level)
const
433CartCoordType CartesianMeshNumberingMngInternal::
434globalNbFacesXCartesianView(
Int32 level)
const
442CartCoordType CartesianMeshNumberingMngInternal::
443globalNbFacesYCartesianView(
Int32 level)
const
451CartCoordType CartesianMeshNumberingMngInternal::
452globalNbFacesZCartesianView(
Int32 level)
const
460Int64 CartesianMeshNumberingMngInternal::
461nbCellInLevel(
Int32 level)
const
463 if (m_dimension == 2) {
465 return nb_cell.x * nb_cell.y;
469 return nb_cell.x * nb_cell.y * nb_cell.z;
475Int64 CartesianMeshNumberingMngInternal::
476nbNodeInLevel(
Int32 level)
const
478 if (m_dimension == 2) {
480 return (nb_cell.x + 1) * (nb_cell.y + 1);
484 return (nb_cell.x + 1) * (nb_cell.y + 1) * (nb_cell.z + 1);
490Int64 CartesianMeshNumberingMngInternal::
491nbFaceInLevel(
Int32 level)
const
493 if (m_dimension == 2) {
495 return (nb_cell.x * nb_cell.y) * 2 + nb_cell.x * 2 + nb_cell.y;
499 return (nb_cell.x + 1) * nb_cell.y * nb_cell.z + (nb_cell.y + 1) * nb_cell.z * nb_cell.x + (nb_cell.z + 1) * nb_cell.x * nb_cell.y;
505Int32 CartesianMeshNumberingMngInternal::
514Int32 CartesianMeshNumberingMngInternal::
515cellLevel(
Int64 uid)
const
520 for (
Int32 i = m_min_level; i <= m_max_level; ++i) {
522 if (first_uid <= uid && first_uid > max) {
529 ARCANE_FATAL(
"CellUID is not in any patch (UID too low)");
532 ARCANE_FATAL(
"CellUID is not in any patch (UID too high)");
541Int32 CartesianMeshNumberingMngInternal::
542nodeLevel(
Int64 uid)
const
547 for (
Int32 i = m_min_level; i <= m_max_level; ++i) {
549 if (first_uid <= uid && first_uid > max) {
556 ARCANE_FATAL(
"NodeUID is not in any patch (UID too low)");
559 ARCANE_FATAL(
"NodeUID is not in any patch (UID too high)");
568Int32 CartesianMeshNumberingMngInternal::
569faceLevel(
Int64 uid)
const
574 for (
Int32 i = m_min_level; i <= m_max_level; ++i) {
576 if (first_uid <= uid && first_uid > max) {
583 ARCANE_FATAL(
"FaceUID is not in any patch (UID too low)");
586 ARCANE_FATAL(
"FaceUID is not in any patch (UID too high)");
596CartCoordType CartesianMeshNumberingMngInternal::
597offsetLevelToLevel(CartCoordType coord,
Int32 level_from,
Int32 level_to)
const
599 if (level_from == level_to) {
602 if (level_from < level_to) {
603 return coord * m_pattern * (level_to - level_from);
605 return coord / (m_pattern * (level_from - level_to));
611CartCoord3Type CartesianMeshNumberingMngInternal::
612offsetLevelToLevel(CartCoord3Type coord,
Int32 level_from,
Int32 level_to)
const
614 if (level_from == level_to) {
617 if (level_from < level_to) {
618 return coord * (m_pattern * (level_to - level_from));
620 return coord / ((m_pattern * (level_from - level_to)));
627CartCoordType CartesianMeshNumberingMngInternal::
628faceOffsetLevelToLevel(CartCoordType coord,
Int32 level_from,
Int32 level_to)
const
650 if (level_from == level_to) {
654 if (level_from < level_to) {
655 const Int32 pattern = m_pattern * (level_to - level_from);
656 if (coord % 2 == 0) {
659 return ((coord - 1) *
pattern) + 1;
662 const Int32 pattern = m_pattern * (level_from - level_to);
663 if (coord % 2 == 0) {
664 if (coord % (
pattern * 2) == 0) {
678 return coord - (((coord - 1) / (
pattern * 2) * (2 * (
pattern - 1))) + ((coord - 1) % (
pattern * 2)));
684CartCoord3Type CartesianMeshNumberingMngInternal::
691 uid -= first_cell_uid;
693 const Int64 to2d = uid % (nb_cell_x * nb_cell_y);
695 return {
static_cast<CartCoordType
>(to2d % nb_cell_x),
static_cast<CartCoordType
>(to2d / nb_cell_x),
static_cast<CartCoordType
>(uid / (nb_cell_x * nb_cell_y)) };
701CartCoord3Type CartesianMeshNumberingMngInternal::
702cellUniqueIdToCoord(
Cell cell)
710CartCoordType CartesianMeshNumberingMngInternal::
717 uid -= first_cell_uid;
719 const Int64 to2d = uid % (nb_cell_x * nb_cell_y);
720 return static_cast<CartCoordType
>(to2d % nb_cell_x);
726CartCoordType CartesianMeshNumberingMngInternal::
727cellUniqueIdToCoordX(
Cell cell)
735CartCoordType CartesianMeshNumberingMngInternal::
742 uid -= first_cell_uid;
744 const Int64 to2d = uid % (nb_cell_x * nb_cell_y);
745 return static_cast<CartCoordType
>(to2d / nb_cell_x);
751CartCoordType CartesianMeshNumberingMngInternal::
752cellUniqueIdToCoordY(
Cell cell)
760CartCoordType CartesianMeshNumberingMngInternal::
767 uid -= first_cell_uid;
769 return static_cast<CartCoordType
>(uid / (nb_cell_x * nb_cell_y));
775CartCoordType CartesianMeshNumberingMngInternal::
776cellUniqueIdToCoordZ(
Cell cell)
784CartCoordType CartesianMeshNumberingMngInternal::
791 uid -= first_node_uid;
793 const Int64 to2d = uid % (nb_node_x * nb_node_y);
794 return static_cast<CartCoordType
>(to2d % nb_node_x);
800CartCoordType CartesianMeshNumberingMngInternal::
801nodeUniqueIdToCoordX(
Node node)
810CartCoordType CartesianMeshNumberingMngInternal::
817 uid -= first_node_uid;
819 const Int64 to2d = uid % (nb_node_x * nb_node_y);
820 return static_cast<CartCoordType
>(to2d / nb_node_x);
826CartCoordType CartesianMeshNumberingMngInternal::
827nodeUniqueIdToCoordY(
Node node)
836CartCoordType CartesianMeshNumberingMngInternal::
843 uid -= first_node_uid;
845 return static_cast<CartCoordType
>(uid / (nb_node_x * nb_node_y));
851CartCoordType CartesianMeshNumberingMngInternal::
852nodeUniqueIdToCoordZ(
Node node)
861CartCoordType CartesianMeshNumberingMngInternal::
864 if (m_dimension == 2) {
869 uid -= first_face_uid;
892 return static_cast<CartCoordType
>(uid % nb_face_x);
901 uid -= first_face_uid;
928 if (uid < three_parts_numbering.x) {
938 return static_cast<CartCoordType
>((uid % nb_face_x) * 2);
944 if (uid < three_parts_numbering.x + three_parts_numbering.y) {
945 uid -= three_parts_numbering.x;
954 return static_cast<CartCoordType
>((uid % nb_cell_x) * 2 + 1);
960 uid -= three_parts_numbering.x + three_parts_numbering.y;
969 return static_cast<CartCoordType
>((uid % nb_cell_x) * 2 + 1);
975CartCoordType CartesianMeshNumberingMngInternal::
976faceUniqueIdToCoordX(
Face face)
985CartCoordType CartesianMeshNumberingMngInternal::
988 if (m_dimension == 2) {
992 uid -= first_face_uid;
1015 const Int64 flat_pos = uid / nb_face_x;
1016 return static_cast<CartCoordType
>((flat_pos * 2) + (flat_pos % 2 == uid % 2 ? 0 : 1) - 1);
1026 uid -= first_face_uid;
1053 if (uid < three_parts_numbering.x) {
1054 uid %= nb_face_x * nb_cell_y;
1065 return static_cast<CartCoordType
>((uid / nb_face_x) * 2 + 1);
1071 if (uid < three_parts_numbering.x + three_parts_numbering.y) {
1072 uid -= three_parts_numbering.x;
1073 uid %= nb_cell_x * nb_face_y;
1084 return static_cast<CartCoordType
>((uid / nb_cell_x) * 2);
1090 uid -= three_parts_numbering.x + three_parts_numbering.y;
1091 uid %= nb_cell_x * nb_cell_y;
1102 return static_cast<CartCoordType
>((uid / nb_cell_x) * 2 + 1);
1108CartCoordType CartesianMeshNumberingMngInternal::
1109faceUniqueIdToCoordY(
Face face)
1118CartCoordType CartesianMeshNumberingMngInternal::
1129 uid -= first_face_uid;
1156 if (uid < three_parts_numbering.x) {
1167 return static_cast<CartCoordType
>((uid / (nb_face_x * nb_cell_y)) * 2 + 1);
1173 if (uid < three_parts_numbering.x + three_parts_numbering.y) {
1174 uid -= three_parts_numbering.x;
1185 return static_cast<CartCoordType
>((uid / (nb_cell_x * nb_face_y)) * 2 + 1);
1191 uid -= three_parts_numbering.x + three_parts_numbering.y;
1202 return static_cast<CartCoordType
>((uid / (nb_cell_x * nb_cell_y)) * 2);
1208CartCoordType CartesianMeshNumberingMngInternal::
1209faceUniqueIdToCoordZ(
Face face)
1218Int64 CartesianMeshNumberingMngInternal::
1219cellUniqueId(CartCoord3Type cell_coord,
Int32 level)
1225 return (cell_coord.x + cell_coord.y * nb_cell_x + cell_coord.z * nb_cell_x * nb_cell_y) + first_cell_uid;
1231Int64 CartesianMeshNumberingMngInternal::
1232cellUniqueId(CartCoord2Type cell_coord,
Int32 level)
1237 return (cell_coord.x + cell_coord.y * nb_cell_x) + first_cell_uid;
1243Int64 CartesianMeshNumberingMngInternal::
1244nodeUniqueId(CartCoord3Type node_coord,
Int32 level)
1250 return (node_coord.x + node_coord.y * nb_node_x + node_coord.z * nb_node_x * nb_node_y) + first_node_uid;
1256Int64 CartesianMeshNumberingMngInternal::
1257nodeUniqueId(CartCoord2Type node_coord,
Int32 level)
1262 return (node_coord.x + node_coord.y * nb_node_x) + first_node_uid;
1268Int64 CartesianMeshNumberingMngInternal::
1269faceUniqueId(CartCoord3Type face_coord,
Int32 level)
1304 if (face_coord.x % 2 == 0) {
1314 uid += face_coord.x + (face_coord.y * nb_face_x) + (face_coord.z * nb_face_x * nb_cell_y);
1318 else if (face_coord.y % 2 == 0) {
1319 uid += three_parts_numbering.x;
1329 uid += face_coord.x + (face_coord.y * nb_cell_x) + (face_coord.z * nb_cell_x * nb_face_y);
1333 else if (face_coord.z % 2 == 0) {
1334 uid += three_parts_numbering.x + three_parts_numbering.y;
1344 uid += face_coord.x + (face_coord.y * nb_cell_x) + (face_coord.z * nb_cell_x * nb_cell_y);
1347 ARCANE_FATAL(
"Bizarre -- x : {0} -- y : {1} -- z : {2}", face_coord.x, face_coord.y, face_coord.z);
1356Int64 CartesianMeshNumberingMngInternal::
1357faceUniqueId(CartCoord2Type face_coord,
Int32 level)
1384 const Int64 a = (face_coord.y / 2) * nb_face_x;
1386 return (face_coord.x + a - 1) + first_face_uid;
1392Int32 CartesianMeshNumberingMngInternal::
1395 return (m_dimension == 2 ? 4 : 8);
1401void CartesianMeshNumberingMngInternal::
1411 const Int64 x0 = cell_coord.x + 0;
1412 const Int64 x1 = cell_coord.x + 1;
1414 const Int64 y0 = (cell_coord.y + 0) * nb_node_x;
1415 const Int64 y1 = (cell_coord.y + 1) * nb_node_x;
1417 const Int64 z0 = (cell_coord.z + 0) * nb_node_x * nb_node_y;
1418 const Int64 z1 = (cell_coord.z + 1) * nb_node_x * nb_node_y;
1420 uid[0] = x0 + y0 + z0 + first_node_uid;
1421 uid[1] = x1 + y0 + z0 + first_node_uid;
1422 uid[2] = x1 + y1 + z0 + first_node_uid;
1423 uid[3] = x0 + y1 + z0 + first_node_uid;
1425 uid[4] = x0 + y0 + z1 + first_node_uid;
1426 uid[5] = x1 + y0 + z1 + first_node_uid;
1427 uid[6] = x1 + y1 + z1 + first_node_uid;
1428 uid[7] = x0 + y1 + z1 + first_node_uid;
1434void CartesianMeshNumberingMngInternal::
1443 const Int64 x0 = cell_coord.x + 0;
1444 const Int64 x1 = cell_coord.x + 1;
1446 const Int64 y0 = (cell_coord.y + 0) * nb_node_x;
1447 const Int64 y1 = (cell_coord.y + 1) * nb_node_x;
1449 uid[0] = x0 + y0 + first_node_uid;
1450 uid[1] = x1 + y0 + first_node_uid;
1451 uid[2] = x1 + y1 + first_node_uid;
1452 uid[3] = x0 + y1 + first_node_uid;
1458void CartesianMeshNumberingMngInternal::
1461 if (m_dimension == 2) {
1474void CartesianMeshNumberingMngInternal::
1483Int32 CartesianMeshNumberingMngInternal::
1486 return (m_dimension == 2 ? 4 : 6);
1492void CartesianMeshNumberingMngInternal::
1499 const Int64x3 nb_face(nb_cell + 1);
1543 const Int64 total_face_yz = nb_face.x * nb_cell.y * nb_cell.z;
1544 const Int64 total_face_yz_zx = total_face_yz + nb_face.y * nb_cell.z * nb_cell.x;
1546 const Int64 nb_cell_before_j = cell_coord.y * nb_cell.x;
1548 uid[0] = (cell_coord.z * nb_cell.x * nb_cell.y) + nb_cell_before_j + cell_coord.x + total_face_yz_zx;
1550 uid[3] = uid[0] + nb_cell.x * nb_cell.y;
1552 uid[1] = (cell_coord.z * nb_face.x * nb_cell.y) + (cell_coord.y * nb_face.x) + cell_coord.x;
1554 uid[4] = uid[1] + 1;
1556 uid[2] = (cell_coord.z * nb_cell.x * nb_face.y) + nb_cell_before_j + cell_coord.x + total_face_yz;
1558 uid[5] = uid[2] + nb_cell.x;
1560 uid[0] += first_face_uid;
1561 uid[1] += first_face_uid;
1562 uid[2] += first_face_uid;
1563 uid[3] += first_face_uid;
1564 uid[4] += first_face_uid;
1565 uid[5] += first_face_uid;
1573void CartesianMeshNumberingMngInternal::
1580 const Int64 nb_face_x = nb_cell_x + 1;
1601 uid[0] = cell_coord.x * 2 + cell_coord.y * (nb_face_x + nb_cell_x);
1605 uid[2] = uid[0] + (nb_face_x + nb_cell_x);
1608 uid[3] = uid[2] - 1;
1611 uid[1] = uid[2] + 1;
1613 uid[0] += first_face_uid;
1614 uid[1] += first_face_uid;
1615 uid[2] += first_face_uid;
1616 uid[3] += first_face_uid;
1622void CartesianMeshNumberingMngInternal::
1625 if (m_dimension == 2) {
1638void CartesianMeshNumberingMngInternal::
1647void CartesianMeshNumberingMngInternal::
1650 ARCANE_ASSERT((uid.
size() == 27), (
"Size of uid array != 27"));
1658 for (CartCoordType k = -1; k < 2; ++k) {
1659 const CartCoordType coord_around_cell_z = cell_coord.z + k;
1660 if (coord_around_cell_z >= 0 && coord_around_cell_z < nb_cells_z) {
1661 for (CartCoordType j = -1; j < 2; ++j) {
1662 const CartCoordType coord_around_cell_y = cell_coord.y + j;
1664 if (coord_around_cell_y >= 0 && coord_around_cell_y < nb_cells_y) {
1665 for (CartCoordType i = -1; i < 2; ++i) {
1666 const CartCoordType coord_around_cell_x = cell_coord.x + i;
1668 if (coord_around_cell_x >= 0 && coord_around_cell_x < nb_cells_x) {
1669 uid[(i + 1) + ((j + 1) * 3) + ((k + 1) * 9)] =
cellUniqueId(CartCoord3Type{ coord_around_cell_x, coord_around_cell_y, coord_around_cell_z }, level);
1681void CartesianMeshNumberingMngInternal::
1684 ARCANE_ASSERT((uid.
size() == 9), (
"Size of uid array != 9"));
1691 for (CartCoordType j = -1; j < 2; ++j) {
1692 const CartCoordType coord_around_cell_y = cell_coord.y + j;
1693 if (coord_around_cell_y >= 0 && coord_around_cell_y < nb_cells_y) {
1695 for (CartCoordType i = -1; i < 2; ++i) {
1696 const CartCoordType coord_around_cell_x = cell_coord.x + i;
1697 if (coord_around_cell_x >= 0 && coord_around_cell_x < nb_cells_x) {
1698 uid[(i + 1) + ((j + 1) * 3)] =
cellUniqueId(CartCoord2Type{ coord_around_cell_x, coord_around_cell_y }, level);
1708void CartesianMeshNumberingMngInternal::
1711 if (m_dimension == 2) {
1724void CartesianMeshNumberingMngInternal::
1733void CartesianMeshNumberingMngInternal::
1736 ARCANE_ASSERT((uid.
size() == 8), (
"Size of uid array != 8"));
1744 for (CartCoordType k = -1; k < 1; ++k) {
1745 const CartCoordType coord_cell_z = node_coord.z + k;
1746 if (coord_cell_z >= 0 && coord_cell_z < nb_cells_z) {
1748 for (CartCoordType j = -1; j < 1; ++j) {
1749 const CartCoordType coord_cell_y = node_coord.y + j;
1750 if (coord_cell_y >= 0 && coord_cell_y < nb_cells_y) {
1752 for (CartCoordType i = -1; i < 1; ++i) {
1753 const CartCoordType coord_cell_x = node_coord.x + i;
1754 if (coord_cell_x >= 0 && coord_cell_x < nb_cells_x) {
1755 uid[(i + 1) + ((j + 1) * 2) + ((k + 1) * 4)] =
cellUniqueId(CartCoord3Type{ coord_cell_x, coord_cell_y, coord_cell_z }, level);
1767void CartesianMeshNumberingMngInternal::
1770 ARCANE_ASSERT((uid.
size() == 4), (
"Size of uid array != 4"));
1777 for (CartCoordType j = -1; j < 1; ++j) {
1778 const CartCoordType coord_cell_y = node_coord.y + j;
1779 if (coord_cell_y >= 0 && coord_cell_y < nb_cells_y) {
1781 for (CartCoordType i = -1; i < 1; ++i) {
1782 const CartCoordType coord_cell_x = node_coord.x + i;
1783 if (coord_cell_x >= 0 && coord_cell_x < nb_cells_x) {
1784 uid[(i + 1) + ((j + 1) * 2)] =
cellUniqueId(CartCoord2Type{ coord_cell_x, coord_cell_y }, level);
1794void CartesianMeshNumberingMngInternal::
1797 if (m_dimension == 2) {
1810void CartesianMeshNumberingMngInternal::
1819void CartesianMeshNumberingMngInternal::
1820setChildNodeCoordinates(
Cell parent_cell)
1828 const Real3& node0(nodes_coords[parent_cell.
node(0)]);
1829 const Real3& node1(nodes_coords[parent_cell.
node(1)]);
1830 const Real3& node2(nodes_coords[parent_cell.
node(2)]);
1831 const Real3& node3(nodes_coords[parent_cell.
node(3)]);
1833 if (m_dimension == 2) {
1864 auto txty = [&](CartCoordType pos_x, CartCoordType pos_y) ->
Real3 {
1865 const Real x =
static_cast<Real>(pos_x) /
static_cast<Real>(m_pattern);
1866 const Real y =
static_cast<Real>(pos_y) /
static_cast<Real>(m_pattern);
1868 const Real i = (node3.
x - node0.
x) * y + node0.
x;
1869 const Real j = (node2.
x - node1.
x) * y + node1.
x;
1871 const Real k = (node1.
y - node0.
y) * x + node0.
y;
1872 const Real l = (node2.
y - node3.
y) * x + node3.
y;
1874 const Real tx = (j - i) * x + i;
1875 const Real ty = (l - k) * y + k;
1892 return { tx, ty, 0 };
1895 constexpr CartCoordType node_1d_2d_x[] = { 0, 1, 1, 0 };
1896 constexpr CartCoordType node_1d_2d_y[] = { 0, 0, 1, 1 };
1898 for (CartCoordType j = 0; j < m_pattern; ++j) {
1899 for (CartCoordType i = 0; i < m_pattern; ++i) {
1901 Int32 begin = (i == 0 && j == 0 ? 0 : j == 0 ? 1
1906 for (
Int32 inode = begin; inode < end; ++inode) {
1907 nodes_coords[child.
node(inode)] = txty(i + node_1d_2d_x[inode], j + node_1d_2d_y[inode]);
1920 const Real3& node4(nodes_coords[parent_cell.
node(4)]);
1921 const Real3& node5(nodes_coords[parent_cell.
node(5)]);
1922 const Real3& node6(nodes_coords[parent_cell.
node(6)]);
1923 const Real3& node7(nodes_coords[parent_cell.
node(7)]);
1929 auto txtytz = [&](CartCoordType pos_x, CartCoordType pos_y, CartCoordType pos_z) ->
Real3 {
1930 const Real x =
static_cast<Real>(pos_x) /
static_cast<Real>(m_pattern);
1931 const Real y =
static_cast<Real>(pos_y) /
static_cast<Real>(m_pattern);
1932 const Real z =
static_cast<Real>(pos_z) /
static_cast<Real>(m_pattern);
1935 const Real3 m = (node4 - node0) * z + node0;
1936 const Real3 n = (node5 - node1) * z + node1;
1937 const Real3 o = (node6 - node2) * z + node2;
1938 const Real3 p = (node7 - node3) * z + node3;
1941 const Real i = (p.
x - m.
x) * y + m.
x;
1942 const Real j = (o.
x - n.
x) * y + n.
x;
1944 const Real tx = (j - i) * x + i;
1946 const Real k = (n.
y - m.
y) * x + m.
y;
1947 const Real l = (o.
y - p.
y) * x + p.
y;
1949 const Real ty = (l - k) * y + k;
1951 const Real q = (p.
z - m.
z) * y + m.
z;
1952 const Real r = (o.
z - n.
z) * y + n.
z;
1954 const Real s = (n.
z - m.
z) * x + m.
z;
1955 const Real t = (o.
z - p.
z) * x + p.
z;
1957 const Real tz = (((r - q) * x + q) + ((t - s) * y + s)) * 0.5;
1987 return { tx, ty, tz };
1990 constexpr CartCoordType node_1d_3d_x[] = { 0, 1, 1, 0, 0, 1, 1, 0 };
1991 constexpr CartCoordType node_1d_3d_y[] = { 0, 0, 1, 1, 0, 0, 1, 1 };
1992 constexpr CartCoordType node_1d_3d_z[] = { 0, 0, 0, 0, 1, 1, 1, 1 };
1994 for (CartCoordType k = 0; k < m_pattern; ++k) {
1995 for (CartCoordType j = 0; j < m_pattern; ++j) {
1996 for (CartCoordType i = 0; i < m_pattern; ++i) {
2003 for (
Int32 inode = begin; inode < end; ++inode) {
2004 nodes_coords[child.
node(inode)] = txtytz(i + node_1d_3d_x[inode], j + node_1d_3d_y[inode], k + node_1d_3d_z[inode]);
2022void CartesianMeshNumberingMngInternal::
2023setParentNodeCoordinates(
Cell parent_cell)
2031 if (m_dimension == 2) {
2032 nodes_coords[parent_cell.
node(0)] = nodes_coords[
childCellOfCell(parent_cell, CartCoord2Type(0, 0)).node(0)];
2033 nodes_coords[parent_cell.
node(1)] = nodes_coords[
childCellOfCell(parent_cell, CartCoord2Type(m_pattern - 1, 0)).node(1)];
2034 nodes_coords[parent_cell.
node(2)] = nodes_coords[
childCellOfCell(parent_cell, CartCoord2Type(m_pattern - 1, m_pattern - 1)).node(2)];
2035 nodes_coords[parent_cell.
node(3)] = nodes_coords[
childCellOfCell(parent_cell, CartCoord2Type(0, m_pattern - 1)).node(3)];
2039 nodes_coords[parent_cell.
node(0)] = nodes_coords[
childCellOfCell(parent_cell, CartCoord3Type(0, 0, 0)).node(0)];
2040 nodes_coords[parent_cell.
node(1)] = nodes_coords[
childCellOfCell(parent_cell, CartCoord3Type(m_pattern - 1, 0, 0)).node(1)];
2041 nodes_coords[parent_cell.
node(2)] = nodes_coords[
childCellOfCell(parent_cell, CartCoord3Type(m_pattern - 1, m_pattern - 1, 0)).node(2)];
2042 nodes_coords[parent_cell.
node(3)] = nodes_coords[
childCellOfCell(parent_cell, CartCoord3Type(0, m_pattern - 1, 0)).node(3)];
2044 nodes_coords[parent_cell.
node(4)] = nodes_coords[
childCellOfCell(parent_cell, CartCoord3Type(0, 0, m_pattern - 1)).node(4)];
2045 nodes_coords[parent_cell.
node(5)] = nodes_coords[
childCellOfCell(parent_cell, CartCoord3Type(m_pattern - 1, 0, m_pattern - 1)).node(5)];
2046 nodes_coords[parent_cell.
node(6)] = nodes_coords[
childCellOfCell(parent_cell, CartCoord3Type(m_pattern - 1, m_pattern - 1, m_pattern - 1)).node(6)];
2047 nodes_coords[parent_cell.
node(7)] = nodes_coords[
childCellOfCell(parent_cell, CartCoord3Type(0, m_pattern - 1, m_pattern - 1)).node(7)];
2054Int64 CartesianMeshNumberingMngInternal::
2055parentCellUniqueIdOfCell(
Int64 uid,
Int32 level,
bool do_fatal)
2066 return NULL_ITEM_UNIQUE_ID;
2069 if (m_dimension == 2) {
2084Int64 CartesianMeshNumberingMngInternal::
2085parentCellUniqueIdOfCell(
Cell cell,
bool do_fatal)
2093Int64 CartesianMeshNumberingMngInternal::
2094childCellUniqueIdOfCell(
Cell cell, CartCoord3Type child_coord_in_parent)
2096 ARCANE_ASSERT((child_coord_in_parent.x < m_pattern && child_coord_in_parent.x >= 0), (
"Bad child_coord_in_parent.x"))
2097 ARCANE_ASSERT((child_coord_in_parent.y < m_pattern && child_coord_in_parent.y >= 0), (
"Bad child_coord_in_parent.y"))
2098 ARCANE_ASSERT((child_coord_in_parent.z < m_pattern && child_coord_in_parent.z >= 0), (
"Bad child_coord_in_parent.z"))
2112Int64 CartesianMeshNumberingMngInternal::
2113childCellUniqueIdOfCell(
Cell cell, CartCoord2Type child_coord_in_parent)
2115 ARCANE_ASSERT((child_coord_in_parent.x < m_pattern && child_coord_in_parent.x >= 0), (
"Bad child_coord_in_parent.x"))
2116 ARCANE_ASSERT((child_coord_in_parent.y < m_pattern && child_coord_in_parent.y >= 0), (
"Bad child_coord_in_parent.y"))
2129Int64 CartesianMeshNumberingMngInternal::
2130childCellUniqueIdOfCell(
Cell cell,
Int32 child_index_in_parent)
2132 if (m_dimension == 2) {
2133 ARCANE_ASSERT((child_index_in_parent < m_pattern * m_pattern && child_index_in_parent >= 0), (
"Bad child_index_in_parent"))
2137 child_index_in_parent % m_pattern,
2138 child_index_in_parent / m_pattern));
2141 ARCANE_ASSERT((child_index_in_parent < m_pattern * m_pattern * m_pattern && child_index_in_parent >= 0), (
"Bad child_index_in_parent"))
2143 const CartCoordType to_2d = child_index_in_parent % (m_pattern * m_pattern);
2148 child_index_in_parent / (m_pattern * m_pattern)));
2154Cell CartesianMeshNumberingMngInternal::
2155childCellOfCell(
Cell cell, CartCoord3Type child_coord_in_parent)
2157 ARCANE_ASSERT((child_coord_in_parent.x < m_pattern && child_coord_in_parent.x >= 0), (
"Bad child_coord_in_parent.x"))
2158 ARCANE_ASSERT((child_coord_in_parent.y < m_pattern && child_coord_in_parent.y >= 0), (
"Bad child_coord_in_parent.y"))
2160 Cell child = cell.
hChild(child_coord_in_parent.x + (child_coord_in_parent.y * m_pattern) + (child_coord_in_parent.z * m_pattern * m_pattern));
2167 for (
Integer i = 0; i < nb_children; ++i) {
2180Cell CartesianMeshNumberingMngInternal::
2181childCellOfCell(
Cell cell, CartCoord2Type child_coord_in_parent)
2183 ARCANE_ASSERT((child_coord_in_parent.x < m_pattern && child_coord_in_parent.x >= 0), (
"Bad child_coord_in_parent.x"))
2184 ARCANE_ASSERT((child_coord_in_parent.y < m_pattern && child_coord_in_parent.y >= 0), (
"Bad child_coord_in_parent.y"))
2186 Cell child = cell.
hChild(child_coord_in_parent.x + (child_coord_in_parent.y * m_pattern));
2193 for (
Integer i = 0; i < nb_children; ++i) {
2206Int64 CartesianMeshNumberingMngInternal::
2207parentNodeUniqueIdOfNode(
Int64 uid,
Int32 level,
bool do_fatal)
2216 if (coord_x % m_pattern != 0 || coord_y % m_pattern != 0) {
2220 return NULL_ITEM_UNIQUE_ID;
2223 if (m_dimension == 2) {
2231 if (coord_z % m_pattern != 0) {
2235 return NULL_ITEM_UNIQUE_ID;
2246Int64 CartesianMeshNumberingMngInternal::
2247parentNodeUniqueIdOfNode(
Node node,
bool do_fatal)
2256Int64 CartesianMeshNumberingMngInternal::
2257childNodeUniqueIdOfNode(
Int64 uid,
Int32 level)
2259 if (m_dimension == 2) {
2274Int64 CartesianMeshNumberingMngInternal::
2275childNodeUniqueIdOfNode(
Node node)
2284Int64 CartesianMeshNumberingMngInternal::
2285parentFaceUniqueIdOfFace(
Int64 uid,
Int32 level,
bool do_fatal)
2287 if (m_converting_numbering_face && level == m_ori_level) {
2288 uid = m_face_ori_numbering_to_new[uid];
2305 if (parent_coord_x == -1 || parent_coord_y == -1) {
2309 return NULL_ITEM_UNIQUE_ID;
2315 if (m_dimension == 2) {
2316 if (m_converting_numbering_face && level - 1 == m_ori_level) {
2317 return m_face_new_numbering_to_ori[
faceUniqueId(CartCoord2Type(parent_coord_x, parent_coord_y), level - 1)];
2319 return faceUniqueId(CartCoord2Type(parent_coord_x, parent_coord_y), level - 1);
2327 if (parent_coord_z == -1) {
2331 return NULL_ITEM_UNIQUE_ID;
2338 if (m_converting_numbering_face && level - 1 == m_ori_level) {
2339 return m_face_new_numbering_to_ori[
faceUniqueId(CartCoord3Type(parent_coord_x, parent_coord_y, parent_coord_z), level - 1)];
2342 return faceUniqueId(CartCoord3Type(parent_coord_x, parent_coord_y, parent_coord_z), level - 1);
2348Int64 CartesianMeshNumberingMngInternal::
2349parentFaceUniqueIdOfFace(
Face face,
bool do_fatal)
2358Int64 CartesianMeshNumberingMngInternal::
2359childFaceUniqueIdOfFace(
Int64 uid,
Int32 level,
Int32 child_index_in_parent)
2361 if (m_converting_numbering_face && level == m_ori_level) {
2362 uid = m_face_ori_numbering_to_new[uid];
2374 ARCANE_ASSERT((first_child_coord_x <
globalNbFacesXCartesianView(level + 1) && first_child_coord_x >= 0), (
"Bad first_child_coord_x"))
2375 ARCANE_ASSERT((first_child_coord_y <
globalNbFacesYCartesianView(level + 1) && first_child_coord_y >= 0), (
"Bad first_child_coord_y"))
2377 if (m_dimension == 2) {
2378 ARCANE_ASSERT((child_index_in_parent < m_pattern && child_index_in_parent >= 0), (
"Invalid child_index_in_parent"))
2380 if (coord_y % 2 == 0) {
2381 first_child_coord_x += child_index_in_parent * 2;
2383 else if (coord_x % 2 == 0) {
2384 first_child_coord_y += child_index_in_parent *
globalNbFacesY(level + 1);
2390 if (m_converting_numbering_face && level + 1 == m_ori_level) {
2391 return m_face_new_numbering_to_ori[
faceUniqueId(CartCoord2Type(first_child_coord_x, first_child_coord_y), level + 1)];
2394 return faceUniqueId(CartCoord2Type(first_child_coord_x, first_child_coord_y), level + 1);
2397 ARCANE_ASSERT((child_index_in_parent < m_pattern * m_pattern && child_index_in_parent >= 0), (
"Invalid child_index_in_parent"))
2403 ARCANE_ASSERT((first_child_coord_z <
globalNbFacesZCartesianView(level + 1) && first_child_coord_z >= 0), (
"Bad first_child_coord_z"))
2405 const CartCoordType child_x = child_index_in_parent % m_pattern;
2406 const CartCoordType child_y = child_index_in_parent / m_pattern;
2410 if (uid < three_parts_numbering.x) {
2411 first_child_coord_y += child_x * 2;
2412 first_child_coord_z += child_y * 2;
2414 else if (uid < three_parts_numbering.x + three_parts_numbering.y) {
2415 first_child_coord_x += child_x * 2;
2416 first_child_coord_z += child_y * 2;
2419 first_child_coord_x += child_x * 2;
2420 first_child_coord_y += child_y * 2;
2423 if (m_converting_numbering_face && level + 1 == m_ori_level) {
2424 return m_face_new_numbering_to_ori[
faceUniqueId(CartCoord3Type(first_child_coord_x, first_child_coord_y, first_child_coord_z), level + 1)];
2427 return faceUniqueId(CartCoord3Type(first_child_coord_x, first_child_coord_y, first_child_coord_z), level + 1);
2433Int64 CartesianMeshNumberingMngInternal::
2434childFaceUniqueIdOfFace(
Face face,
Int32 child_index_in_parent)
2443Int64x3 CartesianMeshNumberingMngInternal::
2444_face3DNumberingThreeParts(
Int32 level)
const
2447 return { (nb_cell.x + 1) * nb_cell.y * nb_cell.z, (nb_cell.y + 1) * nb_cell.z * nb_cell.x, (nb_cell.z + 1) * nb_cell.x * nb_cell.y };
2453void CartesianMeshNumberingMngInternal::
2457 array.
back() = elem;
2459 std::swap(array[i], array[i + 1]);
#define ARCANE_FATAL(...)
Macro envoyant une exception FatalErrorException.
Integer size() const
Nombre d'éléments du vecteur.
Vue modifiable d'un tableau d'un type T.
void fill(const T &o) noexcept
Remplit le tableau avec la valeur o.
constexpr Integer size() const noexcept
Retourne la taille du tableau.
void resize(Int64 s)
Change le nombre d'éléments du tableau à s.
T & back()
Dernier élément du tableau.
void cellNodeUniqueIds(CartCoord3Type cell_coord, Int32 level, ArrayView< Int64 > uid) override
Méthode permettant de récupérer les uniqueIds des noeuds d'une maille à partir de ses coordonnées.
Int32 pattern() const override
Méthode permettant de récupérer le pattern de raffinement utilisé dans chaque maille....
Int64 childNodeUniqueIdOfNode(Int64 uid, Int32 level) override
Méthode permettant de récupérer l'uniqueId d'un noeud enfant d'un noeud parent.
Int64x3 _face3DNumberingThreeParts(Int32 level) const
Méthode permettant de récupérer le nombre de faces des trois parties de la numérotation.
CartCoordType globalNbNodesX(Int32 level) const override
Méthode permettant de récupérer le nombre de noeuds global en X d'un niveau.
Int64 nbNodeInLevel(Int32 level) const override
Méthode permettant de récupérer le nombre de noeuds total dans un niveau.
Int64 nbCellInLevel(Int32 level) const override
Méthode permettant de récupérer le nombre de mailles total dans un niveau.
Int64 childFaceUniqueIdOfFace(Int64 uid, Int32 level, Int32 child_index_in_parent) override
Méthode permettant de récupérer l'uniqueId d'une face enfant d'une face parent à partir de l'index de...
CartCoordType cellUniqueIdToCoordX(Int64 uid, Int32 level) override
Méthode permettant de récupérer la coordonnée en X d'une maille grâce à son uniqueId.
CartCoordType cellUniqueIdToCoordZ(Int64 uid, Int32 level) override
Méthode permettant de récupérer la coordonnée en Z d'une maille grâce à son uniqueId.
CartCoordType nodeUniqueIdToCoordZ(Int64 uid, Int32 level) override
Méthode permettant de récupérer la coordonnée en Z d'un noeud grâce à son uniqueId.
Int64 parentFaceUniqueIdOfFace(Int64 uid, Int32 level, bool do_fatal) override
Méthode permettant de récupérer l'uniqueId du parent d'une face.
CartCoordType globalNbFacesYCartesianView(Int32 level) const override
Méthode permettant de récupérer la taille de la vue "grille cartésienne" contenant les faces.
CartCoordType globalNbFacesY(Int32 level) const override
Méthode permettant de récupérer le nombre de faces global en Y d'un niveau.
Int64 nodeUniqueId(CartCoord3Type node_coord, Int32 level) override
Méthode permettant de récupérer l'uniqueId d'un noeud à partir de sa position et de son niveau.
CartCoordType globalNbFacesZCartesianView(Int32 level) const override
Méthode permettant de récupérer la taille de la vue "grille cartésienne" contenant les faces.
Int64 firstFaceUniqueId(Int32 level) const override
Méthode permettant de récupérer le premier unique id utilisé par les faces d'un niveau....
CartCoordType globalNbCellsZ(Int32 level) const override
Méthode permettant de récupérer le nombre de mailles global en Z d'un niveau.
Int64 cellUniqueId(CartCoord3Type cell_coord, Int32 level) override
Méthode permettant de récupérer l'uniqueId d'une maille à partir de sa position et de son niveau.
Int64 nbFaceInLevel(Int32 level) const override
Méthode permettant de récupérer le nombre de faces total dans un niveau.
CartCoordType globalNbCellsX(Int32 level) const override
Méthode permettant de récupérer le nombre de mailles global en X d'un niveau.
Int32 faceLevel(Int64 uid) const override
Méthode permettant de récupérer le niveau d'une face avec son uid.
Int64 childCellUniqueIdOfCell(Cell cell, CartCoord3Type child_coord_in_parent) override
Méthode permettant de récupérer l'uniqueId d'une maille enfant d'une maille parent à partir de la pos...
void cellFaceUniqueIds(CartCoord3Type cell_coord, Int32 level, ArrayView< Int64 > uid) override
Méthode permettant de récupérer les uniqueIds des faces d'une maille à partir de ses coordonnées.
CartCoordType globalNbFacesXCartesianView(Int32 level) const override
Méthode permettant de récupérer la taille de la vue "grille cartésienne" contenant les faces.
CartCoordType cellUniqueIdToCoordY(Int64 uid, Int32 level) override
Méthode permettant de récupérer la coordonnée en Y d'une maille grâce à son uniqueId.
Int64 firstCellUniqueId(Int32 level) const override
Méthode permettant de récupérer le premier unique id utilisé par les mailles d'un niveau....
Int64 parentNodeUniqueIdOfNode(Int64 uid, Int32 level, bool do_fatal) override
Méthode permettant de récupérer l'uniqueId du parent d'un noeud.
CartCoord3Type cellUniqueIdToCoord(Int64 uid, Int32 level) override
Méthode permettant de récupérer les coordonnées d'une maille grâce à son uniqueId.
Int32 nbNodeByCell() override
Méthode permettant de récupérer le nombre de noeuds dans une maille.
CartCoordType faceUniqueIdToCoordX(Int64 uid, Int32 level) override
Méthode permettant de récupérer la coordonnée en X d'une face grâce à son uniqueId.
Int32 nbFaceByCell() override
Méthode permettant de récupérer le nombre de faces dans une maille.
CartCoordType offsetLevelToLevel(CartCoordType coord, Int32 level_from, Int32 level_to) const override
Méthode permettant d'obtenir la position du premier noeud/maille fille à partir de la position du noe...
CartCoordType globalNbCellsY(Int32 level) const override
Méthode permettant de récupérer le nombre de mailles global en Y d'un niveau.
CartCoordType globalNbFacesX(Int32 level) const override
Méthode permettant de récupérer le nombre de faces global en X d'un niveau.
CartCoordType faceUniqueIdToCoordZ(Int64 uid, Int32 level) override
Méthode permettant de récupérer la coordonnée en Z d'une face grâce à son uniqueId.
void cellUniqueIdsAroundCell(CartCoord3Type cell_coord, Int32 level, ArrayView< Int64 > uid) override
Méthode permettant de récupérer les uniqueIds des mailles autour d'une maille.
CartCoordType nodeUniqueIdToCoordX(Int64 uid, Int32 level) override
Méthode permettant de récupérer la coordonnée en X d'un noeud grâce à son uniqueId.
CartCoordType nodeUniqueIdToCoordY(Int64 uid, Int32 level) override
Méthode permettant de récupérer la coordonnée en Y d'un noeud grâce à son uniqueId.
void cellUniqueIdsAroundNode(CartCoord3Type node_coord, Int32 level, ArrayView< Int64 > uid) override
Méthode permettant de récupérer les uniqueIds des mailles autour d'un noeud.
Int64 firstNodeUniqueId(Int32 level) const override
Méthode permettant de récupérer le premier unique id utilisé par les noeuds d'un niveau....
Cell childCellOfCell(Cell cell, CartCoord3Type child_coord_in_parent) override
Méthode permettant de récupérer une maille enfant d'une maille parent à partir de la position de la m...
Int64 faceUniqueId(CartCoord3Type face_coord, Int32 level) override
Méthode permettant de récupérer l'uniqueId d'une face à partir de sa position et de son niveau.
CartCoordType faceOffsetLevelToLevel(CartCoordType coord, Int32 level_from, Int32 level_to) const override
Méthode permettant d'obtenir la position de la première face enfant à partir de la position de la fac...
CartCoordType faceUniqueIdToCoordY(Int64 uid, Int32 level) override
Méthode permettant de récupérer la coordonnée en Y d'une face grâce à son uniqueId.
CartCoordType globalNbNodesY(Int32 level) const override
Méthode permettant de récupérer le nombre de noeuds global en Y d'un niveau.
Int32 nodeLevel(Int64 uid) const override
Méthode permettant de récupérer le niveau d'un noeud avec son uid.
Int64 parentCellUniqueIdOfCell(Int64 uid, Int32 level, bool do_fatal) override
Méthode permettant de récupérer l'uniqueId du parent d'une maille.
Int32 nbHChildren() const
Nombre d'enfants pour l'AMR.
Cell hChild(Int32 i) const
i-ème enfant AMR
Vue constante d'un tableau de type T.
Interface du gestionnaire de traces.
virtual TraceMessage info()=0
Flot pour un message d'information.
Int32 flags() const
Flags de l'entité
@ II_JustAdded
L'entité vient d'être ajoutée.
@ II_JustRefined
L'entité vient d'être raffinée.
Node node(Int32 i) const
i-ème noeud de l'entité
ItemUniqueId uniqueId() const
Identifiant unique sur tous les domaines.
impl::ItemBase itemBase() const
Partie interne de l'entité.
Classe gérant un vecteur de réel de dimension 3.
Classe d'accès aux traces.
Positionne une classe de message.
Vecteur 1D de données avec sémantique par valeur (style STL).
T max(const T &a, const T &b, const T &c)
Retourne le maximum de trois éléments.
MeshVariableScalarRefT< Node, Real3 > VariableNodeReal3
Grandeur au noeud de type coordonnées.
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
std::int64_t Int64
Type entier signé sur 64 bits.
Int32 Integer
Type représentant un entier.
ConstArrayView< Int64 > Int64ConstArrayView
Equivalent C d'un tableau à une dimension d'entiers 64 bits.
double Real
Type représentant un réel.
auto makeRef(InstanceType *t) -> Ref< InstanceType >
Créé une référence sur un pointeur.
std::int32_t Int32
Type entier signé sur 32 bits.
Real y
deuxième composante du triplet
Real z
troisième composante du triplet
Real x
première composante du triplet