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);
124 auto amr_type = m_cmesh->mesh()->meshKind().meshAMRKind();
126 ARCANE_FATAL(
"Method available only with AMR PatchCartesianMeshOnly");
128 m_cmesh->_internalApi()->cartesianPatchGroup().refine(
true);
137 m_cmesh->_internalApi()->cartesianPatchGroup().clearRefineRelatedFlags();
143void CartesianMeshAMRMng::
144enableOverlapLayer(
bool enable)
const
146 auto amr_type = m_cmesh->
mesh()->
meshKind().meshAMRKind();
160 return m_cmesh->reduceNbGhostLayers(level, target_nb_ghost_layers);
169 auto amr_type = m_cmesh->mesh()->meshKind().meshAMRKind();
174 m_cmesh->_internalApi()->cartesianPatchGroup().mergePatches();
175 m_cmesh->_internalApi()->cartesianPatchGroup().applyPatchEdit(
false);
184 auto amr_type = m_cmesh->mesh()->meshKind().meshAMRKind();
187 coarser->createCoarseCells();
190 m_cmesh->_internalApi()->cartesianMeshAMRPatchMng()->createSubLevel();
193 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 coarseZone(const AMRZonePosition &position) const
Dé-raffine un bloc du maillage cartésien.
CartesianMeshPatchListView patches() const
Vue sur la liste des patchs.
void adaptMesh() const
Méthode permettant d'adapter le raffinement du maillage selon les mailles à raffiner.
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.
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...
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 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.
virtual CartesianPatchGroup & cartesianPatchGroup()=0
Méthode permettant de récupérer le CartesianPatchGroup.
Interface d'un maillage cartésien.
virtual IMesh * mesh() const =0
Maillage associé à ce maillage cartésien.
virtual ICartesianMeshInternal * _internalApi()=0
API interne à Arcane.
virtual void computeDirections()=0
Calcule les infos pour les accès par direction.
virtual const MeshKind meshKind() const =0
Caractéristiques du maillage.
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.