Arcane  4.1.12.0
User documentation
Loading...
Searching...
No Matches
Arcane::CellDirectionMng Class Reference

Info about the cells in a specific X, Y, or Z direction of a structured mesh. More...

#include <arcane/cartesianmesh/CellDirectionMng.h>

Classes

class  Impl

Public Member Functions

 CellDirectionMng ()
 Creates an empty instance.
DirCell cell (Cell c) const
 Directional cell corresponding to cell c.
DirCell cell (CellLocalId c) const
 Directional cell corresponding to cell c.
DirCell dirCell (CellLocalId c) const
 Directional cell corresponding to cell c.
__host__ __device__ DirCellLocalId dirCellId (CellLocalId c) const
 Directional cell corresponding to cell c.
DirCellNode cellNode (Cell c) const
 cell with directional info at nodes corresponding to cell c.
DirCellNode cellNode (CellLocalId c) const
 cell with directional info at nodes corresponding to cell c.
DirCellNode dirCellNode (CellLocalId c) const
 cell with directional info at nodes corresponding to cell c.
__host__ __device__ DirCellNodeLocalId dirCellNodeId (CellLocalId c) const
 cell with directional info at nodes corresponding to cell c.
DirCellFace cellFace (Cell c) const
 cell with directional info at faces corresponding to cell c.
DirCellFace cellFace (CellLocalId c) const
 cell with directional info at faces corresponding to cell c.
__host__ __device__ DirCellFaceLocalId dirCellFaceId (CellLocalId c) const
 cell with directional info at faces corresponding to cell c.
CellGroup allCells () const
 Group of all cells in the direction.
CellGroup overlapCells () const
 Group of all overlap cells in the direction.
CellGroup inPatchCells () const
 Group of all patch cells in the direction.
CellGroup innerCells () const
 Group of all inner cells in the direction.
CellGroup outerCells () const
 Group of all outer cells in the direction.
DirCell operator[] (Cell c) const
 Directional cell corresponding to cell c.
DirCell operator[] (CellLocalId c) const
 Directional cell corresponding to cell c.
DirCell operator[] (CellEnumerator icell) const
 Directional cell corresponding to the iterator of cell icell.
Int64 globalNbCell () const
 Global number of cells in this direction.
Int32 ownNbCell () const
 Number of own cells in this direction.
Int32 subDomainOffset () const
 Offset of the subdomain in this direction.
Int64 ownCellOffset () const
 Offset of the first own cell of this subdomain in this direction.
eMeshDirection direction () const
 Direction value.

Protected Member Functions

void _internalComputeInnerAndOuterItems (const ItemGroup &items)
void _internalComputeCellGroups (const CellGroup &all_cells, const CellGroup &in_patch_cells, const CellGroup &overlap_cells)
void _internalInit (ICartesianMesh *cm, eMeshDirection dir, Integer patch_index)
void _internalDestroy ()
void _internalSetLocalFaceIndex (Int32 next_index, Int32 previous_index)
void _internalResizeInfos (Int32 new_size)
 Resizes the container holding the ItemDirectionInfo.
void _internalSetOffsetAndNbCellInfos (Int64 global_nb_cell, Int32 own_nb_cell, Int32 sub_domain_offset, Int64 own_cell_offset)

Detailed Description

Info about the cells in a specific X, Y, or Z direction of a structured mesh.

This class contains the information needed to return the list of cells in a given direction and to know the cell before and after within that direction.

Instances of this class are managed by an ICartesianMesh and are temporary. They should not be kept from one iteration to the next because they are invalidated if the mesh changes.

This class has a reference semantics.

For example, to iterate over the cells in the X direction:

ICartesianMesh* cartesian_mesh = ...;
CellDirectionMng cdm(cartesian_mesh->cellDirection(MD_DirX));
ENUMERATE_CELL(icell,cdm.allCells()){
DirCell dir_cell(cdm[icell]);
Cell next = dir_cell.next();
Cell prev = dir_cell.previous();
}
#define ENUMERATE_CELL(name, group)
Generic enumerator for a cell group.
CellDirectionMng()
Creates an empty instance.
Cell of a mesh.
Definition Item.h:1300
Cell before and after a cell along a direction.
virtual CellDirectionMng cellDirection(eMeshDirection dir)=0
List of cells in direction dir.
@ MD_DirX
X Direction.

Definition at line 363 of file src/arcane/cartesianmesh/CellDirectionMng.h.

Constructor & Destructor Documentation

◆ CellDirectionMng()

Arcane::CellDirectionMng::CellDirectionMng ( )

Creates an empty instance.

The instance is not valid until _internalInit() has been called.

Definition at line 63 of file CellDirectionMng.cc.

References Arcane::MD_DirInvalid.

Member Function Documentation

◆ _internalComputeCellGroups()

void Arcane::CellDirectionMng::_internalComputeCellGroups ( const CellGroup & all_cells,
const CellGroup & in_patch_cells,
const CellGroup & overlap_cells )
protected

