14#include "arcane/cartesianmesh/CartesianMeshAMRMng.h"
16#include "arcane/utils/FatalErrorException.h"
18#include "arcane/core/IMesh.h"
19#include "arcane/core/MeshKind.h"
21#include "arcane/cartesianmesh/ICartesianMesh.h"
22#include "arcane/cartesianmesh/CartesianPatch.h"
23#include "arcane/cartesianmesh/CartesianMeshCoarsening2.h"
24#include "arcane/cartesianmesh/CartesianMeshPatchListView.h"
25#include "arcane/cartesianmesh/CartesianMeshUtils.h"
27#include "arcane/cartesianmesh/internal/ICartesianMeshInternal.h"
28#include "arcane/cartesianmesh/internal/CartesianPatchGroup.h"
50 return m_cmesh->nbPatch();
59 return m_cmesh->amrPatch(index);
68 return m_cmesh->patches();
77 m_cmesh->refinePatch(position);
86 m_cmesh->coarseZone(position);
96 m_cmesh->_internalApi()->cartesianPatchGroup().beginAdaptMesh(max_nb_levels, level_to_refine_first);
105 m_cmesh->_internalApi()->cartesianPatchGroup().adaptLevel(level_to_adapt);
114 m_cmesh->_internalApi()->cartesianPatchGroup().endAdaptMesh();
123 m_cmesh->_internalApi()->cartesianPatchGroup().clearRefineRelatedFlags();
132 auto amr_type = m_cmesh->mesh()->meshKind().meshAMRKind();
136 m_cmesh->_internalApi()->cartesianPatchGroup().setOverlapLayerSizeTopLevel(new_size);
145 auto amr_type = m_cmesh->mesh()->meshKind().meshAMRKind();
149 m_cmesh->_internalApi()->cartesianPatchGroup().setOverlapLayerSizeTopLevel(-1);
158 return m_cmesh->reduceNbGhostLayers(level, target_nb_ghost_layers);
167 auto amr_type = m_cmesh->mesh()->meshKind().meshAMRKind();
172 m_cmesh->_internalApi()->cartesianPatchGroup().mergePatches();
173 m_cmesh->_internalApi()->cartesianPatchGroup().applyPatchEdit(
false);
182 auto amr_type = m_cmesh->mesh()->meshKind().meshAMRKind();
185 coarser->createCoarseCells();
188 m_cmesh->_internalApi()->cartesianMeshAMRPatchMng()->createSubLevel();
191 ARCANE_FATAL(
"General patch AMR is not implemented. Please use PatchCartesianMeshOnly (3)");
#define ARCANE_FATAL(...)
Macro envoyant une exception FatalErrorException.
Classe permettant de définir une zone d'un maillage.
void setOverlapLayerSizeTopLevel(Int32 new_size) const
Méthode permettant de modifier le nombre de couches de mailles de recouvrement sur le niveau de raffi...
void coarseZone(const AMRZonePosition &position) const
Dé-raffine un bloc du maillage cartésien.
CartesianMeshPatchListView patches() const
Vue sur la liste des patchs.
void mergePatches() const
Méthode permettant de fusionner les patchs qui peuvent l'être.
void clearRefineRelatedFlags() const
Méthode permettant de supprimer les flags liés au raffinement de toutes les mailles.
CartesianMeshAMRMng(ICartesianMesh *cmesh)
Constructeur.
Int32 nbPatch() const
Nombre de patchs du maillage.
void endAdaptMesh()
Méthode permettant de terminer le raffinement du maillage.
void disableOverlapLayer()
Méthode permettant de désactiver les couches de mailles de recouvrement (et de les détruire si présen...
Integer reduceNbGhostLayers(Integer level, Integer target_nb_ghost_layers) const
Méthode permettant de supprimer une ou plusieurs couches de mailles fantômes sur un niveau de raffine...
void beginAdaptMesh(Int32 max_nb_levels, Int32 level_to_refine_first)
Méthode permettant de commencer le raffinement du maillage.
CartesianPatch amrPatch(Int32 index) const
Retourne le index-ième patch du maillage.
void refineZone(const AMRZonePosition &position) const
Raffine un bloc du maillage cartésien.
void adaptLevel(Int32 level_to_adapt) const
Méthode permettant de créer un niveau de raffinement du maillage.
void createSubLevel() const
Méthode permettant de créer un sous-niveau ("niveau -1").
Vue sur une liste de patchs.
Patch AMR d'un maillage cartésien.
Interface d'un maillage cartésien.
Référence à une instance.
ARCANE_CARTESIANMESH_EXPORT Ref< CartesianMeshCoarsening2 > createCartesianMeshCoarsening2(ICartesianMesh *cm)
Créé une instance pour gérer le déraffinement du maillage (V2).
-*- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature -*-
Int32 Integer
Type représentant un entier.
@ Patch
Le maillage est AMR par patch.
@ Cell
Le maillage est AMR par maille.
@ PatchCartesianMeshOnly
Le maillage est AMR par patch cartésien (rectangulaire)
std::int32_t Int32
Type entier signé sur 32 bits.