Arcane  4.2.3.0
Developer documentation
Loading...
Searching...
No Matches
CellFamily.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/* CellFamily.cc (C) 2000-2025 */
9/* */
10/* Cell Family. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#include "arcane/mesh/CellFamily.h"
15
16#include "arcane/utils/FatalErrorException.h"
17
18#include "arcane/core/IMesh.h"
19#include "arcane/core/ISubDomain.h"
20#include "arcane/core/ItemInternalEnumerator.h"
21#include "arcane/core/Connectivity.h"
22
23#include "arcane/mesh/NodeFamily.h"
24#include "arcane/mesh/EdgeFamily.h"
25#include "arcane/mesh/FaceFamily.h"
26#include "arcane/mesh/CellMerger.h"
27#include "arcane/mesh/IncrementalItemConnectivity.h"
28#include "arcane/mesh/CompactIncrementalItemConnectivity.h"
29#include "arcane/mesh/ItemConnectivitySelector.h"
30#include "arcane/mesh/AbstractItemFamilyTopologyModifier.h"
31#include "arcane/mesh/NewWithLegacyConnectivity.h"
32
33/*---------------------------------------------------------------------------*/
34/*---------------------------------------------------------------------------*/
35
36namespace Arcane::mesh
37{
38
39/*---------------------------------------------------------------------------*/
40/*---------------------------------------------------------------------------*/
41
43: public AbstractItemFamilyTopologyModifier
44{
45 public:
46
47 TopologyModifier(CellFamily* f)
48 : AbstractItemFamilyTopologyModifier(f)
49 , m_true_family(f)
50 {}
51
52 public:
53
54 void replaceNode(ItemLocalId item_lid, Integer index, ItemLocalId new_lid) override
55 {
56 m_true_family->replaceNode(item_lid, index, new_lid);
57 }
58 void replaceEdge(ItemLocalId item_lid, Integer index, ItemLocalId new_lid) override
59 {
60 m_true_family->replaceEdge(item_lid, index, new_lid);
61 }
62 void replaceFace(ItemLocalId item_lid, Integer index, ItemLocalId new_lid) override
63 {
64 m_true_family->replaceFace(item_lid, index, new_lid);
65 }
66 void replaceHParent(ItemLocalId item_lid, Integer index, ItemLocalId new_lid) override
67 {
68 m_true_family->replaceHParent(item_lid, index, new_lid);
69 }
70 void replaceHChild(ItemLocalId item_lid, Integer index, ItemLocalId new_lid) override
71 {
72 m_true_family->replaceHChild(item_lid, index, new_lid);
73 }
74
75 private:
76
77 CellFamily* m_true_family;
78};
79
80/*---------------------------------------------------------------------------*/
81/*---------------------------------------------------------------------------*/
82
83CellFamily::
84CellFamily(IMesh* mesh, const String& name)
85: ItemFamily(mesh, IK_Cell, name)
86, m_node_prealloc(0)
87, m_edge_prealloc(0)
88, m_face_prealloc(0)
89, m_mesh_connectivity(0)
90, m_node_family(nullptr)
91, m_edge_family(nullptr)
92, m_face_family(nullptr)
93, m_node_connectivity(nullptr)
94, m_edge_connectivity(nullptr)
95, m_face_connectivity(nullptr)
96, m_hparent_connectivity(nullptr)
97{
98 _setTopologyModifier(new TopologyModifier(this));
99}
100
101/*---------------------------------------------------------------------------*/
102/*---------------------------------------------------------------------------*/
103
104CellFamily::
105~CellFamily()
106{
107}
108
109/*---------------------------------------------------------------------------*/
110/*---------------------------------------------------------------------------*/
111
112void CellFamily::
113build()
114{
115 ItemFamily::build();
116
117 m_node_family = ARCANE_CHECK_POINTER(dynamic_cast<NodeFamily*>(m_mesh->nodeFamily()));
118 m_edge_family = ARCANE_CHECK_POINTER(dynamic_cast<EdgeFamily*>(m_mesh->edgeFamily()));
119 m_face_family = ARCANE_CHECK_POINTER(dynamic_cast<FaceFamily*>(m_mesh->faceFamily()));
120
121 IItemFamilyNetwork* network = m_mesh->itemFamilyNetwork();
122 if (m_mesh->useMeshItemFamilyDependencies()) { // temporary to fill legacy, even with family dependencies
123 auto* nc = network->getConnectivity(this, m_node_family, connectivityName(this, m_node_family));
124 using NodeNetwork = NewWithLegacyConnectivityType<CellFamily, NodeFamily>::type;
125 m_node_connectivity = ARCANE_CHECK_POINTER(dynamic_cast<NodeNetwork*>(nc));
126 using EdgeNetwork = NewWithLegacyConnectivityType<CellFamily, EdgeFamily>::type;
127 auto* ec = network->getConnectivity(this, m_edge_family, connectivityName(this, m_edge_family));
128 m_edge_connectivity = ARCANE_CHECK_POINTER(dynamic_cast<EdgeNetwork*>(ec));
129 using FaceNetwork = NewWithLegacyConnectivityType<CellFamily, FaceFamily>::type;
130 auto* fc = network->getConnectivity(this, m_face_family, connectivityName(this, m_face_family));
131 m_face_connectivity = ARCANE_CHECK_POINTER(dynamic_cast<FaceNetwork*>(fc));
132 }
133 else {
134 m_node_connectivity = new NodeConnectivity(this, m_node_family, "CellNode");
135 m_edge_connectivity = new EdgeConnectivity(this, m_edge_family, "CellEdge");
136 m_face_connectivity = new FaceConnectivity(this, m_face_family, "CellFace");
137 }
138 m_hparent_connectivity = new HParentConnectivity(this, this, "HParentCell");
139 m_hchild_connectivity = new HChildConnectivity(this, this, "HChildCell");
140
141 _addConnectivitySelector(m_node_connectivity);
142 _addConnectivitySelector(m_edge_connectivity);
143 _addConnectivitySelector(m_face_connectivity);
144 _addConnectivitySelector(m_hparent_connectivity);
145 _addConnectivitySelector(m_hchild_connectivity);
146
147 _buildConnectivitySelectors();
148}
149
150/*---------------------------------------------------------------------------*/
151/*---------------------------------------------------------------------------*/
152
153inline void CellFamily::
154_createOne(ItemInternal* item, Int64 uid, ItemTypeInfo* type)
155{
156 ItemLocalId item_lid(item);
157 m_item_internal_list->cells = _itemsInternal();
158 _allocateInfos(item, uid, type);
159 auto nc = m_node_connectivity->trueCustomConnectivity();
160 nc->addConnectedItems(item_lid, type->nbLocalNode());
161 if (m_edge_prealloc != 0) {
162 auto ec = m_edge_connectivity->trueCustomConnectivity();
163 ec->addConnectedItems(item_lid, type->nbLocalEdge());
164 }
165 auto fc = m_face_connectivity->trueCustomConnectivity();
166 fc->addConnectedItems(item_lid, type->nbLocalFace());
167}
168
169/*---------------------------------------------------------------------------*/
170/*---------------------------------------------------------------------------*/
171
172inline void CellFamily::
173_createOne(ItemInternal* item, Int64 uid, ItemTypeId type_id)
174{
175 _createOne(item, uid, _itemTypeMng()->typeFromId(type_id));
176}
177
178/*---------------------------------------------------------------------------*/
179/*---------------------------------------------------------------------------*/
180
182allocOne(Int64 uid, ItemTypeId type_id, MeshInfos& mesh_info)
183{
184 ++mesh_info.nbCell();
185 return allocOne(uid, type_id);
186}
187
188/*---------------------------------------------------------------------------*/
189/*---------------------------------------------------------------------------*/
190
191Item CellFamily::
192findOrAllocOne(Int64 uid, ItemTypeId type_id, MeshInfos& mesh_info, bool& is_alloc)
193{
194 auto cell = findOrAllocOne(uid, type_id, is_alloc);
195 if (is_alloc)
196 ++mesh_info.nbCell();
197 return cell;
198}
199
200/*---------------------------------------------------------------------------*/
201/*---------------------------------------------------------------------------*/
202
204allocOne(Int64 uid, ItemTypeId type_id)
205{
206 ItemInternal* item = _allocOne(uid);
207 _createOne(item, uid, type_id);
208 return item;
209}
210
211/*---------------------------------------------------------------------------*/
212/*---------------------------------------------------------------------------*/
213
214Cell CellFamily::
215findOrAllocOne(Int64 uid, ItemTypeId type_id, bool& is_alloc)
216{
217 return findOrAllocOne(uid, _itemTypeMng()->typeFromId(type_id), is_alloc);
218}
219
220/*---------------------------------------------------------------------------*/
221/*---------------------------------------------------------------------------*/
222
223ItemInternal* CellFamily::
224allocOne(Int64 uid, ItemTypeInfo* type)
225{
226 ItemInternal* item = _allocOne(uid);
227 _createOne(item, uid, type);
228 return item;
229}
230
231/*---------------------------------------------------------------------------*/
232/*---------------------------------------------------------------------------*/
233
234ItemInternal* CellFamily::
235findOrAllocOne(Int64 uid, ItemTypeInfo* type, bool& is_alloc)
236{
237 // ARCANE_ASSERT((type->typeId() != IT_Line2),("Bad new 1D cell uid=%ld", uid)); // Assertion OK, but expensive ?
238 ItemInternal* item = _findOrAllocOne(uid, is_alloc);
239 if (is_alloc)
240 _createOne(item, uid, type);
241 return item;
242}
243
244/*---------------------------------------------------------------------------*/
245/*---------------------------------------------------------------------------*/
246
248nodeConnectivity() const
249{
250 return m_node_connectivity->trueCustomConnectivity();
251}
252
253/*---------------------------------------------------------------------------*/
254/*---------------------------------------------------------------------------*/
255
256IncrementalItemConnectivity* CellFamily::
257edgeConnectivity() const
258{
259 return m_edge_connectivity->trueCustomConnectivity();
260}
261
262/*---------------------------------------------------------------------------*/
263/*---------------------------------------------------------------------------*/
264
265IncrementalItemConnectivity* CellFamily::
266faceConnectivity() const
267{
268 return m_face_connectivity->trueCustomConnectivity();
269}
270
271/*---------------------------------------------------------------------------*/
272/*---------------------------------------------------------------------------*/
273
276{
277 m_item_internal_list->cells = _itemsInternal();
278 _allocateInfosBulk(uids, type, owner, lids);
279 m_item_internal_list->cells = _itemsInternal();
280}
281
282/*---------------------------------------------------------------------------*/
283/*---------------------------------------------------------------------------*/
284
285void CellFamily::
286preAllocate(Integer nb_item)
287{
288 this->_preAllocate(nb_item, true);
289}
290
291/*---------------------------------------------------------------------------*/
292/*---------------------------------------------------------------------------*/
293
296{
297 debug() << "Creating the list of ghost cells";
299}
300
301/*---------------------------------------------------------------------------*/
302/*---------------------------------------------------------------------------*/
303
306{
307 ItemLocalId cell_lid(cell.localId());
308
309 // Must first remove faces, then edges, then nodes
310 // see notes on _removeOne in the families.
311 // NOTE GG: it is normally no longer necessary to do this in a fixed order
312 // because these methods do not delete the entities. Destruction
313 // happens when calling removeNotConnectedSubItems().
314 for (Face face : cell.faces())
315 m_face_family->removeCellFromFace(face, cell_lid);
316 for (Edge edge : cell.edges())
317 m_edge_family->removeCellFromEdge(edge, cell_lid);
318 for (Node node : cell.nodes())
319 m_node_family->removeCellFromNode(node, cell_lid);
320}
321
322/*---------------------------------------------------------------------------*/
323/*---------------------------------------------------------------------------*/
324
326removeCell(Cell icell)
327{
328#ifdef ARCANE_CHECK
329 _checkValidItem(icell);
330 if (icell.itemBase().isSuppressed())
331 ARCANE_FATAL("Cell '{0}' is already removed", icell.uniqueId());
332#endif
333 // TODO: remove connected faces and edges.
334 _removeSubItems(icell);
337 if (icell.level() > 0) {
338 _removeParentCellToCell(icell);
339 Cell parent_cell = icell.hParent();
340 _removeChildCellToCell(parent_cell, icell);
341 }
342 _removeOne(icell);
343}
344
345/*---------------------------------------------------------------------------*/
346/*---------------------------------------------------------------------------*/
347
350{
351 CellLocalIdToCellConverter cells(this);
352 for (Int32 lid : cells_local_id)
353 removeCell(cells[lid]);
354}
355
356/*---------------------------------------------------------------------------*/
357/*---------------------------------------------------------------------------*/
358
360detachCell(Cell icell)
361{
362#ifdef ARCANE_CHECK
363 _checkValidItem(icell);
364 if (icell.itemBase().isSuppressed())
365 ARCANE_FATAL("Cell '{0}' is already removed", icell.uniqueId());
366#endif /* ARCANE_CHECK */
367
368 _removeSubItems(icell);
370 if (icell.level() > 0) {
371 _removeParentCellToCell(icell);
372 Cell parent_cell = icell.hParent();
373 _removeChildCellToCell(parent_cell, icell);
374 }
375 _detachOne(icell);
376}
377
378/*---------------------------------------------------------------------------*/
379/*---------------------------------------------------------------------------*/
380
382detachCells2(Int32ConstArrayView cells_local_id)
383{
384 // Implemented in ItemFamily. Even if only cells are detached, the implementation
385 // is not CellFamily specific, thx to ItemFamilyNetwork
386 _detachCells2(cells_local_id);
387}
388
389/*---------------------------------------------------------------------------*/
390/*---------------------------------------------------------------------------*/
391
398{
399 // The order (faces, then edges then nodes) is important.
400 // Do not change.
401
402 // Remove faces from the cell that are no longer connected
403 for (Face face : cell.faces())
404 m_face_family->removeFaceIfNotConnected(face);
405
406 // Remove edges from the cell that are no longer connected
407 for (Edge edge : cell.edges())
408 m_edge_family->removeEdgeIfNotConnected(edge);
409
410 // remove nodes from the cell that are no longer connected
411 for (Node node : cell.nodes())
412 m_node_family->removeNodeIfNotConnected(node);
413}
414
415/*---------------------------------------------------------------------------*/
416/*---------------------------------------------------------------------------*/
417
420{
422
423 // remove the cell
424 _removeDetachedOne(cell);
425}
426
427/*---------------------------------------------------------------------------*/
428/*---------------------------------------------------------------------------*/
429
431internalRemoveItems(Int32ConstArrayView local_ids, bool keep_ghost)
432{
433 ARCANE_UNUSED(keep_ghost);
434 for (Integer i = 0, is = local_ids.size(); i < is; ++i) {
435 removeCell(m_item_internal_list->cells[local_ids[i]]);
436 }
437}
438
439/*---------------------------------------------------------------------------*/
440/*---------------------------------------------------------------------------*/
441
448{
449 m_node_connectivity->replaceItem(cell, index, node);
450}
451
452/*---------------------------------------------------------------------------*/
453/*---------------------------------------------------------------------------*/
454
461{
462 m_edge_connectivity->replaceItem(cell, index, edge);
463}
464
465/*---------------------------------------------------------------------------*/
466/*---------------------------------------------------------------------------*/
467
474{
475 m_face_connectivity->replaceItem(cell, index, face);
476}
477
478/*---------------------------------------------------------------------------*/
479/*---------------------------------------------------------------------------*/
480
481void CellFamily::
482replaceHChild(ItemLocalId cell, Integer index, ItemLocalId child_cell)
483{
484 m_hchild_connectivity->replaceItem(cell, index, child_cell);
485}
486
487/*---------------------------------------------------------------------------*/
488/*---------------------------------------------------------------------------*/
489
490void CellFamily::
491replaceHParent(ItemLocalId cell, Integer index, ItemLocalId parent_cell)
492{
493 m_hparent_connectivity->replaceItem(cell, index, parent_cell);
494}
495
496/*---------------------------------------------------------------------------*/
497/*---------------------------------------------------------------------------*/
498
501{
502 m_mesh_connectivity = c;
503 m_node_prealloc = Connectivity::getPrealloc(m_mesh_connectivity, IK_Cell, IK_Node);
504 m_node_connectivity->setPreAllocatedSize(m_node_prealloc);
505 // Edges only exist in dimension 3.
506 if (mesh()->dimension() == 3) {
507 Integer edge_prealloc = Connectivity::getPrealloc(m_mesh_connectivity, IK_Cell, IK_Edge);
508 m_edge_connectivity->setPreAllocatedSize(edge_prealloc);
509 if (Connectivity::hasConnectivity(m_mesh_connectivity, Connectivity::CT_HasEdge))
510 m_edge_prealloc = edge_prealloc;
511 }
512 m_face_prealloc = Connectivity::getPrealloc(m_mesh_connectivity, IK_Cell, IK_Face);
513 m_face_connectivity->setPreAllocatedSize(m_face_prealloc);
514 debug() << "Family " << name() << " prealloc "
515 << m_node_prealloc << " by node, "
516 << m_edge_prealloc << " by edge, "
517 << m_face_prealloc << " by face.";
518}
519
520/*---------------------------------------------------------------------------*/
521/*---------------------------------------------------------------------------*/
522
524_addParentCellToCell(Cell cell, Cell parent_cell)
525{
526 m_hparent_connectivity->addConnectedItem(ItemLocalId(cell), ItemLocalId(parent_cell));
527}
528
529/*---------------------------------------------------------------------------*/
530/*---------------------------------------------------------------------------*/
531
532void CellFamily::
533_addChildCellToCell2(Cell iparent_cell, Cell child_cell)
534{
535 m_hchild_connectivity->addConnectedItem(ItemLocalId(iparent_cell), ItemLocalId(child_cell));
536}
537
538/*---------------------------------------------------------------------------*/
539/*---------------------------------------------------------------------------*/
540
541void CellFamily::
542_addChildCellToCell(Cell iparent_cell, Integer position, Cell child_cell)
543{
544 Cell parent_cell(iparent_cell);
545 // NOTE GG: The old method below in comment seems
546 // to only work if \a position corresponds to parent_cell->nbHChildren().
547 // And in this case, it is not necessary to make 2 calls.
548 // m_hchild_connectivity->addConnectedItem(parent_cell,ItemLocalId(NULL_ITEM_LOCAL_ID));
549 Int32 nb_connected = m_hchild_connectivity->trueCustomConnectivity()->nbConnectedItem(parent_cell);
550 for (Int32 i = nb_connected; i < (position + 1); ++i)
551 m_hchild_connectivity->addConnectedItem(parent_cell, ItemLocalId(NULL_ITEM_LOCAL_ID));
552 auto x = _topologyModifier();
553 x->replaceHChild(ItemLocalId(iparent_cell), position, child_cell);
554 parent_cell.mutableItemBase().addFlags(ItemFlags::II_Inactive);
555}
556
557/*---------------------------------------------------------------------------*/
558/*---------------------------------------------------------------------------*/
559
560void CellFamily::
561_addChildrenCellsToCell(Cell parent_cell, Int32ConstArrayView children_cells_lid)
562{
563 Integer nb_children = children_cells_lid.size();
564 auto c = m_hchild_connectivity->trueCustomConnectivity();
565 if (c) {
566 ItemLocalId item_lid(parent_cell);
567 c->addConnectedItems(item_lid, nb_children);
568 }
569 _updateSharedInfo();
570
571 auto x = _topologyModifier();
572 for (Integer i = 0; i < nb_children; ++i)
573 x->replaceHChild(ItemLocalId(parent_cell), i, ItemLocalId(children_cells_lid[i]));
574
575 parent_cell.mutableItemBase().addFlags(ItemFlags::II_Inactive);
576}
577
578/*---------------------------------------------------------------------------*/
579/*---------------------------------------------------------------------------*/
580
581void CellFamily::
582_removeParentCellToCell(Cell cell)
583{
584 m_hparent_connectivity->removeConnectedItems(ItemLocalId(cell));
585}
586
587/*---------------------------------------------------------------------------*/
588/*---------------------------------------------------------------------------*/
589
590void CellFamily::
591_removeChildCellToCell(Cell parent_cell, Cell cell)
592{
593 m_hchild_connectivity->removeConnectedItem(ItemLocalId(parent_cell), ItemLocalId(cell));
594 parent_cell.mutableItemBase().removeFlags(ItemFlags::II_Inactive);
595}
596
597/*---------------------------------------------------------------------------*/
598/*---------------------------------------------------------------------------*/
599
600void CellFamily::
601_removeChildrenCellsToCell(Cell parent_cell)
602{
603 m_hchild_connectivity->removeConnectedItems(ItemLocalId(parent_cell));
604 parent_cell.mutableItemBase().removeFlags(ItemFlags::II_Inactive);
605}
606
607/*---------------------------------------------------------------------------*/
608/*---------------------------------------------------------------------------*/
609
610} // namespace Arcane::mesh
611
612/*---------------------------------------------------------------------------*/
613/*---------------------------------------------------------------------------*/
#define ARCANE_CHECK_POINTER(ptr)
Macro returning the pointer ptr if it is not null or throwing an exception if it is null.
#define ARCANE_FATAL(...)
Macro throwing a FatalErrorException.
Class to convert a CellLocalId to a cell.
Cell of a mesh.
Definition Item.h:1300
FaceConnectedListViewType faces() const
List of faces of the cell.
Definition Item.h:1403
Int32 level() const
Definition Item.h:1473
Cell hParent() const
Definition Item.h:1432
EdgeConnectedListViewType edges() const
List of edges of the cell.
Definition Item.h:1421
Constant view of an array of type T.
constexpr Integer size() const noexcept
Number of elements in the array.
Edge of a cell.
Definition Item.h:875
Face of a cell.
Definition Item.h:1032
virtual IItemFamily * nodeFamily()=0
Returns the node family.
virtual IItemFamily * edgeFamily()=0
Returns the edge family.
virtual IItemFamily * faceFamily()=0
Returns the face family.
virtual bool useMeshItemFamilyDependencies() const =0
check if the network itemFamily dependencies is activated
virtual IItemFamilyNetwork * itemFamilyNetwork()=0
Family network interface (connected families).
bool isSuppressed() const
True if the entity is suppressed.
@ II_Inactive
The entity is inactive //COARSEN_INACTIVE,.
Definition ItemFlags.h:80
Internal structure of a mesh entity.
Index of an Item in a variable.
Definition ItemLocalId.h:42
Type of an entity (Item).
Definition ItemTypeId.h:33
Info on a mesh entity type.
NodeConnectedListViewType nodes() const
List of nodes of the entity.
Definition Item.h:843
Base class for a mesh element.
Definition Item.h:84
constexpr Int32 localId() const
Local identifier of the entity in the processor subdomain.
Definition Item.h:233
ItemUniqueId uniqueId() const
Unique identifier across all domains.
Definition Item.h:239
impl::ItemBase itemBase() const
Internal part of the entity.
Definition Item.h:383
Node of a mesh.
Definition Item.h:598
TraceMessageDbg debug(Trace::eDebugLevel=Trace::Medium) const
Flow for a debug message.
void replaceFace(ItemLocalId item_lid, Integer index, ItemLocalId new_lid) override
Replaces a face of an entity.
Definition CellFamily.cc:62
void replaceNode(ItemLocalId item_lid, Integer index, ItemLocalId new_lid) override
Replaces a node of an entity.
Definition CellFamily.cc:54
void replaceHParent(ItemLocalId item_lid, Integer index, ItemLocalId new_lid) override
Replaces a parent entity of an entity.
Definition CellFamily.cc:66
void replaceEdge(ItemLocalId item_lid, Integer index, ItemLocalId new_lid) override
Replaces an edge of an entity.
Definition CellFamily.cc:58
void replaceHChild(ItemLocalId item_lid, Integer index, ItemLocalId new_lid) override
Replaces a child entity of an entity.
Definition CellFamily.cc:70
void _removeSubItems(Cell cell)
Item allocOne(Int64 uid, ItemTypeId type_id, MeshInfos &mesh_info) override
Allocates an element in the family and updates the corresponding mesh_info.
void allocateItemsBulk(Int64ConstArrayView uids, ItemTypeInfo *type, Int32 owner, Int32ArrayView lids)
Allocates every item of uids at once, in one pass per family array.
void detachCells2(Int32ConstArrayView cell_local_ids)
virtual void internalRemoveItems(Int32ConstArrayView local_ids, bool keep_ghost=false) override
void replaceNode(ItemLocalId cell, Integer index, ItemLocalId node)
Replaces the node at index index of the cell cell with that of localId() node.
void removeCell(Cell cell)
void removeCells(ConstArrayView< Int32 > cells_local_id)
Removes the cells whose local numbers are cells_local_id.
void removeDetachedCell(Cell cell)
virtual void computeSynchronizeInfos() override
Constructs the structures necessary for synchronization.
IncrementalItemConnectivity * nodeConnectivity() const
The true connectivity behind the selector, for a bulk fill.
void _removeNotConnectedSubItems(Cell cell)
Removes cell sub-entities that are not connected to any cell.
void _addParentCellToCell(Cell cell, Cell parent_cell)
AMR.
void replaceFace(ItemLocalId cell, Integer index, ItemLocalId face)
Replaces the face at index index of the cell cell with that of localId() face.
void detachCell(Cell cell)
void replaceEdge(ItemLocalId cell, Integer index, ItemLocalId edge)
Replaces the edge at index index of the cell cell with that of localId() edge.
void setConnectivity(const Integer c)
Defines the active connectivity for the associated mesh.
Integer nbConnectedItem(ItemLocalId lid) const final
Number of entities connected to the source entity with local ID lid.
IMesh * mesh() const override
Associated mesh.
IItemFamilyTopologyModifier * _topologyModifier() override
Topology modifier interface.
Definition ItemFamily.h:412
void computeSynchronizeInfos() override
Constructs the structures necessary for synchronization.
void _allocateInfosBulk(Int64ConstArrayView uids, ItemTypeInfo *type, Int32 owner, Int32ArrayView lids)
Allocates every item of uids at once.
String name() const override
Family name.
Definition ItemFamily.h:140
Class containing mesh information.
Definition MeshInfos.h:36
Integer & nbCell()
Number of cells in the mesh.
Definition MeshInfos.h:69
std::int64_t Int64
Signed integer type of 64 bits.
Int32 Integer
Type representing an integer.
ConstArrayView< Int32 > Int32ConstArrayView
C equivalent of a 1D array of 32-bit integers.
Definition UtilsTypes.h:476
ConstArrayView< Int64 > Int64ConstArrayView
C equivalent of a 1D array of 64-bit integers.
Definition UtilsTypes.h:474
ArrayView< Int32 > Int32ArrayView
C equivalent of a 1D array of 32-bit integers.
Definition UtilsTypes.h:447
@ IK_Node
Node mesh entity.
@ IK_Cell
Cell mesh entity.
@ IK_Face
Face mesh entity.
@ IK_Edge
Edge mesh entity.
@ Cell
The mesh is AMR by cell.
Definition MeshKind.h:53
std::int32_t Int32
Signed integer type of 32 bits.