Arcane  v4.1.3.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
55 Ref<CartesianMeshPatch> groundPatch();
56
57 void addPatch(ConstArrayView<Int32> cells_local_id);
58 Integer addPatchAfterRestore(CellGroup cell_group);
59 void addPatch(CellGroup cell_group, Integer group_index);
60
61 void addPatch(const AMRZonePosition& zone_position);
62
63 Integer nbPatch() const;
64
65 Ref<CartesianMeshPatch> patch(Integer index) const;
66
67 CartesianMeshPatchListView patchListView() const;
68
69 CellGroup allCells(Integer index);
70 CellGroup inPatchCells(Integer index);
71 CellGroup overlapCells(Integer index);
72
73 void clear();
74
75 void removePatch(Integer index);
76
77 void removeCellsInAllPatches(ConstArrayView<Int32> cells_local_id);
78
79 void removeCellsInZone(const AMRZonePosition& zone_to_delete);
80
81 void applyPatchEdit(bool remove_empty_patches);
82
83 void updateLevelsAndAddGroundPatch();
84
85 void mergePatches();
86
87 void beginAdaptMesh(Int32 nb_levels, Int32 level_to_refine_first);
88 void endAdaptMesh();
89 void adaptLevel(Int32 level_to_adapt);
90
91 void clearRefineRelatedFlags() const;
92
93 void rebuildAvailableGroupIndex(ConstArrayView<Integer> available_group_index);
94
95 ConstArrayView<Int32> availableGroupIndex();
96
97 void setOverlapLayerSizeTopLevel(Integer size_of_overlap_layer_top_level);
98 Int32 overlapLayerSize(Int32 level);
99
100 private:
101
102 void _increaseOverlapSizeLevel(Int32 level_to_increate, Int32 new_size);
103 void _reduceOverlapSizeLevel(Int32 level_to_reduce, Int32 new_size);
104
105 void _updateHigherLevel();
106
107 void _changeOverlapSizeLevel(Int32 level, Int32 previous_higher_level, Int32 new_higher_level);
108
109 void _updatePatchFlagsOfCellsLevel(Int32 level, bool use_cell_groups);
110 void _updatePatchFlagsOfCellsGroundLevel();
111
112 void _checkPatchesAndMesh();
113
114 void _removeCellsInAllPatches(const AMRPatchPosition& zone_to_delete);
115
116 Integer _nextIndexForNewPatch();
117
118 void _addPatchInstance(Ref<CartesianMeshPatch> v);
119
120 void _removeOnePatch(Integer index);
121 void _removeMultiplePatches(ConstArrayView<Integer> indexes);
122 void _removeAllPatches();
123 void _createGroundPatch();
124
125 Integer _addCellGroup(CellGroup cell_group, CartesianMeshPatch* patch);
126
127 void _removePartOfPatch(Integer index_patch_to_edit, const AMRPatchPosition& patch_position);
128 void _addCutPatch(const AMRPatchPosition& new_patch_position, CellGroup parent_patch_cell_group);
129 Integer _addPatch(const AMRPatchPosition& new_patch_position);
130
131 private:
132
133 UniqueArray<CellGroup> m_amr_patch_cell_groups_all;
134 UniqueArray<CellGroup> m_amr_patch_cell_groups_inpatch;
135 UniqueArray<CellGroup> m_amr_patch_cell_groups_overlap;
136 UniqueArray<ICartesianMeshPatch*> m_amr_patches_pointer;
138 ICartesianMesh* m_cmesh;
139 UniqueArray<Integer> m_patches_to_delete;
140 Int32 m_index_new_patches;
141 UniqueArray<Integer> m_available_group_index;
142 Integer m_size_of_overlap_layer_top_level;
143 Int32 m_higher_level;
144 Int32 m_target_nb_levels;
145 Int32 m_latest_call_level;
146 Ref<Properties> m_properties;
147};
148
149/*---------------------------------------------------------------------------*/
150/*---------------------------------------------------------------------------*/
151
152} // End namespace Arcane
153
154/*---------------------------------------------------------------------------*/
155/*---------------------------------------------------------------------------*/
156
157#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.
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.