Arcane  v4.1.2.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-2025 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-2025 */
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 "arcane/cartesianmesh/CartesianMeshGlobal.h"
18
19#include "arcane/core/ItemGroup.h"
20
21#include "arcane/utils/UniqueArray.h"
22#include "arcane/utils/Ref.h"
23
24#include "arcane/cartesianmesh/CartesianMeshPatchListView.h"
25
26/*---------------------------------------------------------------------------*/
27/*---------------------------------------------------------------------------*/
28
29namespace Arcane
30{
31
32/*---------------------------------------------------------------------------*/
33/*---------------------------------------------------------------------------*/
34
36
37/*---------------------------------------------------------------------------*/
38/*---------------------------------------------------------------------------*/
39
40class ARCANE_CARTESIANMESH_EXPORT CartesianPatchGroup
41{
42 public:
43
44 explicit CartesianPatchGroup(ICartesianMesh* cmesh);
45
46 public:
47
48 void build();
49 void saveInfosInProperties();
50 void recreateFromDump();
51
52 Ref<CartesianMeshPatch> groundPatch();
53
54 void addPatch(ConstArrayView<Int32> cells_local_id);
55 Integer addPatchAfterRestore(CellGroup cell_group);
56 void addPatch(CellGroup cell_group, Integer group_index);
57
58 void addPatch(const AMRZonePosition& zone_position);
59
60 Integer nbPatch() const;
61
62 Ref<CartesianMeshPatch> patch(Integer index) const;
63
64 CartesianMeshPatchListView patchListView() const;
65
66 CellGroup allCells(Integer index);
67 CellGroup inPatchCells(Integer index);
68 CellGroup overallCells(Integer index);
69
70 void clear();
71
72 void removePatch(Integer index);
73
74 void removeCellsInAllPatches(ConstArrayView<Int32> cells_local_id);
75
76 void removeCellsInZone(const AMRZonePosition& zone_to_delete);
77
78 void applyPatchEdit(bool remove_empty_patches);
79
80 void updateLevelsAndAddGroundPatch();
81
82 void mergePatches();
83
84 void refine(bool clear_refine_flag);
85
86 void clearRefineRelatedFlags() const;
87
88 void rebuildAvailableGroupIndex(ConstArrayView<Integer> available_group_index);
89
90 ConstArrayView<Int32> availableGroupIndex();
91
92 void setOverlapLayerSizeTopLevel(Integer size_of_overlap_layer_top_level);
93 Integer overlapLayerSize(Integer level);
94
95 private:
96
97 void _removeCellsInAllPatches(const AMRPatchPosition& zone_to_delete);
98
99 Integer _nextIndexForNewPatch();
100
101 void _addPatchInstance(Ref<CartesianMeshPatch> v);
102
103 void _removeOnePatch(Integer index);
104 void _removeMultiplePatches(ConstArrayView<Integer> indexes);
105 void _removeAllPatches();
106 void _createGroundPatch();
107
108 void _addCellGroup(CellGroup cell_group, CartesianMeshPatch* patch);
109
110 void _splitPatch(Integer index_patch, const AMRPatchPosition& patch_position);
111 void _addCutPatch(const AMRPatchPosition& new_patch_position, CellGroup parent_patch_cell_group);
112 void _addPatch(const AMRPatchPosition& new_patch_position);
113
114 private:
115
116 UniqueArray<CellGroup> m_amr_patch_cell_groups_all;
117 UniqueArray<CellGroup> m_amr_patch_cell_groups_inpatch;
118 UniqueArray<CellGroup> m_amr_patch_cell_groups_overall;
119 UniqueArray<ICartesianMeshPatch*> m_amr_patches_pointer;
121 ICartesianMesh* m_cmesh;
122 UniqueArray<Integer> m_patches_to_delete;
123 Int32 m_index_new_patches;
124 UniqueArray<Integer> m_available_group_index;
125 Integer m_size_of_overlap_layer_sub_top_level;
126 Integer m_higher_level;
127 Ref<Properties> m_properties;
128};
129
130/*---------------------------------------------------------------------------*/
131/*---------------------------------------------------------------------------*/
132
133} // End namespace Arcane
134
135/*---------------------------------------------------------------------------*/
136/*---------------------------------------------------------------------------*/
137
138#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.
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.