This page explains some concepts to understand how AMR works in Arcane.
Class Arcane::CartesianPatch.
For AMR type 1, a patch is a set of cells. These cells do not necessarily form a contiguous set. These cells are grouped into a set of cells accessible via the method Arcane::CartesianPatch::cells().
For AMR type 3, a patch is a set of cells of the same level and enclosed within a bounding box (regular patch). This bounding box is described by the topological coordinates of two cells in the Cartesian grid: min and max.
This bounding box is described by the class Arcane::AMRPatchPosition. Each patch contains an instance of this class, accessible via the method Arcane::CartesianPatch::position().
Three sets of cells are accessible for each patch:
Overlap cells refer to the cells around the patches (around the bounding boxes).
(In dotted lines, we have the overlap cells/faces/nodes / 2 layers for level 1)
These cells allow two things. First, they allow obtaining values around the patch items (in solid lines in the image) (like ghost cells for calculating at the subdomain boundary).
(We can see overlap cells covering cells from other patches (II_Overlap && II_InPatch))
Second, they prevent having more than one level of difference between two cells. Indeed, it is not possible to refine a pure overlap cell (II_Overlap && ! II_InPatch).
(2 layers for level 1 / 0 layers for level 2)
It is possible to modify the number of overlap cell layers of the highest level via the method Arcane::CartesianMeshAMRMng::setOverlapLayerSizeTopLevel(Int32 new_size). The number of layers for other levels will be calculated automatically.
It is also possible to disable the creation of these layers with the method Arcane::CartesianMeshAMRMng::disableOverlapLayer(). In this case, there may be more than one level of difference between levels.
(Read the page Using Directional Information before continuing)
Each patch (for both AMR types) has its own directions, for each item.
These directions are accessible via the patches (Arcane::CartesianPatch). The operation is the same as with the cell without AMR.
Two new methods are available to access the InPatch and Overlap item groups:
Example:
In this piece of code, with at least one layer of overlap cells, we are sure that dir_face.previousCell() and dir_face.nextCell() are not null (except at the subdomain boundary).