Definition at line 143 of file CellDirectionMng.cc.

◆ _internalComputeInnerAndOuterItems()

void Arcane::CellDirectionMng::_internalComputeInnerAndOuterItems ( const ItemGroup & items)
protected

Definition at line 110 of file CellDirectionMng.cc.

◆ _internalDestroy()

void Arcane::CellDirectionMng::_internalDestroy ( )
protected

Definition at line 90 of file CellDirectionMng.cc.

◆ _internalInit()

void Arcane::CellDirectionMng::_internalInit ( ICartesianMesh * cm,
eMeshDirection dir,
Integer patch_index )
protected

Definition at line 76 of file CellDirectionMng.cc.

◆ _internalResizeInfos()

void Arcane::CellDirectionMng::_internalResizeInfos ( Int32 new_size)
protected

Resizes the container holding the ItemDirectionInfo.

This invalidates current instances of CellDirectionMng.

Definition at line 100 of file CellDirectionMng.cc.

References Arccore::Array< T >::resize().

◆ _internalSetLocalFaceIndex()

void Arcane::CellDirectionMng::_internalSetLocalFaceIndex ( Int32 next_index,
Int32 previous_index )
inlineprotected

Definition at line 615 of file src/arcane/cartesianmesh/CellDirectionMng.h.

◆ _internalSetOffsetAndNbCellInfos()

void Arcane::CellDirectionMng::_internalSetOffsetAndNbCellInfos ( Int64 global_nb_cell,
Int32 own_nb_cell,
Int32 sub_domain_offset,
Int64 own_cell_offset )
protected

Definition at line 281 of file CellDirectionMng.cc.

◆ allCells()

CellGroup Arcane::CellDirectionMng::allCells ( ) const

Group of all cells in the direction.

Definition at line 183 of file CellDirectionMng.cc.

◆ cell() [1/2]

DirCell Arcane::CellDirectionMng::cell ( Cell c) const
inline

Directional cell corresponding to cell c.

Definition at line 387 of file src/arcane/cartesianmesh/CellDirectionMng.h.

References Arcane::Item::localId().

◆ cell() [2/2]

DirCell Arcane::CellDirectionMng::cell ( CellLocalId c) const
inline

Directional cell corresponding to cell c.

Definition at line 392 of file src/arcane/cartesianmesh/CellDirectionMng.h.

◆ cellFace() [1/2]

DirCellFace Arcane::CellDirectionMng::cellFace ( Cell c) const
inline

cell with directional info at faces corresponding to cell c.

Definition at line 432 of file src/arcane/cartesianmesh/CellDirectionMng.h.

◆ cellFace() [2/2]

DirCellFace Arcane::CellDirectionMng::cellFace ( CellLocalId c) const
inline

cell with directional info at faces corresponding to cell c.

Definition at line 437 of file src/arcane/cartesianmesh/CellDirectionMng.h.

◆ cellNode() [1/2]

DirCellNode Arcane::CellDirectionMng::cellNode ( Cell c) const
inline

cell with directional info at nodes corresponding to cell c.

Definition at line 408 of file src/arcane/cartesianmesh/CellDirectionMng.h.

◆ cellNode() [2/2]

DirCellNode Arcane::CellDirectionMng::cellNode ( CellLocalId c) const
inline

cell with directional info at nodes corresponding to cell c.

Definition at line 414 of file src/arcane/cartesianmesh/CellDirectionMng.h.

◆ dirCell()

DirCell Arcane::CellDirectionMng::dirCell ( CellLocalId c) const
inline

Directional cell corresponding to cell c.

Definition at line 397 of file src/arcane/cartesianmesh/CellDirectionMng.h.

◆ dirCellFaceId()

__host__ __device__ DirCellFaceLocalId Arcane::CellDirectionMng::dirCellFaceId ( CellLocalId c) const
inline

cell with directional info at faces corresponding to cell c.

Definition at line 443 of file src/arcane/cartesianmesh/CellDirectionMng.h.

◆ dirCellId()

__host__ __device__ DirCellLocalId Arcane::CellDirectionMng::dirCellId ( CellLocalId c) const
inline

Directional cell corresponding to cell c.

Definition at line 402 of file src/arcane/cartesianmesh/CellDirectionMng.h.

◆ dirCellNode()

DirCellNode Arcane::CellDirectionMng::dirCellNode ( CellLocalId c) const
inline

cell with directional info at nodes corresponding to cell c.

Definition at line 420 of file src/arcane/cartesianmesh/CellDirectionMng.h.

◆ dirCellNodeId()

__host__ __device__ DirCellNodeLocalId Arcane::CellDirectionMng::dirCellNodeId ( CellLocalId c) const
inline

cell with directional info at nodes corresponding to cell c.

Definition at line 426 of file src/arcane/cartesianmesh/CellDirectionMng.h.

◆ direction()

