Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Notions

This page explains some concepts to understand how AMR works in Arcane.

Patch

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.

Remarks
min and max will have the same values in a multi-subdomain or a mono-subdomain.

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().

Note
A cell can only be in one bounding box (for a given level).

Three sets of cells are accessible for each patch:

Overlap cells

Note
For AMR type 1, there are no overlap cells.

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.

Directions

(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:

using namespace Arcane;
ICartesianMesh* cartesian_mesh = ICartesianMesh::getReference(mesh());
CartesianMeshAMRMng amr_mng(cartesian_mesh);
CartesianPatch patch = amr_mng.amrPatch(1);
ENUMERATE_(Face, iface, face_dm.inPatchFaces()) {
Face face = *iface;
DirFace dir_face(face_dm[iface]);
Cell prev_cell = dir_face.previousCell(); // Maille avant la face
Cell next_cell = dir_face.nextCell(); // Maille après la face
}
#define ENUMERATE_(type, name, group)
Generic enumerator for an entity group.
Class allowing access to the specific AMR methods of the Cartesian mesh.
AMR Patch of a Cartesian mesh.
FaceDirectionMng & faceDirection(eMeshDirection dir)
List of faces in direction dir.
Cell of a mesh.
Definition Item.h:1300
Info on the cell before and after a face along a direction.
Info on the faces of a specific direction X, Y, or Z of a structured mesh.
Face of a cell.
Definition Item.h:1032
static ICartesianMesh * getReference(const MeshHandleOrMesh &mesh, bool create=true)
Retrieves or creates the reference associated with mesh.
-- tab-width: 2; indent-tabs-mode: nil; coding: utf-8-with-signature --
@ MD_DirX
X Direction.

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).