Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
IMeshModifier.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/* IMeshModifier.h (C) 2000-2025 */
9/* */
10/* Mesh modification interface. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CORE_IMESHMODIFIER_H
13#define ARCANE_CORE_IMESHMODIFIER_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
18#include "arcane/core/Item.h"
19
20/*---------------------------------------------------------------------------*/
21/*---------------------------------------------------------------------------*/
22
23namespace Arcane
24{
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29class IMesh;
34class IMeshModifier;
35
36/*---------------------------------------------------------------------------*/
37/*---------------------------------------------------------------------------*/
38
57class MeshModifierAddCellsArgs
58{
59 public:
60
61 MeshModifierAddCellsArgs(Integer nb_cell, Int64ConstArrayView cell_infos)
62 : m_nb_cell(nb_cell)
63 , m_cell_infos(cell_infos)
64 {}
65
66 MeshModifierAddCellsArgs(Integer nb_cell, Int64ConstArrayView cell_infos,
67 Int32ArrayView cell_lids)
68 : MeshModifierAddCellsArgs(nb_cell, cell_infos)
69 {
70 m_cell_lids = cell_lids;
71 }
72
73 public:
74
75 Int32 nbCell() const { return m_nb_cell; }
76 Int64ConstArrayView cellInfos() const { return m_cell_infos; }
77 Int32ArrayView cellLocalIds() const { return m_cell_lids; }
78
80 void setAllowBuildFaces(bool v) { m_is_allow_build_faces = v; }
81 bool isAllowBuildFaces() const { return m_is_allow_build_faces; }
82
83 private:
84
85 Int32 m_nb_cell = 0;
86 Int64ConstArrayView m_cell_infos;
89 bool m_is_allow_build_faces = true;
90};
91
92/*---------------------------------------------------------------------------*/
93/*---------------------------------------------------------------------------*/
94
98class MeshModifierAddFacesArgs
99{
100 public:
101
102 MeshModifierAddFacesArgs(Int32 nb_face, Int64ConstArrayView face_infos)
103 : m_nb_face(nb_face)
104 , m_face_infos(face_infos)
105 {}
106
107 MeshModifierAddFacesArgs(Int32 nb_face, Int64ConstArrayView face_infos,
108 Int32ArrayView face_lids)
109 : MeshModifierAddFacesArgs(nb_face, face_infos)
110 {
111 m_face_lids = face_lids;
112 }
113
114 public:
115
116 Int32 nbFace() const { return m_nb_face; }
117 Int64ConstArrayView faceInfos() const { return m_face_infos; }
118 Int32ArrayView faceLocalIds() const { return m_face_lids; }
119
120 private:
121
122 Int32 m_nb_face = 0;
123 Int64ConstArrayView m_face_infos;
126};
127
128/*---------------------------------------------------------------------------*/
129/*---------------------------------------------------------------------------*/
130
143class ARCANE_CORE_EXPORT IMeshModifier
144{
145 public:
146
147 virtual ~IMeshModifier() {} //<! Releases resources
148
149 public:
150
151 virtual void build() = 0;
152
153 public:
154
156 virtual IMesh* mesh() = 0;
157
158 public:
159
172 virtual void setDynamic(bool v) = 0;
173
191 virtual void addCells(Integer nb_cell, Int64ConstArrayView cell_infos,
192 Int32ArrayView cells_lid = Int32ArrayView()) = 0;
193
195 virtual void addCells(const MeshModifierAddCellsArgs& args);
196
202 virtual void addFaces(Integer nb_face, Int64ConstArrayView face_infos,
203 Int32ArrayView face_lids = Int32ArrayView()) = 0;
204
218 virtual void addFaces(const MeshModifierAddFacesArgs& args);
219
236 virtual void addEdges(Integer nb_edge, Int64ConstArrayView edge_infos,
237 Int32ArrayView edge_lids = Int32ArrayView()) = 0;
238
255 virtual void addNodes(Int64ConstArrayView nodes_uid,
256 Int32ArrayView nodes_lid = Int32ArrayView()) = 0;
257
265 virtual void removeCells(Int32ConstArrayView cells_local_id) = 0;
266
267 virtual void removeCells(Int32ConstArrayView cells_local_id, bool update_ghost) = 0;
268
277 virtual void detachCells(Int32ConstArrayView cells_local_id) = 0;
278
286 virtual void removeDetachedCells(Int32ConstArrayView cells_local_id) = 0;
287
289 virtual void flagCellToRefine(Int32ConstArrayView cells_lids) = 0;
290 virtual void flagCellToCoarsen(Int32ConstArrayView cells_lids) = 0;
291 virtual void refineItems() = 0;
292 virtual void coarsenItems() = 0;
293 virtual void coarsenItemsV2(bool update_parent_flag) = 0;
294 virtual bool adapt() = 0;
295 virtual void registerCallBack(IAMRTransportFunctor* f) = 0;
296 virtual void unRegisterCallBack(IAMRTransportFunctor* f) = 0;
297 virtual void addHChildrenCells(Cell parent_cell, Integer nb_cell,
298 Int64ConstArrayView cells_infos, Int32ArrayView cells_lid = Int32ArrayView()) = 0;
299
300 virtual void addParentCellToCell(Cell child, Cell parent) = 0;
301 virtual void addChildCellToCell(Cell parent, Cell child) = 0;
302
303 virtual void addParentFaceToFace(Face child, Face parent) = 0;
304 virtual void addChildFaceToFace(Face parent, Face child) = 0;
305
306 virtual void addParentNodeToNode(Node child, Node parent) = 0;
307 virtual void addChildNodeToNode(Node parent, Node child) = 0;
308
310 virtual void clearItems() = 0;
311
320 ARCANE_DEPRECATED_240 virtual void addCells(ISerializer* buffer) = 0;
321
332 ARCANE_DEPRECATED_240 virtual void addCells(ISerializer* buffer, Int32Array& cells_local_id) = 0;
333
339 virtual void endUpdate() = 0;
340
341 virtual void endUpdate(bool update_ghost_layer, bool remove_old_ghost) = 0; // SDC: this signature is needed @IFPEN.
342
343 public:
344
350 virtual void updateGhostLayers() = 0;
351
353 virtual void updateGhostLayerFromParent(Array<Int64>& ghost_cell_to_refine,
354 Array<Int64>& ghost_cell_to_coarsen,
355 bool remove_old_ghost) = 0;
356
359
362
365
368
369 public:
370
372 virtual void mergeMeshes(ConstArrayView<IMesh*> meshes) = 0;
373
374 public:
375
378};
379
380/*---------------------------------------------------------------------------*/
381/*---------------------------------------------------------------------------*/
382
383} // End namespace Arcane
384
385/*---------------------------------------------------------------------------*/
386/*---------------------------------------------------------------------------*/
387
388#endif
Declarations of Arcane's general types.
Base class for 1D data vectors.
Cell of a mesh.
Definition Item.h:1300
Constant view of an array of type T.
Face of a cell.
Definition Item.h:1032
Interface of a functor with argument.
Interface of a builder for "extraordinary" ghost cells.
Interface of a builder for "extraordinary" ghost cells.
Internal part of IMeshModifier.
Mesh modification interface.
virtual void updateGhostLayers()=0
Updates the ghost layer.
virtual void setDynamic(bool v)=0
Sets the property indicating whether the mesh can evolve.
virtual ARCANE_DEPRECATED_240 void addCells(ISerializer *buffer, Int32Array &cells_local_id)=0
Adds cells from the data contained in buffer.
virtual void removeCells(Int32ConstArrayView cells_local_id)=0
Removes cells.
virtual void addExtraGhostParticlesBuilder(IExtraGhostParticlesBuilder *builder)=0
Addition of the "extraordinary" ghost particle addition algorithm.
virtual void flagCellToRefine(Int32ConstArrayView cells_lids)=0
AMR.
virtual IMesh * mesh()=0
Associated mesh.
virtual void addNodes(Int64ConstArrayView nodes_uid, Int32ArrayView nodes_lid=Int32ArrayView())=0
Adds nodes.
virtual void addFaces(Integer nb_face, Int64ConstArrayView face_infos, Int32ArrayView face_lids=Int32ArrayView())=0
Adds faces.
virtual void removeExtraGhostParticlesBuilder(IExtraGhostParticlesBuilder *builder)=0
Removes the association with the builder instance.
virtual void removeDetachedCells(Int32ConstArrayView cells_local_id)=0
Removes detached cells.
virtual IMeshModifierInternal * _modifierInternalApi()=0
Internal API for Arcane.
virtual void detachCells(Int32ConstArrayView cells_local_id)=0
Detaches cells from the mesh.
virtual void addCells(Integer nb_cell, Int64ConstArrayView cell_infos, Int32ArrayView cells_lid=Int32ArrayView())=0
Adds cells.
virtual ARCANE_DEPRECATED_240 void addCells(ISerializer *buffer)=0
Adds cells from the data contained in buffer.
virtual void mergeMeshes(ConstArrayView< IMesh * > meshes)=0
Merges the meshes of meshes with the current mesh.
virtual void endUpdate()=0
Notifies the instance that mesh modification is finished.
virtual void addExtraGhostCellsBuilder(IExtraGhostCellsBuilder *builder)=0
addition of the "extraordinary" ghost cells addition algorithm.
virtual void clearItems()=0
Deletes all entities of all families in this mesh.
virtual void removeExtraGhostCellsBuilder(IExtraGhostCellsBuilder *builder)=0
Removes the association with the builder instance.
virtual void updateGhostLayerFromParent(Array< Int64 > &ghost_cell_to_refine, Array< Int64 > &ghost_cell_to_coarsen, bool remove_old_ghost)=0
AMR.
virtual void addEdges(Integer nb_edge, Int64ConstArrayView edge_infos, Int32ArrayView edge_lids=Int32ArrayView())=0
Adds edges.
Arguments for IMeshModifier::addCells().
void setAllowBuildFaces(bool v)
Indicates whether associated faces are allowed to be built.
Int32ArrayView m_cell_lids
Returns, list of localIds() of the created cells.
Arguments for IMeshModifier::addFaces().
Int32ArrayView m_face_lids
Returns, list of localIds() of the created faces.
Node of a mesh.
Definition Item.h:598
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
ConstArrayView< Int32 > Int32ConstArrayView
C equivalent of a 1D array of 32-bit integers.
Definition UtilsTypes.h:482
ConstArrayView< Int64 > Int64ConstArrayView
C equivalent of a 1D array of 64-bit integers.
Definition UtilsTypes.h:480
ArrayView< Int32 > Int32ArrayView
C equivalent of a 1D array of 32-bit integers.
Definition UtilsTypes.h:453
Array< Int32 > Int32Array
Dynamic one-dimensional array of 32-bit integers.
Definition UtilsTypes.h:127
std::int32_t Int32
Signed integer type of 32 bits.