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

Conversion of 'Cell' to 'AllEnvCell'. More...

#include <arcane/core/materials/CellToAllEnvCellConverter.h>

Public Member Functions

 CellToAllEnvCellConverter (IMeshMaterialMng *mm)
AllEnvCell operator[] (Cell c)
 Converts a Cell cell to an AllEnvCell cell.
__host__ __device__ AllEnvCell operator[] (CellLocalId c) const
 Converts a CellLocalId cell to an AllEnvCell cell.

Friends

class MeshMaterialMng

Detailed Description

Conversion of 'Cell' to 'AllEnvCell'.

Instances of this class allow converting a cell Cell into an AllEnvCell cell to obtain material information.

An instance is created via the material manager:

IMeshMaterialMng* mm = ...;
CellToAllEnvCellConverter all_env_cell_converter(mm);
Interface for the material and environment manager of a mesh.

The creation cost is low, equivalent to a virtual function call. It is therefore not negligible, and it is preferable not to construct an instance inside loops over entities, for example, but outside them.

Once the instance is created, it is then possible to use the [] operator (operator[]()) to perform the conversion:

CellToAllEnvCellConverter all_env_cell_converter(m_material_mng);
Cell cell = ...;
ENUMERATE_FACE(iface,allFaces()){
Face face = *iface;
Cell back_cell = face.backCell()
AllEnvCell back_all_env_cell = all_env_cell_converter[back_cell];
info() << "nb env=" << back_all_env_cell.nbEnvironment();
}
#define ENUMERATE_FACE(name, group)
Generic enumerator for a face group.
Cell of a mesh.
Definition Item.h:1300
Face of a cell.
Definition Item.h:1032
Cell backCell() const
Cell behind the face (null cell if none).
Definition Item.h:1774
Arcane cell with material and environment information.
__host__ __device__ Int32 nbEnvironment() const
Number of environments present in the cell.
Warning
Instances of this class are invalidated if the list of material or environment cells changes. In this case, the object must be rebuilt:
all_env_cell_converter = CellToAllEnvCellConverter(m_material_mng);

Definition at line 70 of file core/materials/CellToAllEnvCellConverter.h.

Constructor & Destructor Documentation

◆ CellToAllEnvCellConverter()

Arcane::Materials::CellToAllEnvCellConverter::CellToAllEnvCellConverter ( IMeshMaterialMng * mm)
inlineexplicit

Definition at line 76 of file core/materials/CellToAllEnvCellConverter.h.

Member Function Documentation

◆ operator[]() [1/2]

AllEnvCell Arcane::Materials::CellToAllEnvCellConverter::operator[] ( Cell c)
inline

Converts a Cell cell to an AllEnvCell cell.

Definition at line 91 of file core/materials/CellToAllEnvCellConverter.h.

References operator[]().

Referenced by operator[]().

◆ operator[]() [2/2]

__host__ __device__ AllEnvCell Arcane::Materials::CellToAllEnvCellConverter::operator[] ( CellLocalId c) const
inline

Converts a CellLocalId cell to an AllEnvCell cell.

Definition at line 97 of file core/materials/CellToAllEnvCellConverter.h.

◆ MeshMaterialMng

friend class MeshMaterialMng
friend

Definition at line 72 of file core/materials/CellToAllEnvCellConverter.h.


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