Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
IItemFamilyTopologyModifier.h
1// -*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
2//-----------------------------------------------------------------------------
3// Copyright 2000-2026 CEA (www.cea.fr) IFPEN (www.ifpenergiesnouvelles.com)
4// See the top-level COPYRIGHT file for details.
5// SPDX-License-Identifier: Apache-2.0
6//-----------------------------------------------------------------------------
7/*---------------------------------------------------------------------------*/
8/* IItemFamilyTopologyModifier.h (C) 2000-2025 */
9/* */
10/* Topology modification interface for entities within a family. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_IITEMFAMILYTOPOLOGYMODIFIER_H
13#define ARCANE_IITEMFAMILYTOPOLOGYMODIFIER_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18
19/*---------------------------------------------------------------------------*/
20/*---------------------------------------------------------------------------*/
21
22namespace Arcane
23{
24
25/*---------------------------------------------------------------------------*/
26/*---------------------------------------------------------------------------*/
27
28/*!
29 * \ingroup Mesh
30 * \brief Interface for modifying the topology of entities within a family.
31 *
32 * This class is intended to be temporary and serves to replace
33 * direct calls to ItemInternal by managing old or new
34 * connectivities.
35 *
36 * \warning This class allows direct modification of the connectivities
37 * of unstructured meshes, which can introduce inconsistencies in
38 * the topology and connectivities. Therefore, extreme caution must be
39 * used when employing methods from this class. It is preferable
40 * to use the methods of IMeshModifier if you wish to add/remove
41 * mesh entities while guaranteeing consistency.
42 */
43class ARCANE_CORE_EXPORT IItemFamilyTopologyModifier
44{
45 public:
46
47 //! Frees resources
48 virtual ~IItemFamilyTopologyModifier() = default;
49
50 public:
51
52 //! Associated family
53 virtual IItemFamily* family() const = 0;
54
55 public:
56
57 /*!
58 * \brief Replaces a node of an entity.
59 *
60 * Replaces the \a index-th node of the entity in the family \a family()
61 * with local ID \a item_lid by the node with local ID \a new_node_lid.
62 */
63 virtual void replaceNode(ItemLocalId item_lid, Integer index,
64 ItemLocalId new_node_lid) = 0;
65
66 /*!
67 * \brief Replaces an edge of an entity.
68 *
69 * Replaces the \a index-th edge of the entity in the family \a family()
70 * with local ID \a item_lid by the edge with local ID \a new_edge_lid.
71 */
72 virtual void replaceEdge(ItemLocalId item_lid, Integer index,
73 ItemLocalId new_edge_lid) = 0;
74
75 /*!
76 * \brief Replaces a face of an entity.
77 *
78 * Replaces the \a index-th face of the entity in the family \a family()
79 * with local ID \a item_lid by the face with local ID \a new_face_lid.
80 */
81 virtual void replaceFace(ItemLocalId item_lid, Integer index,
82 ItemLocalId new_face_lid) = 0;
83
84 /*!
85 * \brief Replaces a cell of an entity.
86 *
87 * Replaces the \a index-th cell of the entity in the family \a family()
88 * with local ID \a item_lid by the face with local ID \a new_cell_lid.
89 */
90 virtual void replaceCell(ItemLocalId item_lid, Integer index,
91 ItemLocalId new_cell_lid) = 0;
92
93 /*!
94 * \brief Replaces a parent entity of an entity.
95 *
96 * Replaces the \a index-th parent entity of the entity in the family \a family()
97 * with local ID \a item_lid by the parent entity with local ID \a new_hparent_lid.
98 */
99 virtual void replaceHParent(ItemLocalId item_lid, Integer index,
100 ItemLocalId new_hparent_lid) = 0;
101
102 /*!
103 * \brief Replaces a child entity of an entity.
104 *
105 * Replaces the \a index-th child entity of the entity in the family \a family()
106 * with local ID \a item_lid by the child entity with local ID \a new_hchild_lid.
107 */
108 virtual void replaceHChild(ItemLocalId item_lid, Integer index,
109 ItemLocalId new_hchild_lid) = 0;
110
111 /*!
112 * \brief Finds and replaces a node of an entity.
113 *
114 * Replaces the node with local ID \a old_node_lid of the entity in the family \a family()
115 * with local ID \a item_lid by the node with local ID \a new_node_lid.
116 *
117 * Throws an exception if the node \a old_node_id is not found.
118 */
119 virtual void findAndReplaceNode(ItemLocalId item_lid, ItemLocalId old_node_lid,
120 ItemLocalId new_node_lid) = 0;
121
122 /*!
123 * \brief Finds and replaces an edge of an entity.
124 *
125 * Replaces the edge with local ID \a old_edge_lid of the entity in the family \a family()
126 * with local ID \a item_lid by the edge with local ID \a new_edge_lid.
127 *
128 * Throws an exception if the edge \a old_edge_lid is not found.
129 */
130 virtual void findAndReplaceEdge(ItemLocalId item_lid, ItemLocalId old_edge_lid,
131 ItemLocalId new_edge_lid) = 0;
132
133 /*!
134 * \brief Finds and replaces a face of an entity.
135 *
136 * Replaces the face with local ID \a old_face_lid of the entity in the family \a family()
137 * with local ID \a item_lid by the face with local ID \a new_face_lid.
138 *
139 * Throws an exception if the face \a old_face_lid is not found.
140 */
141 virtual void findAndReplaceFace(ItemLocalId item_lid, ItemLocalId old_face_lid,
142 ItemLocalId new_face_lid) = 0;
143
144 /*!
145 * \brief Finds and replaces a cell of an entity.
146 *
147 * Replaces the cell with local ID \a old_cell_lid of the entity in the family \a family()
148 * with local ID \a item_lid by the face with local ID \a new_cell_lid.
149 *
150 * Throws an exception if the cell \a old_cell_lid is not found.
151 */
152 virtual void findAndReplaceCell(ItemLocalId item_lid, ItemLocalId old_cell_lid,
153 ItemLocalId new_cell_lid) = 0;
154
155 /*!
156 * \brief Positions a cell in front and behind a face.
157 *
158 * This method is only implemented for face families. For other
159 * families, it raises a NotSupportedException.
160 *
161 * * \param face_lid local ID of the face
162 * \param back_cell_lid local ID of the cell behind (or NULL_ITEM_LOCAL_ID)
163 * \param front_cell_lid local ID of the cell in front (or NULL_ITEM_LOCAL_ID)
164 */
165 virtual void setBackAndFrontCells(FaceLocalId face_lid, CellLocalId back_cell_lid,
166 CellLocalId front_cell_lid);
167};
168
169/*---------------------------------------------------------------------------*/
170/*---------------------------------------------------------------------------*/
171
172} // namespace Arcane
173
174/*---------------------------------------------------------------------------*/
175/*---------------------------------------------------------------------------*/
176
177#endif
Declarations of types on entities.
Interface for modifying the topology of entities within a family.
virtual void replaceHParent(ItemLocalId item_lid, Integer index, ItemLocalId new_hparent_lid)=0
Replaces a parent entity of an entity.
virtual IItemFamily * family() const =0
Associated family.
virtual void replaceCell(ItemLocalId item_lid, Integer index, ItemLocalId new_cell_lid)=0
Replaces a cell of an entity.
virtual void replaceNode(ItemLocalId item_lid, Integer index, ItemLocalId new_node_lid)=0
Replaces a node of an entity.
virtual void findAndReplaceCell(ItemLocalId item_lid, ItemLocalId old_cell_lid, ItemLocalId new_cell_lid)=0
Finds and replaces a cell of an entity.
virtual void findAndReplaceNode(ItemLocalId item_lid, ItemLocalId old_node_lid, ItemLocalId new_node_lid)=0
Finds and replaces a node of an entity.
virtual void setBackAndFrontCells(FaceLocalId face_lid, CellLocalId back_cell_lid, CellLocalId front_cell_lid)
Positions a cell in front and behind a face.
virtual void findAndReplaceEdge(ItemLocalId item_lid, ItemLocalId old_edge_lid, ItemLocalId new_edge_lid)=0
Finds and replaces an edge of an entity.
virtual void replaceEdge(ItemLocalId item_lid, Integer index, ItemLocalId new_edge_lid)=0
Replaces an edge of an entity.
virtual void findAndReplaceFace(ItemLocalId item_lid, ItemLocalId old_face_lid, ItemLocalId new_face_lid)=0
Finds and replaces a face of an entity.
virtual ~IItemFamilyTopologyModifier()=default
Frees resources.
virtual void replaceFace(ItemLocalId item_lid, Integer index, ItemLocalId new_face_lid)=0
Replaces a face of an entity.
virtual void replaceHChild(ItemLocalId item_lid, Integer index, ItemLocalId new_hchild_lid)=0
Replaces a child entity of an entity.
Interface of an entity family.
Definition IItemFamily.h:83
Index of an Item in a variable.
Definition ItemLocalId.h:42
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.