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)
50 const auto* m_generation_info = ICartesianMeshGenerationInfo::getReference(m_mesh,
true);
53 m_nb_cell_ground.x = global_nb_cells_by_direction[
MD_DirX];
54 m_nb_cell_ground.y = global_nb_cells_by_direction[
MD_DirY];
55 m_nb_cell_ground.z = ((m_dimension == 2) ? 1 : global_nb_cells_by_direction[
MD_DirZ]);
57 if (m_nb_cell_ground.x <= 0)
58 ARCANE_FATAL(
"Bad value '{0}' for globalNbCells()[MD_DirX] (should be >0)", m_nb_cell_ground.x);
59 if (m_nb_cell_ground.y <= 0)
60 ARCANE_FATAL(
"Bad value '{0}' for globalNbCells()[MD_DirY] (should be >0)", m_nb_cell_ground.y);
61 if (m_nb_cell_ground.z <= 0)
62 ARCANE_FATAL(
"Bad value '{0}' for globalNbCells()[MD_DirZ] (should be >0)", m_nb_cell_ground.z);
64 if (m_dimension == 2) {
65 m_latest_cell_uid = m_nb_cell_ground.x * m_nb_cell_ground.y;
66 m_latest_node_uid = (m_nb_cell_ground.x + 1) * (m_nb_cell_ground.y + 1);
67 m_latest_face_uid = (m_nb_cell_ground.x * m_nb_cell_ground.y) * 2 + m_nb_cell_ground.x * 2 + m_nb_cell_ground.y;
70 m_latest_cell_uid = m_nb_cell_ground.x * m_nb_cell_ground.y * m_nb_cell_ground.z;
71 m_latest_node_uid = (m_nb_cell_ground.x + 1) * (m_nb_cell_ground.y + 1) * (m_nb_cell_ground.z + 1);
72 m_latest_face_uid = (m_nb_cell_ground.x + 1) * m_nb_cell_ground.y * m_nb_cell_ground.z + (m_nb_cell_ground.y + 1) * m_nb_cell_ground.z * m_nb_cell_ground.x + (m_nb_cell_ground.z + 1) * m_nb_cell_ground.x * m_nb_cell_ground.y;
75 m_first_cell_uid_level.add(0);
76 m_first_node_uid_level.add(0);
77 m_first_face_uid_level.add(0);
82 if (m_converting_numbering_face) {
83 UniqueArray<Int64> face_uid(CartesianMeshNumberingMngInternal::nbFaceByCell());
84 ENUMERATE_ (Cell, icell, m_mesh->allLevelCells(0)) {
85 CartesianMeshNumberingMngInternal::cellFaceUniqueIds(face_uid, 0, icell->uniqueId());
86 for (Integer i = 0; i < CartesianMeshNumberingMngInternal::nbFaceByCell(); ++i) {
87 m_face_ori_numbering_to_new[icell->face(i).uniqueId()] = face_uid[i];
88 m_face_new_numbering_to_ori[face_uid[i]] = icell->face(i).uniqueId();
98void CartesianMeshNumberingMngInternal::
101 m_properties =
makeRef(
new Properties(*(m_mesh->properties()),
"CartesianMeshNumberingMngInternal"));
107void CartesianMeshNumberingMngInternal::
108_saveInfosInProperties()
110 m_properties->set(
"Version", 1);
111 m_properties->set(
"FirstCellUIDByLevel", m_first_cell_uid_level);
114 m_properties->set(
"FirstNodeUIDByLevel", m_first_node_uid_level);
115 m_properties->set(
"FirstFaceUIDByLevel", m_first_face_uid_level);
117 m_properties->set(
"OriginalGroundLevelForConverting", m_ori_level);
123void CartesianMeshNumberingMngInternal::
126 Int32 v = m_properties->getInt32(
"Version");
128 ARCANE_FATAL(
"Bad numbering mng version: trying to read from incompatible checkpoint v={0} expected={1}", v, 1);
130 m_properties->get(
"FirstCellUIDByLevel", m_first_cell_uid_level);
131 m_properties->get(
"FirstNodeUIDByLevel", m_first_node_uid_level);
132 m_properties->get(
"FirstFaceUIDByLevel", m_first_face_uid_level);
134 m_properties->get(
"OriginalGroundLevelForConverting", m_ori_level);
135 if (m_ori_level == -1) {
136 m_converting_numbering_face =
false;
137 m_face_ori_numbering_to_new.clear();
138 m_face_new_numbering_to_ori.clear();
141 m_nb_cell_ground = { globalNbCellsX(0), globalNbCellsY(0), globalNbCellsZ(0) };
143 m_max_level = m_first_cell_uid_level.size() - 1;
149 for (
const Int64 elem : m_first_cell_uid_level) {
156 m_latest_cell_uid = m_first_cell_uid_level[pos] + nbCellInLevel(pos);
157 m_latest_node_uid = m_first_node_uid_level[pos] + nbNodeInLevel(pos);
158 m_latest_face_uid = m_first_face_uid_level[pos] + nbFaceInLevel(pos);
165void CartesianMeshNumberingMngInternal::
166renumberingFacesLevel0FromOriginalArcaneNumbering()
168 if (!m_converting_numbering_face)
176 icell->face(i).mutableItemBase().setUniqueId(face_uid[i]);
179 m_mesh->faceFamily()->notifyItemsUniqueIdChanged();
180 m_mesh->modifier()->endUpdate();
181 m_mesh->checkValidMesh();
183 m_converting_numbering_face =
false;
185 m_face_ori_numbering_to_new.clear();
186 m_face_new_numbering_to_ori.clear();
192void CartesianMeshNumberingMngInternal::
198 tm->
info() <<
"CartesianMeshNumberingMngInternal status :";
204 tm->
info() <<
"LatestCellUID : " << m_latest_cell_uid;
205 tm->
info() <<
"LatestNodeUID : " << m_latest_node_uid;
206 tm->
info() <<
"LatestFaceUID : " << m_latest_face_uid;
208 tm->
info() <<
"MinLevel : " << m_min_level;
209 tm->
info() <<
"MaxLevel : " << m_max_level;
211 tm->
info() <<
"GroundLevelNbCells : " << m_nb_cell_ground;
213 if (m_ori_level == -1) {
214 tm->
info() <<
"Ground Level is renumbered";
217 tm->
info() <<
"Ground Level is not renumbered -- OriginalGroundLevel : " << m_ori_level;
220 for (
Integer i = m_min_level; i <= m_max_level; ++i) {
221 tm->
info() <<
"Level " << i <<
" : ";
227 const auto* m_generation_info = ICartesianMeshGenerationInfo::getReference(m_mesh,
true);
230 tm->
info() <<
"global_nb_cells_by_direction.x : " << global_nb_cells_by_direction[
MD_DirX];
231 tm->
info() <<
"global_nb_cells_by_direction.y : " << global_nb_cells_by_direction[
MD_DirY];
232 tm->
info() <<
"global_nb_cells_by_direction.z : " << global_nb_cells_by_direction[
MD_DirZ];
238void CartesianMeshNumberingMngInternal::
239prepareLevel(
Int32 level)
241 if (level <= m_max_level && level >= m_min_level)
243 if (level == m_max_level + 1) {
245 m_first_cell_uid_level.add(m_latest_cell_uid);
246 m_first_node_uid_level.add(m_latest_node_uid);
247 m_first_face_uid_level.add(m_latest_face_uid);
249 else if (level == m_min_level - 1) {
251 _pushFront(m_first_cell_uid_level, m_latest_cell_uid);
252 _pushFront(m_first_node_uid_level, m_latest_node_uid);
253 _pushFront(m_first_face_uid_level, m_latest_face_uid);
267void CartesianMeshNumberingMngInternal::
270 const Int32 nb_levels_to_add = -m_min_level;
271 m_ori_level += nb_levels_to_add;
273 if (nb_levels_to_add == 0) {
277 m_max_level += nb_levels_to_add;
278 m_min_level += nb_levels_to_add;
280 const Integer to_div = m_pattern * nb_levels_to_add;
281 if (m_dimension == 2) {
282 m_nb_cell_ground.x /= to_div;
283 m_nb_cell_ground.y /= to_div;
287 m_nb_cell_ground /= to_div;
293 auto* cmgi = ICartesianMeshGenerationInfo::getReference(m_mesh,
false);
299 cmgi->setOwnCellOffsets(v[0] / to_div, v[1] / to_div, v[2] / to_div);
303 cmgi->setGlobalNbCells(v[0] / to_div, v[1] / to_div, v[2] / to_div);
307 cmgi->setOwnNbCells(v[0] / to_div, v[1] / to_div, v[2] / to_div);
317Int64 CartesianMeshNumberingMngInternal::
318firstCellUniqueId(
Integer level)
const
320 return m_first_cell_uid_level[level - m_min_level];
326Int64 CartesianMeshNumberingMngInternal::
327firstNodeUniqueId(
Integer level)
const
329 return m_first_node_uid_level[level - m_min_level];
335Int64 CartesianMeshNumberingMngInternal::
336firstFaceUniqueId(
Integer level)
const
338 return m_first_face_uid_level[level - m_min_level];
344Int64 CartesianMeshNumberingMngInternal::
345globalNbCellsX(
Integer level)
const
347 return static_cast<Int64>(
static_cast<Real>(m_nb_cell_ground.x) * std::pow(m_pattern, level));
353Int64 CartesianMeshNumberingMngInternal::
354globalNbCellsY(
Integer level)
const
356 return static_cast<Int64>(
static_cast<Real>(m_nb_cell_ground.y) * std::pow(m_pattern, level));
362Int64 CartesianMeshNumberingMngInternal::
363globalNbCellsZ(
Integer level)
const
365 return static_cast<Int64>(
static_cast<Real>(m_nb_cell_ground.z) * std::pow(m_pattern, level));
371Int64 CartesianMeshNumberingMngInternal::
372globalNbNodesX(
Integer level)
const
380Int64 CartesianMeshNumberingMngInternal::
381globalNbNodesY(
Integer level)
const
389Int64 CartesianMeshNumberingMngInternal::
390globalNbNodesZ(
Integer level)
const
398Int64 CartesianMeshNumberingMngInternal::
399globalNbFacesX(
Integer level)
const
407Int64 CartesianMeshNumberingMngInternal::
408globalNbFacesY(
Integer level)
const
416Int64 CartesianMeshNumberingMngInternal::
417globalNbFacesZ(
Integer level)
const
425Int64 CartesianMeshNumberingMngInternal::
426globalNbFacesXCartesianView(
Integer level)
const
434Int64 CartesianMeshNumberingMngInternal::
435globalNbFacesYCartesianView(
Integer level)
const
443Int64 CartesianMeshNumberingMngInternal::
444globalNbFacesZCartesianView(
Integer level)
const
452Int64 CartesianMeshNumberingMngInternal::
453nbCellInLevel(
Integer level)
const
455 if (m_dimension == 2) {
457 return nb_cell.x * nb_cell.y;
461 return nb_cell.x * nb_cell.y * nb_cell.z;
467Int64 CartesianMeshNumberingMngInternal::
468nbNodeInLevel(
Integer level)
const
470 if (m_dimension == 2) {
472 return (nb_cell.x + 1) * (nb_cell.y + 1);
476 return (nb_cell.x + 1) * (nb_cell.y + 1) * (nb_cell.z + 1);
482Int64 CartesianMeshNumberingMngInternal::
483nbFaceInLevel(
Integer level)
const
485 if (m_dimension == 2) {
487 return (nb_cell.x * nb_cell.y) * 2 + nb_cell.x * 2 + nb_cell.y;
491 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;
506Int32 CartesianMeshNumberingMngInternal::
507cellLevel(
Int64 uid)
const
512 for (
Integer i = m_min_level; i <= m_max_level; ++i) {
514 if (first_uid <= uid && first_uid > max) {
521 ARCANE_FATAL(
"CellUID is not in any patch (UID too low)");
524 ARCANE_FATAL(
"CellUID is not in any patch (UID too high)");
533Int32 CartesianMeshNumberingMngInternal::
534nodeLevel(
Int64 uid)
const
539 for (
Integer i = m_min_level; i <= m_max_level; ++i) {
541 if (first_uid <= uid && first_uid > max) {
548 ARCANE_FATAL(
"NodeUID is not in any patch (UID too low)");
551 ARCANE_FATAL(
"NodeUID is not in any patch (UID too high)");
560Int32 CartesianMeshNumberingMngInternal::
561faceLevel(
Int64 uid)
const
566 for (
Integer i = m_min_level; i <= m_max_level; ++i) {
568 if (first_uid <= uid && first_uid > max) {
575 ARCANE_FATAL(
"FaceUID is not in any patch (UID too low)");
578 ARCANE_FATAL(
"FaceUID is not in any patch (UID too high)");
588Int64 CartesianMeshNumberingMngInternal::
591 if (level_from == level_to) {
594 if (level_from < level_to) {
595 return coord * m_pattern * (level_to - level_from);
597 return coord / (m_pattern * (level_from - level_to));
604Int64 CartesianMeshNumberingMngInternal::
627 if (level_from == level_to) {
630 else if (level_from < level_to) {
632 if (coord % 2 == 0) {
636 return ((coord - 1) *
pattern) + 1;
641 if (coord % 2 == 0) {
642 if (coord % (
pattern * 2) == 0) {
666Int64 CartesianMeshNumberingMngInternal::
673 uid -= first_cell_uid;
675 const Int64 to2d = uid % (nb_cell_x * nb_cell_y);
676 return to2d % nb_cell_x;
682Int64 CartesianMeshNumberingMngInternal::
683cellUniqueIdToCoordX(
Cell cell)
691Int64 CartesianMeshNumberingMngInternal::
698 uid -= first_cell_uid;
700 const Int64 to2d = uid % (nb_cell_x * nb_cell_y);
701 return to2d / nb_cell_x;
707Int64 CartesianMeshNumberingMngInternal::
708cellUniqueIdToCoordY(
Cell cell)
716Int64 CartesianMeshNumberingMngInternal::
723 uid -= first_cell_uid;
725 return uid / (nb_cell_x * nb_cell_y);
731Int64 CartesianMeshNumberingMngInternal::
732cellUniqueIdToCoordZ(
Cell cell)
740Int64 CartesianMeshNumberingMngInternal::
747 uid -= first_node_uid;
749 const Int64 to2d = uid % (nb_node_x * nb_node_y);
750 return to2d % nb_node_x;
756Int64 CartesianMeshNumberingMngInternal::
757nodeUniqueIdToCoordX(
Node node)
766Int64 CartesianMeshNumberingMngInternal::
773 uid -= first_node_uid;
775 const Int64 to2d = uid % (nb_node_x * nb_node_y);
776 return to2d / nb_node_x;
782Int64 CartesianMeshNumberingMngInternal::
783nodeUniqueIdToCoordY(
Node node)
792Int64 CartesianMeshNumberingMngInternal::
799 uid -= first_node_uid;
801 return uid / (nb_node_x * nb_node_y);
807Int64 CartesianMeshNumberingMngInternal::
808nodeUniqueIdToCoordZ(
Node node)
817Int64 CartesianMeshNumberingMngInternal::
820 if (m_dimension == 2) {
825 uid -= first_face_uid;
848 return uid % nb_face_x;
857 uid -= first_face_uid;
884 if (uid < three_parts_numbering.x) {
894 return (uid % nb_face_x) * 2;
900 else if (uid < three_parts_numbering.x + three_parts_numbering.y) {
901 uid -= three_parts_numbering.x;
910 return (uid % nb_cell_x) * 2 + 1;
917 uid -= three_parts_numbering.x + three_parts_numbering.y;
926 return (uid % nb_cell_x) * 2 + 1;
934Int64 CartesianMeshNumberingMngInternal::
935faceUniqueIdToCoordX(
Face face)
944Int64 CartesianMeshNumberingMngInternal::
947 if (m_dimension == 2) {
951 uid -= first_face_uid;
974 const Int64 flat_pos = uid / nb_face_x;
975 return (flat_pos * 2) + (flat_pos % 2 == uid % 2 ? 0 : 1) - 1;
986 uid -= first_face_uid;
1013 if (uid < three_parts_numbering.x) {
1014 uid %= nb_face_x * nb_cell_y;
1025 return (uid / nb_face_x) * 2 + 1;
1031 else if (uid < three_parts_numbering.x + three_parts_numbering.y) {
1032 uid -= three_parts_numbering.x;
1033 uid %= nb_cell_x * nb_face_y;
1044 return (uid / nb_cell_x) * 2;
1051 uid -= three_parts_numbering.x + three_parts_numbering.y;
1052 uid %= nb_cell_x * nb_cell_y;
1063 return (uid / nb_cell_x) * 2 + 1;
1071Int64 CartesianMeshNumberingMngInternal::
1072faceUniqueIdToCoordY(
Face face)
1081Int64 CartesianMeshNumberingMngInternal::
1092 uid -= first_face_uid;
1119 if (uid < three_parts_numbering.x) {
1130 return (uid / (nb_face_x * nb_cell_y)) * 2 + 1;
1136 else if (uid < three_parts_numbering.x + three_parts_numbering.y) {
1137 uid -= three_parts_numbering.x;
1148 return (uid / (nb_cell_x * nb_face_y)) * 2 + 1;
1155 uid -= three_parts_numbering.x + three_parts_numbering.y;
1166 return (uid / (nb_cell_x * nb_cell_y)) * 2;
1173Int64 CartesianMeshNumberingMngInternal::
1174faceUniqueIdToCoordZ(
Face face)
1183Int64 CartesianMeshNumberingMngInternal::
1184cellUniqueId(
Integer level, Int64x3 cell_coord)
1190 return (cell_coord.x + cell_coord.y * nb_cell_x + cell_coord.z * nb_cell_x * nb_cell_y) + first_cell_uid;
1196Int64 CartesianMeshNumberingMngInternal::
1197cellUniqueId(
Integer level, Int64x2 cell_coord)
1202 return (cell_coord.x + cell_coord.y * nb_cell_x) + first_cell_uid;
1208Int64 CartesianMeshNumberingMngInternal::
1209nodeUniqueId(
Integer level, Int64x3 node_coord)
1215 return (node_coord.x + node_coord.y * nb_node_x + node_coord.z * nb_node_x * nb_node_y) + first_node_uid;
1221Int64 CartesianMeshNumberingMngInternal::
1222nodeUniqueId(
Integer level, Int64x2 node_coord)
1227 return (node_coord.x + node_coord.y * nb_node_x) + first_node_uid;
1233Int64 CartesianMeshNumberingMngInternal::
1234faceUniqueId(
Integer level, Int64x3 face_coord)
1269 if (face_coord.x % 2 == 0) {
1279 uid += face_coord.x + (face_coord.y * nb_face_x) + (face_coord.z * nb_face_x * nb_cell_y);
1283 else if (face_coord.y % 2 == 0) {
1284 uid += three_parts_numbering.x;
1294 uid += face_coord.x + (face_coord.y * nb_cell_x) + (face_coord.z * nb_cell_x * nb_face_y);
1298 else if (face_coord.z % 2 == 0) {
1299 uid += three_parts_numbering.x + three_parts_numbering.y;
1309 uid += face_coord.x + (face_coord.y * nb_cell_x) + (face_coord.z * nb_cell_x * nb_cell_y);
1312 ARCANE_FATAL(
"Bizarre -- x : {0} -- y : {1} -- z : {2}", face_coord.x, face_coord.y, face_coord.z);
1321Int64 CartesianMeshNumberingMngInternal::
1322faceUniqueId(
Integer level, Int64x2 face_coord)
1349 const Int64 a = (face_coord.y / 2) * nb_face_x;
1351 return (face_coord.x + a - 1) + first_face_uid;
1360 return static_cast<Integer>(std::pow(m_pattern, m_mesh->dimension()));
1366void CartesianMeshNumberingMngInternal::
1376 uid[0] = (cell_coord.x + 0) + ((cell_coord.y + 0) * nb_node_x) + ((cell_coord.z + 0) * nb_node_x * nb_node_y) + first_node_uid;
1377 uid[1] = (cell_coord.x + 1) + ((cell_coord.y + 0) * nb_node_x) + ((cell_coord.z + 0) * nb_node_x * nb_node_y) + first_node_uid;
1378 uid[2] = (cell_coord.x + 1) + ((cell_coord.y + 1) * nb_node_x) + ((cell_coord.z + 0) * nb_node_x * nb_node_y) + first_node_uid;
1379 uid[3] = (cell_coord.x + 0) + ((cell_coord.y + 1) * nb_node_x) + ((cell_coord.z + 0) * nb_node_x * nb_node_y) + first_node_uid;
1381 uid[4] = (cell_coord.x + 0) + ((cell_coord.y + 0) * nb_node_x) + ((cell_coord.z + 1) * nb_node_x * nb_node_y) + first_node_uid;
1382 uid[5] = (cell_coord.x + 1) + ((cell_coord.y + 0) * nb_node_x) + ((cell_coord.z + 1) * nb_node_x * nb_node_y) + first_node_uid;
1383 uid[6] = (cell_coord.x + 1) + ((cell_coord.y + 1) * nb_node_x) + ((cell_coord.z + 1) * nb_node_x * nb_node_y) + first_node_uid;
1384 uid[7] = (cell_coord.x + 0) + ((cell_coord.y + 1) * nb_node_x) + ((cell_coord.z + 1) * nb_node_x * nb_node_y) + first_node_uid;
1390void CartesianMeshNumberingMngInternal::
1399 uid[0] = (cell_coord.x + 0) + ((cell_coord.y + 0) * nb_node_x) + first_node_uid;
1400 uid[1] = (cell_coord.x + 1) + ((cell_coord.y + 0) * nb_node_x) + first_node_uid;
1401 uid[2] = (cell_coord.x + 1) + ((cell_coord.y + 1) * nb_node_x) + first_node_uid;
1402 uid[3] = (cell_coord.x + 0) + ((cell_coord.y + 1) * nb_node_x) + first_node_uid;
1408void CartesianMeshNumberingMngInternal::
1411 if (m_dimension == 2) {
1424void CartesianMeshNumberingMngInternal::
1436 return m_pattern * m_dimension;
1442void CartesianMeshNumberingMngInternal::
1449 const Int64x3 nb_face(nb_cell + 1);
1493 const Int64 total_face_yz = nb_face.x * nb_cell.y * nb_cell.z;
1494 const Int64 total_face_yz_zx = total_face_yz + nb_face.y * nb_cell.z * nb_cell.x;
1496 const Int64 nb_cell_before_j = cell_coord.y * nb_cell.x;
1498 uid[0] = (cell_coord.z * nb_cell.x * nb_cell.y) + nb_cell_before_j + cell_coord.x + total_face_yz_zx;
1500 uid[3] = uid[0] + nb_cell.x * nb_cell.y;
1502 uid[1] = (cell_coord.z * nb_face.x * nb_cell.y) + (cell_coord.y * nb_face.x) + cell_coord.x;
1504 uid[4] = uid[1] + 1;
1506 uid[2] = (cell_coord.z * nb_cell.x * nb_face.y) + nb_cell_before_j + cell_coord.x + total_face_yz;
1508 uid[5] = uid[2] + nb_cell.x;
1510 uid[0] += first_face_uid;
1511 uid[1] += first_face_uid;
1512 uid[2] += first_face_uid;
1513 uid[3] += first_face_uid;
1514 uid[4] += first_face_uid;
1515 uid[5] += first_face_uid;
1523void CartesianMeshNumberingMngInternal::
1530 const Int64 nb_face_x = nb_cell_x + 1;
1551 uid[0] = cell_coord.x * 2 + cell_coord.y * (nb_face_x + nb_cell_x);
1555 uid[2] = uid[0] + (nb_face_x + nb_cell_x);
1558 uid[3] = uid[2] - 1;
1561 uid[1] = uid[2] + 1;
1563 uid[0] += first_face_uid;
1564 uid[1] += first_face_uid;
1565 uid[2] += first_face_uid;
1566 uid[3] += first_face_uid;
1572void CartesianMeshNumberingMngInternal::
1575 if (m_dimension == 2) {
1588void CartesianMeshNumberingMngInternal::
1597void CartesianMeshNumberingMngInternal::
1600 ARCANE_ASSERT((uid.
size() == 27), (
"Size of uid array != 27"));
1608 for (
Integer k = -1; k < 2; ++k) {
1609 const Int64 coord_around_cell_z = cell_coord.z + k;
1610 if (coord_around_cell_z >= 0 && coord_around_cell_z < nb_cells_z) {
1612 for (
Integer j = -1; j < 2; ++j) {
1613 const Int64 coord_around_cell_y = cell_coord.y + j;
1614 if (coord_around_cell_y >= 0 && coord_around_cell_y < nb_cells_y) {
1616 for (
Integer i = -1; i < 2; ++i) {
1617 const Int64 coord_around_cell_x = cell_coord.x + i;
1618 if (coord_around_cell_x >= 0 && coord_around_cell_x < nb_cells_x) {
1619 uid[(i + 1) + ((j + 1) * 3) + ((k + 1) * 9)] =
cellUniqueId(level, Int64x3{ coord_around_cell_x, coord_around_cell_y, coord_around_cell_z });
1631void CartesianMeshNumberingMngInternal::
1634 ARCANE_ASSERT((uid.
size() == 9), (
"Size of uid array != 9"));
1641 for (
Integer j = -1; j < 2; ++j) {
1642 const Int64 coord_around_cell_y = cell_coord.y + j;
1643 if (coord_around_cell_y >= 0 && coord_around_cell_y < nb_cells_y) {
1645 for (
Integer i = -1; i < 2; ++i) {
1646 const Int64 coord_around_cell_x = cell_coord.x + i;
1647 if (coord_around_cell_x >= 0 && coord_around_cell_x < nb_cells_x) {
1648 uid[(i + 1) + ((j + 1) * 3)] =
cellUniqueId(level, Int64x2{ coord_around_cell_x, coord_around_cell_y });
1658void CartesianMeshNumberingMngInternal::
1661 if (m_dimension == 2) {
1674void CartesianMeshNumberingMngInternal::
1683void CartesianMeshNumberingMngInternal::
1686 ARCANE_ASSERT((uid.
size() == 8), (
"Size of uid array != 8"));
1694 for (
Integer k = -1; k < 1; ++k) {
1695 const Int64 coord_cell_z = node_coord.z + k;
1696 if (coord_cell_z >= 0 && coord_cell_z < nb_cells_z) {
1698 for (
Integer j = -1; j < 1; ++j) {
1699 const Int64 coord_cell_y = node_coord.y + j;
1700 if (coord_cell_y >= 0 && coord_cell_y < nb_cells_y) {
1702 for (
Integer i = -1; i < 1; ++i) {
1703 const Int64 coord_cell_x = node_coord.x + i;
1704 if (coord_cell_x >= 0 && coord_cell_x < nb_cells_x) {
1705 uid[(i + 1) + ((j + 1) * 2) + ((k + 1) * 4)] =
cellUniqueId(level, Int64x3{ coord_cell_x, coord_cell_y, coord_cell_z });
1717void CartesianMeshNumberingMngInternal::
1720 ARCANE_ASSERT((uid.
size() == 4), (
"Size of uid array != 4"));
1727 for (
Integer j = -1; j < 1; ++j) {
1728 const Int64 coord_cell_y = node_coord.y + j;
1729 if (coord_cell_y >= 0 && coord_cell_y < nb_cells_y) {
1731 for (
Integer i = -1; i < 1; ++i) {
1732 const Int64 coord_cell_x = node_coord.x + i;
1733 if (coord_cell_x >= 0 && coord_cell_x < nb_cells_x) {
1734 uid[(i + 1) + ((j + 1) * 2)] =
cellUniqueId(level, Int64x2{ coord_cell_x, coord_cell_y });
1744void CartesianMeshNumberingMngInternal::
1747 if (m_dimension == 2) {
1760void CartesianMeshNumberingMngInternal::
1769void CartesianMeshNumberingMngInternal::
1770setChildNodeCoordinates(
Cell parent_cell)
1778 const Real3& node0(nodes_coords[parent_cell.
node(0)]);
1779 const Real3& node1(nodes_coords[parent_cell.
node(1)]);
1780 const Real3& node2(nodes_coords[parent_cell.
node(2)]);
1781 const Real3& node3(nodes_coords[parent_cell.
node(3)]);
1783 if (m_dimension == 2) {
1818 const Real i = (node3.
x - node0.
x) * y + node0.
x;
1819 const Real j = (node2.
x - node1.
x) * y + node1.
x;
1821 const Real k = (node1.
y - node0.
y) * x + node0.
y;
1822 const Real l = (node2.
y - node3.
y) * x + node3.
y;
1824 const Real tx = (j - i) * x + i;
1825 const Real ty = (l - k) * y + k;
1842 return { tx, ty, 0 };
1845 const Integer node_1d_2d_x[] = { 0, 1, 1, 0 };
1846 const Integer node_1d_2d_y[] = { 0, 0, 1, 1 };
1848 for (
Integer j = 0; j < m_pattern; ++j) {
1849 for (
Integer i = 0; i < m_pattern; ++i) {
1851 Integer begin = (i == 0 && j == 0 ? 0 : j == 0 ? 1
1856 for (
Integer inode = begin; inode < end; ++inode) {
1857 nodes_coords[child.
node(inode)] = txty(i + node_1d_2d_x[inode], j + node_1d_2d_y[inode]);
1870 const Real3& node4(nodes_coords[parent_cell.
node(4)]);
1871 const Real3& node5(nodes_coords[parent_cell.
node(5)]);
1872 const Real3& node6(nodes_coords[parent_cell.
node(6)]);
1873 const Real3& node7(nodes_coords[parent_cell.
node(7)]);
1885 const Real3 m = (node4 - node0) * z + node0;
1886 const Real3 n = (node5 - node1) * z + node1;
1887 const Real3 o = (node6 - node2) * z + node2;
1888 const Real3 p = (node7 - node3) * z + node3;
1891 const Real i = (p.
x - m.
x) * y + m.
x;
1892 const Real j = (o.
x - n.
x) * y + n.
x;
1894 const Real tx = (j - i) * x + i;
1896 const Real k = (n.
y - m.
y) * x + m.
y;
1897 const Real l = (o.
y - p.
y) * x + p.
y;
1899 const Real ty = (l - k) * y + k;
1901 const Real q = (p.
z - m.
z) * y + m.
z;
1902 const Real r = (o.
z - n.
z) * y + n.
z;
1904 const Real s = (n.
z - m.
z) * x + m.
z;
1905 const Real t = (o.
z - p.
z) * x + p.
z;
1907 const Real tz = (((r - q) * x + q) + ((t - s) * y + s)) * 0.5;
1937 return { tx, ty, tz };
1940 const Integer node_1d_3d_x[] = { 0, 1, 1, 0, 0, 1, 1, 0 };
1941 const Integer node_1d_3d_y[] = { 0, 0, 1, 1, 0, 0, 1, 1 };
1942 const Integer node_1d_3d_z[] = { 0, 0, 0, 0, 1, 1, 1, 1 };
1944 for (
Integer k = 0; k < m_pattern; ++k) {
1945 for (
Integer j = 0; j < m_pattern; ++j) {
1946 for (
Integer i = 0; i < m_pattern; ++i) {
1953 for (
Integer inode = begin; inode < end; ++inode) {
1954 nodes_coords[child.
node(inode)] = txtytz(i + node_1d_3d_x[inode], j + node_1d_3d_y[inode], k + node_1d_3d_z[inode]);
1972void CartesianMeshNumberingMngInternal::
1973setParentNodeCoordinates(
Cell parent_cell)
1981 if (m_dimension == 2) {
1982 nodes_coords[parent_cell.
node(0)] = nodes_coords[
childCellOfCell(parent_cell, Int64x2(0, 0)).node(0)];
1983 nodes_coords[parent_cell.
node(1)] = nodes_coords[
childCellOfCell(parent_cell, Int64x2(m_pattern - 1, 0)).node(1)];
1984 nodes_coords[parent_cell.
node(2)] = nodes_coords[
childCellOfCell(parent_cell, Int64x2(m_pattern - 1, m_pattern - 1)).node(2)];
1985 nodes_coords[parent_cell.
node(3)] = nodes_coords[
childCellOfCell(parent_cell, Int64x2(0, m_pattern - 1)).node(3)];
1989 nodes_coords[parent_cell.
node(0)] = nodes_coords[
childCellOfCell(parent_cell, Int64x3(0, 0, 0)).node(0)];
1990 nodes_coords[parent_cell.
node(1)] = nodes_coords[
childCellOfCell(parent_cell, Int64x3(m_pattern - 1, 0, 0)).node(1)];
1991 nodes_coords[parent_cell.
node(2)] = nodes_coords[
childCellOfCell(parent_cell, Int64x3(m_pattern - 1, m_pattern - 1, 0)).node(2)];
1992 nodes_coords[parent_cell.
node(3)] = nodes_coords[
childCellOfCell(parent_cell, Int64x3(0, m_pattern - 1, 0)).node(3)];
1994 nodes_coords[parent_cell.
node(4)] = nodes_coords[
childCellOfCell(parent_cell, Int64x3(0, 0, m_pattern - 1)).node(4)];
1995 nodes_coords[parent_cell.
node(5)] = nodes_coords[
childCellOfCell(parent_cell, Int64x3(m_pattern - 1, 0, m_pattern - 1)).node(5)];
1996 nodes_coords[parent_cell.
node(6)] = nodes_coords[
childCellOfCell(parent_cell, Int64x3(m_pattern - 1, m_pattern - 1, m_pattern - 1)).node(6)];
1997 nodes_coords[parent_cell.
node(7)] = nodes_coords[
childCellOfCell(parent_cell, Int64x3(0, m_pattern - 1, m_pattern - 1)).node(7)];
2004Int64 CartesianMeshNumberingMngInternal::
2005parentCellUniqueIdOfCell(
Int64 uid,
Integer level,
bool do_fatal)
2016 return NULL_ITEM_UNIQUE_ID;
2019 if (m_dimension == 2) {
2035Int64 CartesianMeshNumberingMngInternal::
2036parentCellUniqueIdOfCell(
Cell cell,
bool do_fatal)
2044Int64 CartesianMeshNumberingMngInternal::
2045childCellUniqueIdOfCell(
Cell cell, Int64x3 child_coord_in_parent)
2047 ARCANE_ASSERT((child_coord_in_parent.x < m_pattern && child_coord_in_parent.x >= 0), (
"Bad child_coord_in_parent.x"))
2048 ARCANE_ASSERT((child_coord_in_parent.y < m_pattern && child_coord_in_parent.y >= 0), (
"Bad child_coord_in_parent.y"))
2049 ARCANE_ASSERT((child_coord_in_parent.z < m_pattern && child_coord_in_parent.z >= 0), (
"Bad child_coord_in_parent.z"))
2063Int64 CartesianMeshNumberingMngInternal::
2064childCellUniqueIdOfCell(
Cell cell, Int64x2 child_coord_in_parent)
2066 ARCANE_ASSERT((child_coord_in_parent.x < m_pattern && child_coord_in_parent.x >= 0), (
"Bad child_coord_in_parent.x"))
2067 ARCANE_ASSERT((child_coord_in_parent.y < m_pattern && child_coord_in_parent.y >= 0), (
"Bad child_coord_in_parent.y"))
2080Int64 CartesianMeshNumberingMngInternal::
2081childCellUniqueIdOfCell(
Cell cell,
Int64 child_index_in_parent)
2083 if (m_dimension == 2) {
2084 ARCANE_ASSERT((child_index_in_parent < m_pattern * m_pattern && child_index_in_parent >= 0), (
"Bad child_index_in_parent"))
2088 child_index_in_parent % m_pattern,
2089 child_index_in_parent / m_pattern));
2093 ARCANE_ASSERT((child_index_in_parent < m_pattern * m_pattern * m_pattern && child_index_in_parent >= 0), (
"Bad child_index_in_parent"))
2095 const Int64 to_2d = child_index_in_parent % (m_pattern * m_pattern);
2100 child_index_in_parent / (m_pattern * m_pattern)));
2107Cell CartesianMeshNumberingMngInternal::
2108childCellOfCell(
Cell cell, Int64x3 child_coord_in_parent)
2110 ARCANE_ASSERT((child_coord_in_parent.x < m_pattern && child_coord_in_parent.x >= 0), (
"Bad child_coord_in_parent.x"))
2111 ARCANE_ASSERT((child_coord_in_parent.y < m_pattern && child_coord_in_parent.y >= 0), (
"Bad child_coord_in_parent.y"))
2113 Cell child = cell.
hChild((
Int32)child_coord_in_parent.x + ((
Int32)child_coord_in_parent.y * m_pattern) + ((
Int32)child_coord_in_parent.z * m_pattern * m_pattern));
2120 for (
Integer i = 0; i < nb_children; ++i) {
2133Cell CartesianMeshNumberingMngInternal::
2134childCellOfCell(
Cell cell, Int64x2 child_coord_in_parent)
2136 ARCANE_ASSERT((child_coord_in_parent.x < m_pattern && child_coord_in_parent.x >= 0), (
"Bad child_coord_in_parent.x"))
2137 ARCANE_ASSERT((child_coord_in_parent.y < m_pattern && child_coord_in_parent.y >= 0), (
"Bad child_coord_in_parent.y"))
2139 Cell child = cell.
hChild((
Int32)child_coord_in_parent.x + ((
Int32)child_coord_in_parent.y * m_pattern));
2146 for (
Integer i = 0; i < nb_children; ++i) {
2159Int64 CartesianMeshNumberingMngInternal::
2160parentNodeUniqueIdOfNode(
Int64 uid,
Integer level,
bool do_fatal)
2169 if (coord_x % m_pattern != 0 || coord_y % m_pattern != 0) {
2173 return NULL_ITEM_UNIQUE_ID;
2176 if (m_dimension == 2) {
2184 if (coord_z % m_pattern != 0) {
2188 return NULL_ITEM_UNIQUE_ID;
2200Int64 CartesianMeshNumberingMngInternal::
2201parentNodeUniqueIdOfNode(
Node node,
bool do_fatal)
2210Int64 CartesianMeshNumberingMngInternal::
2213 if (m_dimension == 2) {
2230Int64 CartesianMeshNumberingMngInternal::
2231childNodeUniqueIdOfNode(
Node node)
2240Int64 CartesianMeshNumberingMngInternal::
2241parentFaceUniqueIdOfFace(
Int64 uid,
Integer level,
bool do_fatal)
2243 if (m_converting_numbering_face && level == m_ori_level) {
2244 uid = m_face_ori_numbering_to_new[uid];
2261 if (parent_coord_x == -1 || parent_coord_y == -1) {
2265 return NULL_ITEM_UNIQUE_ID;
2271 if (m_dimension == 2) {
2272 if (m_converting_numbering_face && level - 1 == m_ori_level) {
2273 return m_face_new_numbering_to_ori[
faceUniqueId(level - 1, Int64x2(parent_coord_x, parent_coord_y))];
2275 return faceUniqueId(level - 1, Int64x2(parent_coord_x, parent_coord_y));
2283 if (parent_coord_z == -1) {
2287 return NULL_ITEM_UNIQUE_ID;
2294 if (m_converting_numbering_face && level - 1 == m_ori_level) {
2295 return m_face_new_numbering_to_ori[
faceUniqueId(level - 1, Int64x3(parent_coord_x, parent_coord_y, parent_coord_z))];
2298 return faceUniqueId(level - 1, Int64x3(parent_coord_x, parent_coord_y, parent_coord_z));
2305Int64 CartesianMeshNumberingMngInternal::
2306parentFaceUniqueIdOfFace(
Face face,
bool do_fatal)
2315Int64 CartesianMeshNumberingMngInternal::
2318 if (m_converting_numbering_face && level == m_ori_level) {
2319 uid = m_face_ori_numbering_to_new[uid];
2331 ARCANE_ASSERT((first_child_coord_x <
globalNbFacesXCartesianView(level + 1) && first_child_coord_x >= 0), (
"Bad first_child_coord_x"))
2332 ARCANE_ASSERT((first_child_coord_y <
globalNbFacesYCartesianView(level + 1) && first_child_coord_y >= 0), (
"Bad first_child_coord_y"))
2334 if (m_dimension == 2) {
2335 ARCANE_ASSERT((child_index_in_parent < m_pattern && child_index_in_parent >= 0), (
"Invalid child_index_in_parent"))
2337 if (coord_y % 2 == 0) {
2338 first_child_coord_x += child_index_in_parent * 2;
2340 else if (coord_x % 2 == 0) {
2341 first_child_coord_y += child_index_in_parent *
globalNbFacesY(level + 1);
2347 if (m_converting_numbering_face && level + 1 == m_ori_level) {
2348 return m_face_new_numbering_to_ori[
faceUniqueId(level + 1, Int64x2(first_child_coord_x, first_child_coord_y))];
2351 return faceUniqueId(level + 1, Int64x2(first_child_coord_x, first_child_coord_y));
2355 ARCANE_ASSERT((child_index_in_parent < m_pattern * m_pattern && child_index_in_parent >= 0), (
"Invalid child_index_in_parent"))
2361 ARCANE_ASSERT((first_child_coord_z <
globalNbFacesZCartesianView(level + 1) && first_child_coord_z >= 0), (
"Bad first_child_coord_z"))
2363 Int64 child_x = child_index_in_parent % m_pattern;
2364 Int64 child_y = child_index_in_parent / m_pattern;
2368 if (uid < three_parts_numbering.x) {
2369 first_child_coord_y += child_x * 2;
2370 first_child_coord_z += child_y * 2;
2372 else if (uid < three_parts_numbering.x + three_parts_numbering.y) {
2373 first_child_coord_x += child_x * 2;
2374 first_child_coord_z += child_y * 2;
2377 first_child_coord_x += child_x * 2;
2378 first_child_coord_y += child_y * 2;
2381 if (m_converting_numbering_face && level + 1 == m_ori_level) {
2382 return m_face_new_numbering_to_ori[
faceUniqueId(level + 1, Int64x3(first_child_coord_x, first_child_coord_y, first_child_coord_z))];
2385 return faceUniqueId(level + 1, Int64x3(first_child_coord_x, first_child_coord_y, first_child_coord_z));
2392Int64 CartesianMeshNumberingMngInternal::
2393childFaceUniqueIdOfFace(
Face face,
Int64 child_index_in_parent)
2402Int64x3 CartesianMeshNumberingMngInternal::
2403_face3DNumberingThreeParts(
Integer level)
const
2406 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 };
2412void CartesianMeshNumberingMngInternal::
2416 array.
back() = elem;
2418 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.
Int64 globalNbFacesY(Integer level) const override
Méthode permettant de récupérer le nombre de faces global en Y d'un niveau.
Int64 firstCellUniqueId(Integer level) const override
Méthode permettant de récupérer le premier unique id utilisé par les mailles d'un niveau....
Int64 firstFaceUniqueId(Integer level) const override
Méthode permettant de récupérer le premier unique id utilisé par les faces d'un niveau....
Int64 nbNodeInLevel(Integer level) const override
Méthode permettant de récupérer le nombre de noeuds total dans un niveau.
Int64 nodeUniqueIdToCoordX(Int64 uid, Integer level) override
Méthode permettant de récupérer la coordonnée en X d'un noeud grâce à son uniqueId.
Int64 offsetLevelToLevel(Int64 coord, Integer level_from, Integer level_to) const override
Méthode permettant d'obtenir la position du premier noeud/maille fille à partir de la position du noe...
Int64 cellUniqueIdToCoordY(Int64 uid, Integer level) override
Méthode permettant de récupérer la coordonnée en Y d'une maille grâce à son uniqueId.
Int64 faceUniqueIdToCoordZ(Int64 uid, Integer level) override
Méthode permettant de récupérer la coordonnée en Z d'une face grâce à son uniqueId.
Int64 cellUniqueIdToCoordX(Int64 uid, Integer level) override
Méthode permettant de récupérer la coordonnée en X d'une maille grâce à son uniqueId.
Int64 faceUniqueIdToCoordY(Int64 uid, Integer level) override
Méthode permettant de récupérer la coordonnée en Y d'une face grâce à son uniqueId.
Integer pattern() const override
Méthode permettant de récupérer le pattern de raffinement utilisé dans chaque maille....
Int64 faceUniqueId(Integer level, Int64x3 face_coord) override
Méthode permettant de récupérer l'uniqueId d'une face à partir de sa position et de son niveau.
Int64 firstNodeUniqueId(Integer level) const override
Méthode permettant de récupérer le premier unique id utilisé par les noeuds d'un niveau....
Int64 globalNbFacesX(Integer level) const override
Méthode permettant de récupérer le nombre de faces global en X d'un niveau.
Int64 faceUniqueIdToCoordX(Int64 uid, Integer level) override
Méthode permettant de récupérer la coordonnée en X d'une face grâce à son uniqueId.
Int64 globalNbCellsY(Integer level) const override
Méthode permettant de récupérer le nombre de mailles global en Y d'un niveau.
Int64 faceOffsetLevelToLevel(Int64 coord, Integer level_from, Integer level_to) const override
Méthode permettant d'obtenir la position de la première face enfant à partir de la position de la fac...
Int64 globalNbCellsX(Integer 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 globalNbNodesY(Integer level) const override
Méthode permettant de récupérer le nombre de noeuds global en Y d'un niveau.
void cellNodeUniqueIds(ArrayView< Int64 > uid, Integer level, Int64x3 cell_coord) override
Méthode permettant de récupérer les uniqueIds des noeuds d'une maille à partir de ses coordonnées.
Int64 nodeUniqueId(Integer level, Int64x3 node_coord) override
Méthode permettant de récupérer l'uniqueId d'un noeud à partir de sa position et de son niveau.
Int64 cellUniqueId(Integer level, Int64x3 cell_coord) override
Méthode permettant de récupérer l'uniqueId d'une maille à partir de sa position et de son niveau.
void cellUniqueIdsAroundNode(ArrayView< Int64 > uid, Int64x3 node_coord, Int32 level) override
Méthode permettant de récupérer les uniqueIds des mailles autour d'un noeud.
Int64x3 _face3DNumberingThreeParts(Integer level) const
Méthode permettant de récupérer le nombre de faces des trois parties de la numérotation.
Int64 parentNodeUniqueIdOfNode(Int64 uid, Integer level, bool do_fatal) override
Méthode permettant de récupérer l'uniqueId du parent d'un noeud.
Int64 childCellUniqueIdOfCell(Cell cell, Int64x3 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...
Int64 parentFaceUniqueIdOfFace(Int64 uid, Integer level, bool do_fatal) override
Méthode permettant de récupérer l'uniqueId du parent d'une face.
Int64 globalNbFacesXCartesianView(Integer level) const override
Méthode permettant de récupérer la taille de la vue "grille cartésienne" contenant les faces.
Int64 globalNbCellsZ(Integer level) const override
Méthode permettant de récupérer le nombre de mailles global en Z d'un niveau.
Int64 nbFaceInLevel(Integer level) const override
Méthode permettant de récupérer le nombre de faces total dans un niveau.
Int64 childNodeUniqueIdOfNode(Int64 uid, Integer level) override
Méthode permettant de récupérer l'uniqueId d'un noeud enfant d'un noeud parent.
Int64 globalNbFacesYCartesianView(Integer level) const override
Méthode permettant de récupérer la taille de la vue "grille cartésienne" contenant les faces.
Int64 parentCellUniqueIdOfCell(Int64 uid, Integer level, bool do_fatal) override
Méthode permettant de récupérer l'uniqueId du parent d'une maille.
Int64 nbCellInLevel(Integer level) const override
Méthode permettant de récupérer le nombre de mailles total dans un niveau.
Integer nbNodeByCell() override
Méthode permettant de récupérer le nombre de noeuds dans une maille.
Int64 cellUniqueIdToCoordZ(Int64 uid, Integer level) override
Méthode permettant de récupérer la coordonnée en Z d'une maille grâce à son uniqueId.
Int64 nodeUniqueIdToCoordZ(Int64 uid, Integer level) override
Méthode permettant de récupérer la coordonnée en Z d'un noeud grâce à son uniqueId.
Int64 globalNbNodesX(Integer level) const override
Méthode permettant de récupérer le nombre de noeuds global en X d'un niveau.
Int64 childFaceUniqueIdOfFace(Int64 uid, Integer level, Int64 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...
Integer nbFaceByCell() override
Méthode permettant de récupérer le nombre de faces dans une maille.
void cellFaceUniqueIds(ArrayView< Int64 > uid, Integer level, Int64x3 cell_coord) override
Méthode permettant de récupérer les uniqueIds des faces d'une maille à partir de ses coordonnées.
Int64 globalNbFacesZCartesianView(Integer level) const override
Méthode permettant de récupérer la taille de la vue "grille cartésienne" contenant les faces.
Cell childCellOfCell(Cell cell, Int64x3 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...
Int32 nodeLevel(Int64 uid) const override
Méthode permettant de récupérer le niveau d'un noeud avec son uid.
void cellUniqueIdsAroundCell(ArrayView< Int64 > uid, Int64x3 cell_coord, Int32 level) override
Méthode permettant de récupérer les uniqueIds des mailles autour d'une maille.
Int64 nodeUniqueIdToCoordY(Int64 uid, Integer level) override
Méthode permettant de récupérer la coordonnée en Y d'un noeud grâce à son uniqueId.
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