Arcane  4.1.12.0
Developer 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>

Collaboration diagram for Arcane::CellDirectionMng:

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)
 Internal usage in Arcane. Calculates internal and external entities. Assumes init() has been called.
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)

Private Types

using Int8 = std::int8_t
using ItemDirectionInfo = impl::CartesianItemDirectionInfo

Private Member Functions

DirCell _cell (Int32 local_id) const
 Directional cell corresponding to local cell number local_id.
__host__ __device__ DirCellLocalId _dirCellId (Int32 local_id) const
 Directional cell corresponding to local cell number local_id.
void setNodesIndirection (ConstArrayView< Int8 > nodes_indirection)

Private Attributes

friend CartesianMeshImpl
friend CartesianMeshPatch
SmallSpan< ItemDirectionInfo > m_infos_view
CellInfoListView m_cells
eMeshDirection m_direction
Int32 m_next_face_index
Int32 m_previous_face_index
Int8 m_nodes_indirection [MAX_NB_NODE]
Implm_p = nullptr
IndexedCellNodeConnectivityView m_cell_node_view
IndexedCellFaceConnectivityView m_cell_face_view

Static Private Attributes

static const int MAX_NB_NODE = 8

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.

Member Typedef Documentation

◆ Int8

using Arcane::CellDirectionMng::Int8 = std::int8_t
private

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

◆ ItemDirectionInfo

using Arcane::CellDirectionMng::ItemDirectionInfo = impl::CartesianItemDirectionInfo
private

Definition at line 373 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

◆ _cell()

DirCell Arcane::CellDirectionMng::_cell ( Int32 local_id) const
inlineprivate

Directional cell corresponding to local cell number local_id.

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

References Arcane::impl::CartesianItemDirectionInfo::m_next_lid, and Arcane::impl::CartesianItemDirectionInfo::m_previous_lid.

Referenced by cell(), cell(), dirCell(), operator[](), operator[](), and operator[]().

Here is the caller graph for this function:

◆ _dirCellId()

__host__ __device__ DirCellLocalId Arcane::CellDirectionMng::_dirCellId ( Int32 local_id) const
inlineprivate

Directional cell corresponding to local cell number local_id.

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

References Arcane::impl::CartesianItemDirectionInfo::m_next_lid, and Arcane::impl::CartesianItemDirectionInfo::m_previous_lid.

Referenced by dirCellId().

Here is the caller graph for this function:

◆ _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

Internal usage in Arcane. Calculates internal and external entities. Assumes init() has been called.

Definition at line 110 of file CellDirectionMng.cc.

References Arcane::Array< T >::add(), Arcane::IItemFamily::createGroup(), ENUMERATE_ITEM, and Arcane::ItemGroup::itemFamily().

Here is the call graph for this function:

◆ _internalDestroy()

void Arcane::CellDirectionMng::_internalDestroy ( )
protected

Destroys resources associated with the instance.

Definition at line 90 of file CellDirectionMng.cc.

◆ _internalInit()

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

Initializes the instance.

Definition at line 76 of file CellDirectionMng.cc.

References ARCANE_FATAL.

◆ _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.

◆ _internalSetLocalFaceIndex()

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

Positions the local face indices to the next and previous cell.

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.

Referenced by Arcane::FaceDirectionMng::_computeCellInfos(), Arcane::NodeDirectionMng::_computeNodeCellInfos(), Arcane::FaceDirectionMng::_internalComputeInfos(), Arcane::FaceDirectionMng::_internalComputeInfos(), Arcane::NodeDirectionMng::_internalComputeInfos(), and Arcane::CartesianMeshPatch::checkValid().

Here is the caller graph for this function:

◆ 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 _cell(), and Arcane::Item::localId().

Referenced by Arcane::CartesianMeshPatch::checkValid().

Here is the call graph for this function:
Here is the caller graph for this function:

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

References _cell().

Here is the call graph for this function:

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

Referenced by Arcane::FaceDirectionMng::_internalComputeInfos(), Arcane::FaceDirectionMng::_internalComputeInfos(), and Arcane::CartesianMeshPatch::checkValid().

Here is the caller graph for this function:

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

Referenced by Arcane::NodeDirectionMng::_internalComputeInfos().

Here is the caller graph for this function:

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

References _cell().

Here is the call graph for this function:

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

References _dirCellId().

Here is the call graph for this function:

◆ 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::CartesianMeshCoarsening2::_createCoarseCells2D(), Arcane::CartesianMeshCoarsening2::_createCoarseCells3D(), and Arcane::CartesianMeshCoarsening::createCoarseCells().

Here is the caller graph for this function:

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

Referenced by Arcane::FaceDirectionMng::_internalComputeInfos().

Here is the caller graph for this function:

◆ 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 _cell(), and Arcane::Item::localId().

Here is the call graph for this function:

◆ 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 _cell(), and Arcane::ItemEnumeratorBase::itemLocalId().

Here is the call graph for this function:

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

References _cell().

Here is the call graph for this function:

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

Referenced by Arcane::FaceDirectionMng::_internalComputeInfos().

Here is the caller graph for this function:

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

Here is the caller graph for this function:

◆ setNodesIndirection()

void Arcane::CellDirectionMng::setNodesIndirection ( ConstArrayView< Int8 > nodes_indirection)
private

Definition at line 228 of file CellDirectionMng.cc.

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

Member Data Documentation

◆ CartesianMeshImpl

friend Arcane::CellDirectionMng::CartesianMeshImpl
private

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

◆ CartesianMeshPatch

friend Arcane::CellDirectionMng::CartesianMeshPatch
private

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

◆ m_cell_face_view

IndexedCellFaceConnectivityView Arcane::CellDirectionMng::m_cell_face_view
private

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

◆ m_cell_node_view

IndexedCellNodeConnectivityView Arcane::CellDirectionMng::m_cell_node_view
private

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

◆ m_cells

CellInfoListView Arcane::CellDirectionMng::m_cells
private

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

◆ m_direction

eMeshDirection Arcane::CellDirectionMng::m_direction
private

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

◆ m_infos_view

SmallSpan<ItemDirectionInfo> Arcane::CellDirectionMng::m_infos_view
private

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

◆ m_next_face_index

Int32 Arcane::CellDirectionMng::m_next_face_index
private

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

◆ m_nodes_indirection

Int8 Arcane::CellDirectionMng::m_nodes_indirection[MAX_NB_NODE]
private

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

◆ m_p

Impl* Arcane::CellDirectionMng::m_p = nullptr
private

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

◆ m_previous_face_index

Int32 Arcane::CellDirectionMng::m_previous_face_index
private

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

◆ MAX_NB_NODE

const int Arcane::CellDirectionMng::MAX_NB_NODE = 8
staticprivate

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


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