Arcane  v4.1.4.0
Documentation développeur
Chargement...
Recherche...
Aucune correspondance
CartesianPatchGroup.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/* CartesianPatchGroup.h (C) 2000-2026 */
9/* */
10/* Gestion du groupe de patchs du maillage cartésien. */
11/*---------------------------------------------------------------------------*/
12#ifndef ARCANE_CARTESIANMESH_CARTESIANPATCHGROUP_H
13#define ARCANE_CARTESIANMESH_CARTESIANPATCHGROUP_H
14/*---------------------------------------------------------------------------*/
15/*---------------------------------------------------------------------------*/
16
17#include "AMRPatchPositionLevelGroup.h"
18#include "arcane/cartesianmesh/CartesianMeshGlobal.h"
19
20#include "arcane/core/ItemGroup.h"
21
22#include "arcane/utils/UniqueArray.h"
23#include "arcane/utils/Ref.h"
24#include "arcane/utils/TraceAccessor.h"
25
26#include "arcane/cartesianmesh/CartesianMeshPatchListView.h"
27
28/*---------------------------------------------------------------------------*/
29/*---------------------------------------------------------------------------*/
30
31namespace Arcane
32{
33
34/*---------------------------------------------------------------------------*/
35/*---------------------------------------------------------------------------*/
36
38
39/*---------------------------------------------------------------------------*/
40/*---------------------------------------------------------------------------*/
41
42class ARCANE_CARTESIANMESH_EXPORT CartesianPatchGroup
43: public TraceAccessor
44{
45 public:
46
47 explicit CartesianPatchGroup(ICartesianMesh* cmesh);
48
49 public:
50
51 void build();
52 void saveInfosInProperties();
53 void recreateFromDump();
54
61
68 void addPatch(ConstArrayView<Int32> cells_local_id);
69
80 void addPatch(const AMRZonePosition& zone_position);
81
82 Integer nbPatch() const;
83 Ref<CartesianMeshPatch> patch(Integer index) const;
84 CartesianMeshPatchListView patchListView() const;
85
93
101
109
114 void clear();
115
124 void removePatch(Integer index);
125
134
144 void removeCellsInZone(const AMRZonePosition& zone_to_delete);
145
156 void applyPatchEdit(bool remove_empty_patches, bool update_higher_level);
157
165
166 void mergePatches();
167
168 void beginAdaptMesh(Int32 nb_levels, Int32 level_to_refine_first);
169 void endAdaptMesh();
170 void adaptLevel(Int32 level_to_adapt, bool do_fatal_if_useless);
171
172 void clearRefineRelatedFlags() const;
173
174 void rebuildAvailableGroupIndex(ConstArrayView<Integer> available_group_index);
175
176 ConstArrayView<Int32> availableGroupIndex();
177
178 void setOverlapLayerSizeTopLevel(Integer size_of_overlap_layer_top_level);
179 Int32 overlapLayerSize(Int32 level);
180
181 private:
182
183 Integer _addPatchAfterRestore(CellGroup cell_group);
184 void _addPatch(CellGroup cell_group, Integer group_index);
185
186 void _increaseOverlapSizeLevel(Int32 level_to_increate, Int32 new_size);
187 void _reduceOverlapSizeLevel(Int32 level_to_reduce, Int32 new_size);
188
189 void _updateHigherLevel();
190
191 void _changeOverlapSizeLevel(Int32 level, Int32 previous_higher_level, Int32 new_higher_level);
192
193 void _coarsenUselessCells(bool use_cells_level);
194 void _coarsenUselessCellsInLevel(Int32 level);
195
196 void _updatePatchFlagsOfItemsLevel(Int32 level, bool use_cell_groups);
197 void _updatePatchFlagsOfItemsGroundLevel();
198 void _removePatchFlagsOfItemsLevel(Int32 level);
199
200 void _checkPatchesAndMesh();
201
202 void _removeCellsInAllPatches(const AMRPatchPosition& zone_to_delete);
203
204 Integer _nextIndexForNewPatch();
205
206 void _addPatchInstance(Ref<CartesianMeshPatch> v);
207
208 void _removeOnePatch(Integer index);
209 void _removeMultiplePatches(ConstArrayView<Integer> indexes);
210 void _removeAllPatches();
211 void _createGroundPatch();
212
213 Integer _addCellGroup(CellGroup cell_group, CartesianMeshPatch* patch, bool add_flags);
214 void _updateCellGroups(Integer index, bool update_flags);
215
216 void _removePartOfPatch(Integer index_patch_to_edit, const AMRPatchPosition& patch_position);
217 void _addCutPatch(const AMRPatchPosition& new_patch_position, CellGroup parent_patch_cell_group);
218 Integer _addPatch(const AMRPatchPosition& new_patch_position);
219
220 private:
221
222 UniqueArray<CellGroup> m_amr_patch_cell_groups_all;
223 UniqueArray<CellGroup> m_amr_patch_cell_groups_inpatch;
224 UniqueArray<CellGroup> m_amr_patch_cell_groups_overlap;
225 UniqueArray<ICartesianMeshPatch*> m_amr_patches_pointer;
227 ICartesianMesh* m_cmesh;
228 UniqueArray<Integer> m_patches_to_delete;
229 Int32 m_index_new_patches;
230 UniqueArray<Integer> m_available_group_index;
231 Integer m_size_of_overlap_layer_top_level;
232 Int32 m_higher_level;
233 Int32 m_target_nb_levels;
234 Int32 m_latest_call_level;
235 Ref<Properties> m_properties;
236};
237
238/*---------------------------------------------------------------------------*/
239/*---------------------------------------------------------------------------*/
240
241} // End namespace Arcane
242
243/*---------------------------------------------------------------------------*/
244/*---------------------------------------------------------------------------*/
245
246#endif
Classe permettant de définir la position d'un patch dans le maillage cartésien.
Classe permettant de définir une zone d'un maillage.
Informations par direction pour chaque genre d'entité du maillage.
void updateLevelsAndAddGroundPatch()
Méthode permettant de remonter tous les patchs d'un niveau, de mettre à jour le niveau ground et de c...
void addPatch(ConstArrayView< Int32 > cells_local_id)
Méthode permettant de créer un patch contenant les mailles données en paramètre.
CellGroup overlapCells(Integer index)
Méthode permettant de récupérer le groupe des mailles de recouvrement du patch demandé.
CellGroup allCells(Integer index)
Méthode permettant de récupérer le groupe de toutes les mailles du patch demandé.
void removeCellsInZone(const AMRZonePosition &zone_to_delete)
Méthode permettant de supprimer une zone de mailles.
void removePatch(Integer index)
Méthode permettant de supprimer un patch.
void applyPatchEdit(bool remove_empty_patches, bool update_higher_level)
Méthode permettant de supprimer les patchs en attente de suppression.
void clear()
Méthode permettant de supprimer tous les patchs. Attention, les mailles des patchs ne seront pas supp...
Ref< CartesianMeshPatch > groundPatch()
Méthode permettant de récupérer le patch de niveau 0.
void removeCellsInAllPatches(ConstArrayView< Int32 > cells_local_id)
Méthode permettant de supprimer des mailles de tous les patchs.
CellGroup inPatchCells(Integer index)
Méthode permettant de récupérer le groupe des mailles du patch demandé.
Vue constante d'un tableau de type T.
Interface d'un maillage cartésien.
Référence à une instance.
TraceAccessor(ITraceMng *m)
Construit un accesseur via le gestionnaire de trace m.
Vecteur 1D de données avec sémantique par valeur (style STL).
ItemGroupT< Cell > CellGroup
Groupe de mailles.
Definition ItemTypes.h:183
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
Int32 Integer
Type représentant un entier.
std::int32_t Int32
Type entier signé sur 32 bits.