eMeshDirection Arcane::CellDirectionMng::direction ( ) const
inline

Direction value.

Definition at line 634 of file src/arcane/cartesianmesh/CellDirectionMng.h.

◆ globalNbCell()

Int64 Arcane::CellDirectionMng::globalNbCell ( ) const

Global number of cells in this direction.

Note
The returned value is only valid if the mesh was created with a specific generator, such as the SodMeshGenerator or the CartesianMeshGenerator. Otherwise, the returned value is (-1)

Definition at line 245 of file CellDirectionMng.cc.

Referenced by Arcane::CartesianMeshCoarsening::createCoarseCells().

◆ innerCells()

CellGroup Arcane::CellDirectionMng::innerCells ( ) const

Group of all inner cells in the direction.

A cell is considered inner if its cell before or after is not null and is not an overlap cell.

Definition at line 210 of file CellDirectionMng.cc.

◆ inPatchCells()

CellGroup Arcane::CellDirectionMng::inPatchCells ( ) const

Group of all patch cells in the direction.

Groups all cells that are neither overlap nor ghost. (innerCells() + outerCells() or simply !overlapCells())

Definition at line 201 of file CellDirectionMng.cc.

◆ operator[]() [1/3]

DirCell Arcane::CellDirectionMng::operator[] ( Cell c) const
inline

Directional cell corresponding to cell c.

Definition at line 498 of file src/arcane/cartesianmesh/CellDirectionMng.h.

References Arcane::Item::localId().

◆ operator[]() [2/3]

DirCell Arcane::CellDirectionMng::operator[] ( CellEnumerator icell) const
inline

Directional cell corresponding to the iterator of cell icell.

Definition at line 510 of file src/arcane/cartesianmesh/CellDirectionMng.h.

References Arcane::ItemEnumeratorBase::itemLocalId().

◆ operator[]() [3/3]

DirCell Arcane::CellDirectionMng::operator[] ( CellLocalId c) const
inline

Directional cell corresponding to cell c.

Definition at line 504 of file src/arcane/cartesianmesh/CellDirectionMng.h.

◆ outerCells()

CellGroup Arcane::CellDirectionMng::outerCells ( ) const

Group of all outer cells in the direction.

A cell is considered outer if its cell before or after is an overlap cell or is null (if it is at the edge of the domain or if there are no overlap cell layers).

Definition at line 219 of file CellDirectionMng.cc.

◆ overlapCells()

CellGroup Arcane::CellDirectionMng::overlapCells ( ) const

Group of all overlap cells in the direction.

0 1 2 3 4 ┌───┬──┬──┬──┬──┐ │ │ │ │ │ │ │ ├──┼──┼──┼──┤ │ │ │ │ │ │ └───┴──┴──┴──┴──┘

0 : level -1 1 and 2 : Overlap cells (overlapCells) 3 : Outer cells (outerCells) 4 : Inner cells (innerCells)

The overlap cell layer designates the layer of cells of the same level around the patch. These cells may belong to one or more patches.

Definition at line 192 of file CellDirectionMng.cc.

◆ ownCellOffset()

Int64 Arcane::CellDirectionMng::ownCellOffset ( ) const

Offset of the first own cell of this subdomain in this direction.

Assuming the global Cartesian mesh is divided into several rectangular subdomains that form a grid, this method returns the position of the first own cell of this subdomain in this grid for this direction.

Warning
Using this method assumes that each subdomain is parallelepiped (in 3D) or rectangular (in 2D) which is not necessarily the case, especially with cell migration load balancing mechanisms.
Note
The returned value is only valid if the mesh was created with a specific generator, such as the CartesianMeshGenerator. Otherwise, the returned value is (-1)

Definition at line 272 of file CellDirectionMng.cc.

◆ ownNbCell()

Int32 Arcane::CellDirectionMng::ownNbCell ( ) const

Number of own cells in this direction.

Note
The returned value is only valid if the mesh was created with a specific generator, such as the SodMeshGenerator or the CartesianMeshGenerator. Otherwise, the returned value is (-1)

Definition at line 254 of file CellDirectionMng.cc.

Referenced by Arcane::CartesianMeshCoarsening2::createCoarseCells(), and Arcane::CartesianMeshCoarsening::createCoarseCells().

◆ subDomainOffset()

Int32 Arcane::CellDirectionMng::subDomainOffset ( ) const

Offset of the subdomain in this direction.

Assuming the global Cartesian mesh is divided into several rectangular subdomains that form a grid, this method returns the position of this subdomain in this grid for this direction.

Warning
Using this method assumes that each subdomain is parallelepiped (in 3D) or rectangular (in 2D) which is not necessarily the case, especially with cell migration load balancing mechanisms.
Note
The returned value is only valid if the mesh was created with a specific generator, such as the CartesianMeshGenerator. Otherwise, the returned value is (-1)

Definition at line 263 of file CellDirectionMng.cc.


The documentation for this class was generated from the following files: