Arcane  4.2.3.0
Developer documentation
Loading...
Searching...
No Matches
NodeDirectionMng.cc
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/* NodeDirectionMng.cc (C) 2000-2026 */
9/* */
10/* Information about the cells in an X, Y, or Z direction of a structured */
11/* mesh. */
12/*---------------------------------------------------------------------------*/
13/*---------------------------------------------------------------------------*/
14
15#include "arcane/cartesianmesh/NodeDirectionMng.h"
16
17#include "arcane/utils/FatalErrorException.h"
18#include "arcane/utils/ArgumentException.h"
19#include "arcane/utils/ITraceMng.h"
20#include "arcane/utils/Real3.h"
21#include "arcane/utils/PlatformUtils.h"
22
23#include "arcane/core/IItemFamily.h"
24#include "arcane/core/ItemGroup.h"
25#include "arcane/core/IMesh.h"
26#include "arcane/core/VariableTypes.h"
27#include "arcane/core/UnstructuredMeshConnectivity.h"
28
29#include "arcane/cartesianmesh/ICartesianMesh.h"
30#include "arcane/cartesianmesh/CellDirectionMng.h"
31#include "arcane/cartesianmesh/internal/ICartesianMeshInternal.h"
32
33/*---------------------------------------------------------------------------*/
34/*---------------------------------------------------------------------------*/
35
36namespace Arcane
37{
38
39/*---------------------------------------------------------------------------*/
40/*---------------------------------------------------------------------------*/
41
43{
44 public:
45
46 Impl()
48 {}
49
50 public:
51
52 NodeGroup m_inner_all_items;
53 NodeGroup m_outer_all_items;
54 NodeGroup m_inpatch_all_items;
55 NodeGroup m_overlap_all_items;
56 NodeGroup m_all_items;
57 ICartesianMesh* m_cartesian_mesh = nullptr;
58 Integer m_patch_index = -1;
60};
61
62/*---------------------------------------------------------------------------*/
63/*---------------------------------------------------------------------------*/
64
67: m_direction(MD_DirInvalid)
68, m_p(nullptr)
69{
70}
71
72/*---------------------------------------------------------------------------*/
73/*---------------------------------------------------------------------------*/
74
75/*---------------------------------------------------------------------------*/
76/*---------------------------------------------------------------------------*/
77
80{
81 if (m_p)
82 ARCANE_FATAL("Initialisation already done");
83 m_p = new Impl();
84 m_direction = dir;
85 m_nodes = NodeInfoListView(cm->mesh()->nodeFamily());
86 m_p->m_cartesian_mesh = cm;
87 m_p->m_patch_index = patch_index;
88}
89
90/*---------------------------------------------------------------------------*/
91/*---------------------------------------------------------------------------*/
92
95{
96 delete m_p;
97 m_p = nullptr;
98}
99
100/*---------------------------------------------------------------------------*/
101/*---------------------------------------------------------------------------*/
102
105{
106 m_p->m_infos.resize(new_size);
107 m_infos_view = m_p->m_infos.view();
108}
109
110/*---------------------------------------------------------------------------*/
111/*---------------------------------------------------------------------------*/
112
114_internalComputeInfos(const CellDirectionMng& cell_dm, const NodeGroup& all_nodes,
115 const VariableCellReal3& cells_center)
116{
117 Node null_node;
118 m_infos_view.fill(NodeDirectionMng::ItemDirectionInfo());
119
120 Integer mesh_dim = m_p->m_cartesian_mesh->mesh()->dimension();
121 //TODO: ne garder que les noeuds de notre patch
122
123 // Calcul les infos de direction pour les noeuds
124 ENUMERATE_CELL (icell, cell_dm.allCells()) {
125 Cell cell = *icell;
126 DirCellNode cn(cell_dm.cellNode(cell));
127
128 NodeLocalId node_next_left = cn.nextLeftId();
129 NodeLocalId node_next_right = cn.nextRightId();
130
131 NodeLocalId node_previous_left = cn.previousLeftId();
132 NodeLocalId node_previous_right = cn.previousRightId();
133
134 m_infos_view[node_previous_left].m_next_lid = node_next_left;
135 m_infos_view[node_next_left].m_previous_lid = node_previous_left;
136
137 m_infos_view[node_previous_right].m_next_lid = node_next_right;
138 m_infos_view[node_next_right].m_previous_lid = node_previous_right;
139
140 if (mesh_dim == 3) {
141 NodeLocalId top_node_next_left = cn.topNextLeftId();
142 NodeLocalId top_node_next_right = cn.topNextRightId();
143
144 NodeLocalId top_node_previous_left = cn.topPreviousLeftId();
145 NodeLocalId top_node_previous_right = cn.topPreviousRightId();
146
147 m_infos_view[top_node_previous_left].m_next_lid = top_node_next_left;
148 m_infos_view[top_node_next_left].m_previous_lid = top_node_previous_left;
149
150 m_infos_view[top_node_previous_right].m_next_lid = top_node_next_right;
151 m_infos_view[top_node_next_right].m_previous_lid = top_node_previous_right;
152 }
153 }
154
155 Int32UniqueArray inner_lids;
156 Int32UniqueArray outer_lids;
157 IItemFamily* family = all_nodes.itemFamily();
158 ENUMERATE_ITEM (iitem, all_nodes) {
159 Int32 lid = iitem.itemLocalId();
160 Int32 i1 = m_infos_view[lid].m_next_lid;
161 Int32 i2 = m_infos_view[lid].m_previous_lid;
162 if (i1 == NULL_ITEM_LOCAL_ID || i2 == NULL_ITEM_LOCAL_ID)
163 outer_lids.add(lid);
164 else
165 inner_lids.add(lid);
166 }
167 int dir = (int)m_direction;
168 String base_group_name = String("Direction") + dir;
169 if (m_p->m_patch_index >= 0)
170 base_group_name = base_group_name + String("AMRPatch") + m_p->m_patch_index;
171 m_p->m_inner_all_items = family->createGroup(String("AllInner") + base_group_name, inner_lids, true);
172 m_p->m_outer_all_items = family->createGroup(String("AllOuter") + base_group_name, outer_lids, true);
173 m_p->m_all_items = all_nodes;
174
175 _filterNodes();
176 _computeNodeCellInfos(cell_dm, cells_center);
177
178 {
179 UnstructuredMeshConnectivityView mesh_connectivity;
180 mesh_connectivity.setMesh(m_p->m_cartesian_mesh->mesh());
181 m_node_cell_view = mesh_connectivity.nodeCell();
182 }
183}
184
185/*---------------------------------------------------------------------------*/
186/*---------------------------------------------------------------------------*/
187
189_internalComputeInfos(const CellDirectionMng& cell_dm, const NodeGroup& all_nodes)
190{
191 m_infos_view.fill(ItemDirectionInfo());
192
193 Integer mesh_dim = m_p->m_cartesian_mesh->mesh()->dimension();
194 //TODO: ne garder que les noeuds de notre patch
195
196 // Calcul les infos de direction pour les noeuds
197 ENUMERATE_CELL (icell, cell_dm.allCells()) {
198 Cell cell = *icell;
199 DirCellNode cn(cell_dm.cellNode(cell));
200
201 NodeLocalId node_next_left = cn.nextLeftId();
202 NodeLocalId node_next_right = cn.nextRightId();
203
204 NodeLocalId node_previous_left = cn.previousLeftId();
205 NodeLocalId node_previous_right = cn.previousRightId();
206
207 m_infos_view[node_previous_left].m_next_lid = node_next_left;
208 m_infos_view[node_next_left].m_previous_lid = node_previous_left;
209
210 m_infos_view[node_previous_right].m_next_lid = node_next_right;
211 m_infos_view[node_next_right].m_previous_lid = node_previous_right;
212
213 if (mesh_dim == 3) {
214 NodeLocalId top_node_next_left = cn.topNextLeftId();
215 NodeLocalId top_node_next_right = cn.topNextRightId();
216
217 NodeLocalId top_node_previous_left = cn.topPreviousLeftId();
218 NodeLocalId top_node_previous_right = cn.topPreviousRightId();
219
220 m_infos_view[top_node_previous_left].m_next_lid = top_node_next_left;
221 m_infos_view[top_node_next_left].m_previous_lid = top_node_previous_left;
222
223 m_infos_view[top_node_previous_right].m_next_lid = top_node_next_right;
224 m_infos_view[top_node_next_right].m_previous_lid = top_node_previous_right;
225 }
226 }
227
228 UniqueArray<Int32> inner_cells_lid;
229 UniqueArray<Int32> outer_cells_lid;
230 cell_dm.innerCells().view().fillLocalIds(inner_cells_lid);
231 cell_dm.outerCells().view().fillLocalIds(outer_cells_lid);
232
233 UniqueArray<Int32> inner_lids;
234 UniqueArray<Int32> outer_lids;
235 // UniqueArray<Int32> inpatch_lids;
236 // UniqueArray<Int32> overlap_lids;
237 IItemFamily* family = all_nodes.itemFamily();
238 ENUMERATE_ (Node, inode, all_nodes) {
239 Int32 lid = inode.itemLocalId();
240 Integer nb_inner_cells = 0;
241 Integer nb_outer_cells = 0;
242 for (Cell cell : inode->cells()) {
243 if (inner_cells_lid.contains(cell.localId())) {
244 nb_inner_cells++;
245 }
246 else if (outer_cells_lid.contains(cell.localId())) {
247 nb_outer_cells++;
248 }
249 }
250 if (nb_inner_cells + nb_outer_cells == inode->nbCell()) {
251 inner_lids.add(lid);
252 }
253 else if (nb_outer_cells != 0) {
254 outer_lids.add(lid);
255 }
256
257 // if (inode->hasFlags(ItemFlags::II_InPatch)) {
258 // inpatch_lids.add(lid);
259 // }
260 // if (inode->hasFlags(ItemFlags::II_Overlap)) {
261 // overlap_lids.add(lid);
262 // }
263 }
264 int dir = (int)m_direction;
265 String base_group_name = String("Direction") + dir;
266 if (m_p->m_patch_index >= 0)
267 base_group_name = base_group_name + String("AMRPatch") + m_p->m_patch_index;
268 m_p->m_inner_all_items = family->createGroup(String("AllInner") + base_group_name, inner_lids, true);
269 m_p->m_outer_all_items = family->createGroup(String("AllOuter") + base_group_name, outer_lids, true);
270 // m_p->m_inpatch_all_items = family->createGroup(String("AllInPatch") + base_group_name, inpatch_lids, true);
271 // m_p->m_overlap_all_items = family->createGroup(String("AllOverlap") + base_group_name, overlap_lids, true);
272 m_p->m_inpatch_all_items = cell_dm.inPatchCells().nodeGroup();
273 m_p->m_overlap_all_items = cell_dm.overlapCells().nodeGroup();
274 m_p->m_all_items = all_nodes;
275
276 _filterNodes();
278
279 {
280 UnstructuredMeshConnectivityView mesh_connectivity;
281 mesh_connectivity.setMesh(m_p->m_cartesian_mesh->mesh());
282 m_node_cell_view = mesh_connectivity.nodeCell();
283 }
284}
285
286/*---------------------------------------------------------------------------*/
287/*---------------------------------------------------------------------------*/
288
294{
295 // Set containing only the nodes of our patch
296 UniqueArray<bool> is_in_patch(allNodes().itemFamily()->maxLocalId(), false);
297 ENUMERATE_NODE (inode, allNodes()) {
298 is_in_patch[inode.itemLocalId()] = true;
299 }
300
301 for (ItemDirectionInfo& idi : m_infos_view) {
302 {
303 Int32 next_lid = idi.m_next_lid;
304 if (next_lid != NULL_ITEM_LOCAL_ID && !is_in_patch[next_lid])
305 idi.m_next_lid = NodeLocalId{};
306 }
307 {
308 Int32 prev_lid = idi.m_previous_lid;
309 if (prev_lid != NULL_ITEM_LOCAL_ID && !is_in_patch[prev_lid])
310 idi.m_previous_lid = NodeLocalId{};
311 }
312 }
313}
314
315/*---------------------------------------------------------------------------*/
316/*---------------------------------------------------------------------------*/
317
322_computeNodeCellInfos(const CellDirectionMng& cell_dm, const VariableCellReal3& cells_center)
323{
324 // TODO: only process the cells of our patch.
325 IndexType indexes_ptr[8];
326 ArrayView<IndexType> indexes(8, indexes_ptr);
327
328 NodeDirectionMng& node_dm = *this;
329 NodeGroup dm_all_nodes = node_dm.allNodes();
330 eMeshDirection dir = m_direction;
331 IMesh* mesh = m_p->m_cartesian_mesh->mesh();
332 Integer mesh_dim = mesh->dimension();
333 VariableNodeReal3& nodes_coord = mesh->nodesCoordinates();
334 if (mesh_dim != 2 && mesh_dim != 3)
335 ARCANE_FATAL("Invalid mesh dimension '{0}'. Valid dimensions are 2 or 3", mesh_dim);
336
337 // Set containing only the cells of our patch
338 // This is used to filter to keep only these cells in the connectivity
339 UniqueArray<bool> is_inside_cell(mesh->cellFamily()->maxLocalId(), false);
340 ENUMERATE_CELL (icell, cell_dm.allCells()) {
341 is_inside_cell[icell.itemLocalId()] = true;
342 }
343
344 ENUMERATE_NODE (inode, dm_all_nodes) {
345 Node node = *inode;
346 Integer nb_cell = node.nbCell();
347 Real3 node_pos = nodes_coord[node];
348 indexes.fill(DirNode::NULL_CELL);
349 for (Integer i = 0; i < nb_cell; ++i) {
350 const IndexType bi = (IndexType)i;
351 Cell cell = node.cell(i);
352 if (!is_inside_cell[cell.localId()])
353 continue;
354
355 Real3 center = cells_center[cell];
356 Real3 wanted_cell_pos;
357 Real3 wanted_node_pos;
358 if (dir == MD_DirX) {
359 wanted_cell_pos = center;
360 wanted_node_pos = node_pos;
361 }
362 else if (dir == MD_DirY) {
363 wanted_cell_pos = Real3(center.y, -center.x, center.z);
364 wanted_node_pos = Real3(node_pos.y, -node_pos.x, node_pos.z);
365 }
366 else if (dir == MD_DirZ) {
367 // TODO: to check for Y and Z
368 wanted_cell_pos = Real3(center.z, -center.y, center.x);
369 wanted_node_pos = Real3(node_pos.z, -node_pos.y, node_pos.x);
370 }
371 bool is_top = ((wanted_cell_pos.z > wanted_node_pos.z) && mesh_dim == 3);
372 if (!is_top) {
373 if (wanted_cell_pos.x > wanted_node_pos.x) {
374 if (wanted_cell_pos.y > wanted_node_pos.y)
375 indexes_ptr[CNP_NextLeft] = bi;
376 else
377 indexes_ptr[CNP_NextRight] = bi;
378 }
379 else {
380 if (wanted_cell_pos.y > wanted_node_pos.y)
381 indexes_ptr[CNP_PreviousLeft] = bi;
382 else
383 indexes_ptr[CNP_PreviousRight] = bi;
384 }
385 }
386 else {
387 if (wanted_cell_pos.x > wanted_node_pos.x) {
388 if (wanted_cell_pos.y > wanted_node_pos.y)
389 indexes_ptr[CNP_TopNextLeft] = bi;
390 else
391 indexes_ptr[CNP_TopNextRight] = bi;
392 }
393 else {
394 if (wanted_cell_pos.y > wanted_node_pos.y)
395 indexes_ptr[CNP_TopPreviousLeft] = bi;
396 else
397 indexes_ptr[CNP_TopPreviousRight] = bi;
398 }
399 }
400 }
401 m_infos_view[node.localId()].setCellIndexes(indexes_ptr);
402 }
403}
404
405/*---------------------------------------------------------------------------*/
406/*---------------------------------------------------------------------------*/
407
410{
412
413 IndexType indexes_ptr[8];
414 ArrayView indexes(8, indexes_ptr);
415
416 NodeGroup dm_all_nodes = this->allNodes();
417 eMeshDirection dir = m_direction;
418 IMesh* mesh = m_p->m_cartesian_mesh->mesh();
419 Integer mesh_dim = mesh->dimension();
420
421 if (mesh_dim == 2) {
422 constexpr Integer nb_cells_max = 4;
423
424 Int64 uids[nb_cells_max];
425 ArrayView av_uids(nb_cells_max, uids);
426
427 // DirX (Previous->X=0 / Next->X=1 / Right->Y=0 / Left->Y=1)
428 // DirY (Previous->Y=0 / Next->Y=1 / Right->X=1 / Left->X=0)
429
430 // The CartesianMeshNumberingMng always gives us the cells around the node in the same order:
431 //
432 // |2|3|
433 // .
434 // |0|1|
435 //
436 // y
437 // ^
438 // |->x
439 //
440 // Read: the cell UID in the av_uids array at position 0 filled by
441 // "numbering->cellUniqueIdsAroundNode(av_uids, node)" corresponds, in the X direction,
442 // to the CNP_PreviousRight position.
443 constexpr Int32 dir_x_pos_2d[nb_cells_max] = { CNP_PreviousRight, CNP_NextRight, CNP_PreviousLeft, CNP_NextLeft };
444 constexpr Int32 dir_y_pos_2d[nb_cells_max] = { CNP_PreviousLeft, CNP_PreviousRight, CNP_NextLeft, CNP_NextRight };
445
446 ENUMERATE_ (Node, inode, dm_all_nodes) {
447 Node node = *inode;
448 numbering->cellUniqueIdsAroundNode(node, av_uids);
449 Integer nb_cell = node.nbCell();
450
451 indexes.fill(DirNode::NULL_CELL);
452
453 for (Integer i = 0; i < nb_cell; ++i) {
454 Cell cell = node.cell(i);
455 Integer pos = 0;
456 for (; pos < nb_cells_max; ++pos) {
457 if (cell.uniqueId() == av_uids[pos])
458 break;
459 }
460 if (pos == nb_cells_max)
461 continue;
462
463 const IndexType bi = (IndexType)i;
464 if (dir == MD_DirX) {
465 indexes[dir_x_pos_2d[pos]] = bi;
466 }
467 else if (dir == MD_DirY) {
468 indexes[dir_y_pos_2d[pos]] = bi;
469 }
470 }
471 m_infos_view[node.localId()].setCellIndexes(indexes_ptr);
472 }
473 }
474 else if (mesh_dim == 3) {
475 constexpr Integer nb_cells_max = 8;
476
477 Int64 uids[nb_cells_max];
478 ArrayView av_uids(nb_cells_max, uids);
479
480 // DirX (Top->Z=1 / Previous->X=0 / Next->X=1 / Right->Y=0 / Left->Y=1)
481 // DirY (Top->Z=1 / Previous->Y=0 / Next->Y=1 / Right->X=1 / Left->X=0)
482 // DirZ (Top->Y=1 / Previous->Z=0 / Next->Z=1 / Right->X=1 / Left->X=0)
483
484 // The CartesianMeshNumberingMng always gives us the cells around the node in the same order:
485 //
486 // z = 0 | z = 1
487 // |2|3| | |6|7|
488 // . | .
489 // |0|1| | |4|5|
490 //
491 // y
492 // ^
493 // |->x
494 //
495 // Read: the cell UID in the av_uids array at position 2 filled by
496 // "numbering->cellUniqueIdsAroundNode(av_uids, node)" corresponds, in the Z direction,
497 // to the CNP_TopPreviousLeft position.
498 constexpr Int32 dir_x_pos_3d[nb_cells_max] = { CNP_PreviousRight, CNP_NextRight, CNP_PreviousLeft, CNP_NextLeft, CNP_TopPreviousRight, CNP_TopNextRight, CNP_TopPreviousLeft, CNP_TopNextLeft };
499 constexpr Int32 dir_y_pos_3d[nb_cells_max] = { CNP_PreviousLeft, CNP_PreviousRight, CNP_NextLeft, CNP_NextRight, CNP_TopPreviousLeft, CNP_TopPreviousRight, CNP_TopNextLeft, CNP_TopNextRight };
500 constexpr Int32 dir_z_pos_3d[nb_cells_max] = { CNP_PreviousLeft, CNP_PreviousRight, CNP_TopPreviousLeft, CNP_TopPreviousRight, CNP_NextLeft, CNP_NextRight, CNP_TopNextLeft, CNP_TopNextRight };
501
502 ENUMERATE_ (Node, inode, dm_all_nodes) {
503 Node node = *inode;
504 numbering->cellUniqueIdsAroundNode(node, av_uids);
505 Integer nb_cell = node.nbCell();
506
507 indexes.fill(DirNode::NULL_CELL);
508
509 for (Integer i = 0; i < nb_cell; ++i) {
510 Cell cell = node.cell(i);
511 Integer pos = 0;
512 for (; pos < nb_cells_max; ++pos) {
513 if (cell.uniqueId() == av_uids[pos])
514 break;
515 }
516 if (pos == nb_cells_max)
517 continue;
518
519 const IndexType bi = (IndexType)i;
520
521 if (dir == MD_DirX) {
522 indexes[dir_x_pos_3d[pos]] = bi;
523 }
524 else if (dir == MD_DirY) {
525 indexes[dir_y_pos_3d[pos]] = bi;
526 }
527 else if (dir == MD_DirZ) {
528 indexes[dir_z_pos_3d[pos]] = bi;
529 }
530
531 m_infos_view[node.localId()].setCellIndexes(indexes_ptr);
532 }
533 }
534 }
535 else {
536 ARCANE_FATAL("Invalid mesh dimension '{0}'. Valid dimensions are 2 or 3", mesh_dim);
537 }
538}
539
540/*---------------------------------------------------------------------------*/
541/*---------------------------------------------------------------------------*/
542
544allNodes() const
545{
546 return m_p->m_all_items;
547}
548
549/*---------------------------------------------------------------------------*/
550/*---------------------------------------------------------------------------*/
551
553overlapNodes() const
554{
555 return m_p->m_overlap_all_items;
556}
557
558/*---------------------------------------------------------------------------*/
559/*---------------------------------------------------------------------------*/
560
562inPatchNodes() const
563{
564 return m_p->m_inpatch_all_items;
565}
566
567/*---------------------------------------------------------------------------*/
568/*---------------------------------------------------------------------------*/
569
571innerNodes() const
572{
573 return m_p->m_inner_all_items;
574}
575
576/*---------------------------------------------------------------------------*/
577/*---------------------------------------------------------------------------*/
578
580outerNodes() const
581{
582 return m_p->m_outer_all_items;
583}
584
585/*---------------------------------------------------------------------------*/
586/*---------------------------------------------------------------------------*/
587
588} // End namespace Arcane
589
590/*---------------------------------------------------------------------------*/
591/*---------------------------------------------------------------------------*/
#define ARCANE_FATAL(...)
Macro throwing a FatalErrorException.
#define ENUMERATE_(type, name, group)
Generic enumerator for an entity group.
#define ENUMERATE_CELL(name, group)
Generic enumerator for a cell group.
#define ENUMERATE_ITEM(name, group)
Generic enumerator for a node group.
#define ENUMERATE_NODE(name, group)
Generic enumerator for a node group.
Modifiable view of an array of type T.
void fill(const T &o) noexcept
Fills the array with the value o.
void add(ConstReferenceType val)
Adds element val to the end of the array.
Info about the cells in a specific X, Y, or Z direction of a structured mesh.
CellGroup outerCells() const
Group of all outer cells in the direction.
CellGroup allCells() const
Group of all cells in the direction.
CellGroup overlapCells() const
Group of all overlap cells in the direction.
DirCellNode cellNode(Cell c) const
cell with directional info at nodes corresponding to cell c.
CellGroup innerCells() const
Group of all inner cells in the direction.
CellGroup inPatchCells() const
Group of all patch cells in the direction.
Cell of a mesh.
Definition Item.h:1300
Cell with directional node information.
NodeLocalId topNextLeftId() const
Node forward left in the direction.
NodeLocalId nextRightId() const
Node forward right in the direction.
NodeLocalId topNextRightId() const
Node forward right in the direction.
NodeLocalId nextLeftId() const
Node forward left in the direction.
NodeLocalId topPreviousLeftId() const
Node backward left in the direction.
NodeLocalId topPreviousRightId() const
Node backward right in the direction.
NodeLocalId previousLeftId() const
Node backward left in the direction.
NodeLocalId previousRightId() const
Node backward right in the direction.
virtual Ref< ICartesianMeshNumberingMngInternal > cartesianMeshNumberingMngInternal()=0
Method allowing retrieval of the CartesianMeshNumberingMngInternal instance.
virtual IMesh * mesh() const =0
Mesh associated with this Cartesian mesh.
virtual ICartesianMeshInternal * _internalApi()=0
Internal Arcane API.
Interface of an entity family.
Definition IItemFamily.h:85
virtual ItemGroup createGroup(const String &name, Int32ConstArrayView local_ids, bool do_override=false)=0
Creates an entity group named name containing the entities local_ids.
virtual IItemFamily * nodeFamily()=0
Returns the node family.
virtual Integer dimension()=0
Mesh dimension (1D, 2D, or 3D).
NodeGroup nodeGroup() const
Group of nodes of the elements of this group.
Definition ItemGroup.cc:222
ItemVectorView view() const
View of the group entities.
Definition ItemGroup.cc:580
IItemFamily * itemFamily() const
Entity family to which this group belongs (0 for the null group).
Definition ItemGroup.h:128
void fillLocalIds(Array< Int32 > &ids) const
Adds the list of localIds() of the vector to ids.
constexpr Int32 localId() const
Local identifier of the entity in the processor subdomain.
Definition Item.h:233
void _internalComputeInfos(const CellDirectionMng &cell_dm, const NodeGroup &all_nodes, const VariableCellReal3 &cells_center)
Calculates the information about nodes associated with cells of the direction cell_dm....
NodeGroup innerNodes() const
Group of all inner nodes in the direction.
void _filterNodes()
Filters the front/back nodes to keep only the nodes of our patch.
NodeDirectionMng()
Creates an empty instance.
NodeGroup outerNodes() const
Group of all outer nodes in the direction.
void _internalInit(ICartesianMesh *cm, eMeshDirection dir, Integer patch_index)
void _computeNodeCellInfos(const CellDirectionMng &cell_dm, const VariableCellReal3 &cells_center)
Brief calculation of node/cell connectivities by direction.
NodeGroup overlapNodes() const
Group of all overlap nodes in the direction.
NodeGroup allNodes() const
Group of all nodes in the direction.
DirNode node(Node n) const
Direction node corresponding to node n.
NodeGroup inPatchNodes() const
Group of all patch nodes in the direction.
void _internalResizeInfos(Int32 new_size)
Resizes the container holding the ItemDirectionInfo.
View of node information.
Node of a mesh.
Definition Item.h:598
Class managing a 3-dimensional real vector.
Reference to an instance.
1D data vector with value semantics (STL style).
View of the standard connectivities of an unstructured mesh.
ItemGroupT< Node > NodeGroup
Group of nodes.
Definition ItemTypes.h:168
MeshVariableScalarRefT< Cell, Real3 > VariableCellReal3
Coordinate type quantity at cell center.
MeshVariableScalarRefT< Node, Real3 > VariableNodeReal3
Coordinate type quantity at node.
IMemoryAllocator * getDefaultDataAllocator()
Default allocator for data.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
std::int64_t Int64
Signed integer type of 64 bits.
Int32 Integer
Type representing an integer.
eMeshDirection
Direction type for a structured mesh.
@ MD_DirInvalid
Invalid or uninitialized direction.
@ MD_DirZ
Z Direction.
@ MD_DirY
Y Direction.
@ MD_DirX
X Direction.
UniqueArray< Int32 > Int32UniqueArray
Dynamic 1D array of 32-bit integers.
Definition UtilsTypes.h:335
@ Cell
The mesh is AMR by cell.
Definition MeshKind.h:53
std::int32_t Int32
Signed integer type of 32 bits.
Real y
second component of the triplet
Real z
third component of the triplet
Real x
first component of the triplet