Template Numerical Library version\ main:bb09b17
Loading...
Searching...
No Matches
TNL::Meshes::Mesh< MeshConfig, Device > Class Template Reference
Inheritance diagram for TNL::Meshes::Mesh< MeshConfig, Device >:
Collaboration diagram for TNL::Meshes::Mesh< MeshConfig, Device >:

Public Types

using Cell = EntityType< getMeshDimension() >
 
using Config = MeshConfig
 
using DeviceType = typename MeshTraitsType::DeviceType
 
template<int Dimension>
using EntityTraits = typename MeshTraitsType::template EntityTraits< Dimension >
 
template<int Dimension>
using EntityType = typename EntityTraits< Dimension >::EntityType
 
using Face = EntityType< getMeshDimension() - 1 >
 
using GlobalIndexArray = Containers::Array< GlobalIndexType, DeviceType, GlobalIndexType >
 
using GlobalIndexType = typename MeshTraitsType::GlobalIndexType
 
using LocalIndexType = typename MeshTraitsType::LocalIndexType
 
using MeshTraitsType = MeshTraits< MeshConfig, Device >
 
using PointType = typename MeshTraitsType::PointType
 
using RealType = typename PointType::RealType
 
using Vertex = EntityType< 0 >
 
- Public Types inherited from TNL::Meshes::MeshInitializableBase< MeshConfig, Devices::Host, Mesh< MeshConfig, Devices::Host > >
using MeshTraitsType
 

Public Member Functions

 Mesh (const Mesh &mesh)=default
 
template<typename Device_ >
 Mesh (const Mesh< MeshConfig, Device_ > &mesh)
 
 Mesh (Mesh &&mesh) noexcept=default
 
template<int EntityDimension, typename Device2 = DeviceType, typename Func >
void forAll (Func f) const
 Execute function f in parallel for all mesh entities with dimension EntityDimension.
 
template<int EntityDimension, typename Device2 = DeviceType, typename Func >
void forBoundary (Func f) const
 Execute function f in parallel for all boundary mesh entities with dimension EntityDimension.
 
template<int EntityDimension, typename Device2 = DeviceType, typename Func >
void forGhost (Func f) const
 Execute function f in parallel for all ghost mesh entities with dimension EntityDimension.
 
template<int EntityDimension, typename Device2 = DeviceType, typename Func >
void forInterior (Func f) const
 Execute function f in parallel for all interior mesh entities with dimension EntityDimension.
 
template<int EntityDimension, typename Device2 = DeviceType, typename Func >
void forLocal (Func f) const
 Execute function f in parallel for all local mesh entities with dimension EntityDimension.
 
__cuda_callable__ GlobalIndexType getCellNeighborIndex (GlobalIndexType cellIndex, LocalIndexType neighborIndex) const
 Returns the global index of the cell's specific neighbor cell wigh given local index, based on the information stored in the dual graph.
 
__cuda_callable__ LocalIndexType getCellNeighborsCount (GlobalIndexType cellIndex) const
 Returns the count of neighbor cells of the cell with given index, based on the information stored in the dual graph.
 
template<int Dimension>
__cuda_callable__ GlobalIndexType getEntitiesCount () const
 Returns the count of mesh entities of the given dimension.
 
template<typename EntityType >
__cuda_callable__ GlobalIndexType getEntitiesCount () const
 
template<int Dimension>
__cuda_callable__ EntityType< Dimension > getEntity (GlobalIndexType entityIndex) const
 Returns the mesh entity of the given dimension and index.
 
template<typename EntityType >
__cuda_callable__ EntityType getEntity (GlobalIndexType entityIndex) const
 
template<int Dimension>
__cuda_callable__ Mesh< MeshConfig, Device >::template EntityType< Dimension > getEntity (GlobalIndexType entityIndex) const
 
template<typename Entity >
__cuda_callable__ Entity getEntity (GlobalIndexType entityIndex) const
 
__cuda_callable__ PointType & getPoint (GlobalIndexType vertexIndex)
 Returns the spatial coordinates of the vertex with given index.
 
__cuda_callable__ const PointType & getPoint (GlobalIndexType vertexIndex) const
 
MeshTraitsType::PointArrayType & getPoints ()
 
const MeshTraitsType::PointArrayType & getPoints () const
 Returns the spatial coordinates of the vertex with given index.
 
template<int EntityDimension, int SubentityDimension>
__cuda_callable__ constexpr LocalIndexType getSubentitiesCount (GlobalIndexType entityIndex) const
 Returns the count of subentities of the entity with given index.
 
template<int EntityDimension, int SubentityDimension>
__cuda_callable__ GlobalIndexType getSubentityIndex (GlobalIndexType entityIndex, LocalIndexType subentityIndex) const
 Returns the global index of the subentity specified by its local index.
 
template<int EntityDimension, int SuperentityDimension>
__cuda_callable__ LocalIndexType getSuperentitiesCount (GlobalIndexType entityIndex) const
 Returns the count of superentities of the entity with given index.
 
template<int EntityDimension, int SuperentityDimension>
__cuda_callable__ GlobalIndexType getSuperentityIndex (GlobalIndexType entityIndex, LocalIndexType superentityIndex) const
 Returns the global index of the superentity specified by its local index.
 
bool operator!= (const Mesh &mesh) const
 
Meshoperator= (const Mesh &mesh)=default
 
