Arcane  4.1.12.0
Developer documentation
Loading...
Searching...
No Matches
CartesianMeshAMRMng.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/* CartesianMeshAMRMng.h (C) 2000-2026 */
9/* */
10/* AMR Manager for a Cartesian Mesh. */
11/*---------------------------------------------------------------------------*/
12/*---------------------------------------------------------------------------*/
13
14#ifndef ARCANE_CARTESIANMESH_CARTESIANMESHAMRMNG_H
15#define ARCANE_CARTESIANMESH_CARTESIANMESHAMRMNG_H
16
17/*---------------------------------------------------------------------------*/
18/*---------------------------------------------------------------------------*/
19
21
22#include "arcane/cartesianmesh/CartesianMeshGlobal.h"
23
24/*---------------------------------------------------------------------------*/
25/*---------------------------------------------------------------------------*/
26
27namespace Arcane
28{
29
30/*---------------------------------------------------------------------------*/
31/*---------------------------------------------------------------------------*/
32
40class ARCANE_CARTESIANMESH_EXPORT CartesianMeshAMRMng
41{
42 public:
43
47 explicit CartesianMeshAMRMng(ICartesianMesh* cmesh);
48
49 public:
50
56 Int32 nbPatch() const;
57
65 CartesianPatch amrPatch(Int32 index) const;
66
71
84 void refineZone(const AMRZonePosition& position) const;
85
104 void coarseZone(const AMRZonePosition& position) const;
105
169 void beginAdaptMesh(Int32 max_nb_levels, Int32 level_to_refine_first);
170
224 void adaptLevel(Int32 level_to_adapt, bool do_fatal_if_useless = false) const;
225
244 void endAdaptMesh();
245
258 void clearRefineRelatedFlags() const;
259
271 void setOverlapLayerSizeTopLevel(Int32 new_size) const;
272
283 void disableOverlapLayer();
284
301 Integer reduceNbGhostLayers(Integer level, Integer target_nb_ghost_layers) const;
302
312 void mergePatches() const;
313
327 void createSubLevel() const;
328
329 private:
330
331 ICartesianMesh* m_cmesh;
332};
333
334/*---------------------------------------------------------------------------*/
335/*---------------------------------------------------------------------------*/
336
337} // End namespace Arcane
338
339/*---------------------------------------------------------------------------*/
340/*---------------------------------------------------------------------------*/
341
342#endif
Declarations of types on entities.
Class allowing the definition of a mesh zone.
void setOverlapLayerSizeTopLevel(Int32 new_size) const
Method to modify the number of overlap cell layers on the highest refinement level.
void coarseZone(const AMRZonePosition &position) const
Coarsens a block of the Cartesian mesh.
CartesianMeshPatchListView patches() const
View of the list of patches.
void mergePatches() const
Method to merge patches that can be merged.
void clearRefineRelatedFlags() const
Method to delete flags related to mesh refinement for all cells.
CartesianMeshAMRMng(ICartesianMesh *cmesh)
Constructor.
Int32 nbPatch() const
Number of mesh patches.
void endAdaptMesh()
Method to finish mesh refinement.
void disableOverlapLayer()
Method to disable overlap cell layers (and destroy them if present).
Integer reduceNbGhostLayers(Integer level, Integer target_nb_ghost_layers) const
Method to delete one or more layers of ghost cells on a defined refinement level.
void adaptLevel(Int32 level_to_adapt, bool do_fatal_if_useless=false) const
Method to create a level of mesh refinement.
void beginAdaptMesh(Int32 max_nb_levels, Int32 level_to_refine_first)
Method to start mesh refinement.
CartesianPatch amrPatch(Int32 index) const
Returns the index-th patch of the mesh.
void refineZone(const AMRZonePosition &position) const
Refines a block of the Cartesian mesh.
void createSubLevel() const
Method to create a sub-level ("level -1").
AMR Patch of a Cartesian mesh.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
Int32 Integer
Type representing an integer.
std::int32_t Int32
Signed integer type of 32 bits.