template<typename Device_ >
Meshoperator= (const Mesh< MeshConfig, Device_ > &mesh)
 
template<typename Device_ >
Mesh< MeshConfig, Device > & operator= (const Mesh< MeshConfig, Device_ > &mesh)
 
Meshoperator= (Mesh &&mesh) noexcept(false)=default
 
bool operator== (const Mesh &mesh) const
 
void print (std::ostream &str) const
 
template<int Dimension>
void reorderEntities (const GlobalIndexArray &perm, const GlobalIndexArray &iperm)
 Reorders the entities of the given dimension.
 
template<int Dimension>
void setEntitiesCount (GlobalIndexType entitiesCount)
 
void writeProlog (Logger &logger) const
 
- Public Member Functions inherited from TNL::Meshes::MeshInitializableBase< MeshConfig, Devices::Host, Mesh< MeshConfig, Devices::Host > >
void init (typename MeshTraitsType::PointArrayType &points, typename MeshTraitsType::FaceSeedMatrixType &faceSeeds, typename MeshTraitsType::CellSeedMatrixType &cellSeeds)
 

Static Public Member Functions

static constexpr int getMeshDimension ()
 

Protected Member Functions

template<int EntityDimension, int SubentityDimension>
void setSubentitiesCounts (const typename MeshTraitsType::NeighborCountsArray &counts)
 
template<int EntityDimension, int SubentityDimension>
void setSubentitiesCounts (typename MeshTraitsType::NeighborCountsArray &&counts)
 

Protected Attributes

friend Initializer< MeshConfig >
 
MeshTraitsType::PointArrayType points
 

Member Function Documentation

◆ forAll()

template<typename MeshConfig , typename Device >
template<int EntityDimension, typename Device2 , typename Func >
void TNL::Meshes::Mesh< MeshConfig, Device >::forAll ( Func f) const

Execute function f in parallel for all mesh entities with dimension EntityDimension.

The function f is executed as f(i), where GlobalIndexType i is the global index of the mesh entity to be processed. The mesh itself is not passed to the function f, it is the user's responsibility to ensure proper access to the mesh if needed, e.g. by the means of lambda capture and/or using a SharedPointer.

◆ forBoundary()

template<typename MeshConfig , typename Device >
template<int EntityDimension, typename Device2 , typename Func >
void TNL::Meshes::Mesh< MeshConfig, Device >::forBoundary ( Func f) const

Execute function f in parallel for all boundary mesh entities with dimension EntityDimension.

The function f is executed as f(i), where GlobalIndexType i is the global index of the mesh entity to be processed. The mesh itself is not passed to the function f, it is the user's responsibility to ensure proper access to the mesh if needed, e.g. by the means of lambda capture and/or using a SharedPointer.

◆ forGhost()

template<typename MeshConfig , typename Device >
template<int EntityDimension, typename Device2 , typename Func >
void TNL::Meshes::Mesh< MeshConfig, Device >::forGhost ( Func f) const

Execute function f in parallel for all ghost mesh entities with dimension EntityDimension.

The function f is executed as f(i), where GlobalIndexType i is the global index of the mesh entity to be processed. The mesh itself is not passed to the function f, it is the user's responsibility to ensure proper access to the mesh if needed, e.g. by the means of lambda capture and/or using a SharedPointer.

◆ forInterior()

template<typename MeshConfig , typename Device >
template<int EntityDimension, typename Device2 , typename Func >
void TNL::Meshes::Mesh< MeshConfig, Device >::forInterior ( Func f) const

Execute function f in parallel for all interior mesh entities with dimension EntityDimension.

The function f is executed as f(i), where GlobalIndexType i is the global index of the mesh entity to be processed. The mesh itself is not passed to the function f, it is the user's responsibility to ensure proper access to the mesh if needed, e.g. by the means of lambda capture and/or using a SharedPointer.

◆ forLocal()

template<typename MeshConfig , typename Device >
template<int EntityDimension, typename Device2 , typename Func >
void TNL::Meshes::Mesh< MeshConfig, Device >::forLocal ( Func f) const

Execute function f in parallel for all local mesh entities with dimension EntityDimension.

The function f is executed as f(i), where GlobalIndexType i is the global index of the mesh entity to be processed. The mesh itself is not passed to the function f, it is the user's responsibility to ensure proper access to the mesh if needed, e.g. by the means of lambda capture and/or using a SharedPointer.

◆ getEntity()

template<typename MeshConfig , typename Device = Devices::Host>
template<int Dimension>
__cuda_callable__ EntityType< Dimension > TNL::Meshes::Mesh< MeshConfig, Device >::getEntity ( GlobalIndexType entityIndex) const
nodiscard

Returns the mesh entity of the given dimension and index.

Note that objects representing mesh entities are not stored in the mesh, but created on demand. Since the MeshEntity contains just a pointer to the mesh and the supplied entity index, the creation should be fast.

◆ reorderEntities()

template<typename MeshConfig , typename Device >
template<int Dimension>
void TNL::Meshes::Mesh< MeshConfig, Device >::reorderEntities ( const GlobalIndexArray & perm,
const GlobalIndexArray & iperm )

Reorders the entities of the given dimension.

The permutations follow the definition used in the Metis library: Let M be the original mesh and M' the permuted mesh. Then entity with index i in M' is the entity with index perm[i] in M and entity with index j in M is the entity with index iperm[j] in M'.


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