Template Numerical Library version\ main:f17d0c8
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
TNL::Meshes::GridEntity< Grid, EntityDimension > Class Template Reference

Structure describing a grid entity i.e., grid cells, faces, edges, vertexes and so on. More...

#include <TNL/Meshes/GridEntity.h>

Collaboration diagram for TNL::Meshes::GridEntity< Grid, EntityDimension >:
Collaboration graph
[legend]

Public Types

using CoordinatesType = typename Grid::CoordinatesType
 Type of grid entities coordinates.
 
using DeviceType = typename Grid::DeviceType
 Device to be used for execution of operations with the grid.
 
using GridType = Grid
 Type of grid the entity belongs to.
 
using IndexType = typename Grid::IndexType
 Type for indexing of the grid entities.
 
using PointType = typename Grid::PointType
 Type of world coordinates.
 
using RealType = typename Grid::RealType
 Type of floating point numbers.
 

Public Member Functions

__cuda_callable__ GridEntity (const Grid &grid)
 Constructore with a grid reference.
 
__cuda_callable__ GridEntity (const Grid &grid, const CoordinatesType &coordinates)
 Constructor with a grid reference and grid entity coordinates.
 
__cuda_callable__ GridEntity (const Grid &grid, const CoordinatesType &coordinates, const CoordinatesType &normals)
 Constructor with a grid reference, grid entity coordinates and entity normals.
 
__cuda_callable__ GridEntity (const Grid &grid, const CoordinatesType &coordinates, const CoordinatesType &normals, IndexType orientation)
 Constructor with a grid reference, grid entity coordinates, entity normals and index of entity orientation.
 
__cuda_callable__ GridEntity (const Grid &grid, IndexType entityIdx)
 Constructor with a grid reference and grid entity index.
 
__cuda_callable__ CoordinatesType getBasis () const
 Getter of the basis vector.
 
__cuda_callable__ PointType getCenter () const
 Returns the center of the grid entity.
 
__cuda_callable__ CoordinatesTypegetCoordinates ()
 Getter of the grid entity coordinates for non-constant instances.
 
__cuda_callable__ const CoordinatesTypegetCoordinates () const
 Getter of the grid entity coordinates for constant instances.
 
__cuda_callable__ const GridgetGrid () const
 Returns a reference on the grid the grid entity belongs to.
 
__cuda_callable__ IndexType getIndex () const
 Get the entity index in the grid.
 
__cuda_callable__ RealType getMeasure () const
 Returns the measure (length, surface or volume) of the grid entity.
 
__cuda_callable__ const GridgetMesh () const
 Returns reference to the grid the grid entity belongs to.
 
template<int Dimension>
__cuda_callable__ GridEntity< Grid, Dimension > getNeighbourEntity (const CoordinatesType &offset) const
 Returns the neighbour grid entity.
 
template<int Dimension, int Orientation>
__cuda_callable__ GridEntity< Grid, Dimension > getNeighbourEntity (const CoordinatesType &offset) const
 Returns the neighbour grid entity.
 
__cuda_callable__ const CoordinatesTypegetNormals () const
 Returns the packed normals vector of the grid entity.
 
__cuda_callable__ IndexType getOrientation () const
 Returns index of the entity orientation.
 
PointType getPoint () const
 Returns the point at the origin of the grid entity.
 
__cuda_callable__ bool isBoundary () const
 Tells, if the entity is boundary entity.
 
__cuda_callable__ void refresh ()
 
__cuda_callable__ void setCoordinates (const CoordinatesType &coordinates)
 Setter of the grid entity coordinates.
 
__cuda_callable__ void setNormals (const CoordinatesType &normals)
 Setter for the packed normals vector of the grid entity.
 
__cuda_callable__ void setOrientation (IndexType orientation)
 Setter of the grid entity orientation index.
 

Static Public Member Functions

static constexpr int getEntityDimension ()
 Getter of the dimensions of the grid entity.
 
static constexpr int getMeshDimension ()
 Getter of the dimension of the grid.
 

Protected Attributes

CoordinatesType coordinates
 
const Gridgrid
 
IndexType index
 
CoordinatesType normals
 
IndexType orientation
 

Detailed Description

template<class Grid, int EntityDimension>
class TNL::Meshes::GridEntity< Grid, EntityDimension >

Structure describing a grid entity i.e., grid cells, faces, edges, vertexes and so on.

Template Parameters
Gridis a typa of grid the entity belongs to.
EntityDimensionis a dimensions of the grid entity.

Constructor & Destructor Documentation

◆ GridEntity() [1/5]

template<class Grid , int EntityDimension>
__cuda_callable__ TNL::Meshes::GridEntity< Grid, EntityDimension >::GridEntity ( const Grid & grid)

Constructore with a grid reference.

Parameters
gridis a reference on a grid the entity belongs to.

◆ GridEntity() [2/5]

template<class Grid , int EntityDimension>
__cuda_callable__ TNL::Meshes::GridEntity< Grid, EntityDimension >::GridEntity ( const Grid & grid,
const CoordinatesType & coordinates )

Constructor with a grid reference and grid entity coordinates.

Parameters
gridis a reference on a grid the entity belongs to.
coordinatesare coordinates of the grid entity.

◆ GridEntity() [3/5]

template<class Grid , int EntityDimension>
__cuda_callable__ TNL::Meshes::GridEntity< Grid, EntityDimension >::GridEntity ( const Grid & grid,
const CoordinatesType & coordinates,
const CoordinatesType & normals )

Constructor with a grid reference, grid entity coordinates and entity normals.

Entity normals define the grid entity orientation.

Parameters
gridis a reference on a grid the entity belongs to.
coordinatesare coordinates of the grid entity.
normalsis a vector of packed normal vectors to the grid entity.

◆ GridEntity() [4/5]

template<class Grid , int EntityDimension>
__cuda_callable__ TNL::Meshes::GridEntity< Grid, EntityDimension >::GridEntity ( const Grid & grid,
const CoordinatesType & coordinates,
const CoordinatesType & normals,
IndexType orientation )

Constructor with a grid reference, grid entity coordinates, entity normals and index of entity orientation.

Entity normals define the grid entity orientation. Index of entity orientation is rather internal information. Constructor without this parameter may be used preferably. The index can be computed using the method TNL::Meshes::Grid::getOrientation.

Parameters
gridis a reference on a grid the entity belongs to.
coordinatesare coordinates of the grid entity.
normalsis a vector of packed normal vectors to the grid entity.
orientationis an index of the grid entity orientation.

◆ GridEntity() [5/5]

template<class Grid , int EntityDimension>
__cuda_callable__ TNL::Meshes::GridEntity< Grid, EntityDimension >::GridEntity ( const Grid & grid,
IndexType entityIdx )

Constructor with a grid reference and grid entity index.

Parameters
gridis a reference on a grid the entity belongs to.
entityIdxis index of the grid entity.

Member Function Documentation

◆ getBasis()

template<class Grid , int EntityDimension>
__cuda_callable__ auto TNL::Meshes::GridEntity< Grid, EntityDimension >::getBasis ( ) const

Getter of the basis vector.

The basis vector has one for each axis along which the grid entity has non-zero length.

The basis vector is not stored explicitly in the grid entity and it is computed on the fly.

Returns
basis vector.

◆ getCenter()

template<class Grid , int EntityDimension>
__cuda_callable__ GridEntity< Grid, EntityDimension >::PointType TNL::Meshes::GridEntity< Grid, EntityDimension >::getCenter ( ) const

Returns the center of the grid entity.

Returns
the centre of the grid entity.

◆ getCoordinates() [1/2]

template<class Grid , int EntityDimension>
__cuda_callable__ GridEntity< Grid, EntityDimension >::CoordinatesType & TNL::Meshes::GridEntity< Grid, EntityDimension >::getCoordinates ( )

Getter of the grid entity coordinates for non-constant instances.

Returns
grid entity coordinates in a form of a reference.

◆ getCoordinates() [2/2]

template<class Grid , int EntityDimension>
__cuda_callable__ const GridEntity< Grid, EntityDimension >::CoordinatesType & TNL::Meshes::GridEntity< Grid, EntityDimension >::getCoordinates ( ) const

Getter of the grid entity coordinates for constant instances.

Returns
grid entity coordinates in a form of constant reference.

◆ getEntityDimension()

template<class Grid , int EntityDimension>
constexpr int TNL::Meshes::GridEntity< Grid, EntityDimension >::getEntityDimension ( )
staticconstexpr

Getter of the dimensions of the grid entity.

Returns
dimensions of the grid entity.

◆ getGrid()

template<class Grid , int EntityDimension>
__cuda_callable__ const Grid & TNL::Meshes::GridEntity< Grid, EntityDimension >::getGrid ( ) const

Returns a reference on the grid the grid entity belongs to.

Returns
a reference on the grid the grid entity belongs to.

◆ getIndex()

template<class Grid , int EntityDimension>
__cuda_callable__ GridEntity< Grid, EntityDimension >::IndexType TNL::Meshes::GridEntity< Grid, EntityDimension >::getIndex ( ) const

Get the entity index in the grid.

Returns
the grid entity index in the grid.

◆ getMeasure()

template<class Grid , int EntityDimension>
__cuda_callable__ GridEntity< Grid, EntityDimension >::RealType TNL::Meshes::GridEntity< Grid, EntityDimension >::getMeasure ( ) const

Returns the measure (length, surface or volume) of the grid entity.

Returns
the measure of the grid entity.

◆ getMesh()

template<class Grid , int EntityDimension>
__cuda_callable__ const Grid & TNL::Meshes::GridEntity< Grid, EntityDimension >::getMesh ( ) const

Returns reference to the grid the grid entity belongs to.

Returns
reference to the grid the grid entity belongs to.

◆ getMeshDimension()

template<class Grid , int EntityDimension>
constexpr int TNL::Meshes::GridEntity< Grid, EntityDimension >::getMeshDimension ( )
staticconstexpr

Getter of the dimension of the grid.

Returns
dimension of the grid.

◆ getNeighbourEntity() [1/2]

template<class Grid , int EntityDimension>
template<int Dimension>
__cuda_callable__ GridEntity< Grid, Dimension > TNL::Meshes::GridEntity< Grid, EntityDimension >::getNeighbourEntity ( const CoordinatesType & offset) const

Returns the neighbour grid entity.

Template Parameters
Dimensionis a dimension of the neighbour grid entity.
Parameters
offsetis a offset of coordinates of the neighbour entity relative to this grid entity.
Warning
In case the parent entity orientation is greater than possible orientations of neighbour entity, then orientation is reduces. For example, 3-D cell neighbour of edge with orientaiton 1, will have orientation 0.
Returns
neighbour grid entity.

◆ getNeighbourEntity() [2/2]

template<class Grid , int EntityDimension>
template<int Dimension, int Orientation>
__cuda_callable__ GridEntity< Grid, Dimension > TNL::Meshes::GridEntity< Grid, EntityDimension >::getNeighbourEntity ( const CoordinatesType & offset) const

Returns the neighbour grid entity.

Template Parameters
Dimensionis a dimension of the neighbour grid entity.
Orientationis an orientatio index of the grid entity.
Parameters
offsetis a offset of coordinates of the neighbour entity relative to this grid entity.
Returns
neighbour grid entity.

◆ getOrientation()

template<class Grid , int EntityDimension>
__cuda_callable__ GridEntity< Grid, EntityDimension >::IndexType TNL::Meshes::GridEntity< Grid, EntityDimension >::getOrientation ( ) const

Returns index of the entity orientation.

Orientation is always paired with the normals. In other words, if orientations, entity dimensions and dimensions are equal, then normals are equal also.

◆ getPoint()

template<class Grid , int EntityDimension>
auto TNL::Meshes::GridEntity< Grid, EntityDimension >::getPoint ( ) const

Returns the point at the origin of the grid entity.

Returns
the point at the origin of the grid entity.

◆ isBoundary()

template<class Grid , int EntityDimension>
__cuda_callable__ bool TNL::Meshes::GridEntity< Grid, EntityDimension >::isBoundary ( ) const

Tells, if the entity is boundary entity.

Returns
true if the entity is a boundary entity and false otherwise.

◆ setCoordinates()

template<class Grid , int EntityDimension>
__cuda_callable__ void TNL::Meshes::GridEntity< Grid, EntityDimension >::setCoordinates ( const CoordinatesType & coordinates)

Setter of the grid entity coordinates.

Parameters
coordinatesare new coordinates of the grid entity.

◆ setNormals()

template<class Grid , int EntityDimension>
__cuda_callable__ void TNL::Meshes::GridEntity< Grid, EntityDimension >::setNormals ( const CoordinatesType & normals)

Setter for the packed normals vector of the grid entity.

This vector defines the orienation of the grid entity.

Parameters
normalsis a vector of packed normal vectors to the grid entity.

◆ setOrientation()

template<class Grid , int EntityDimension>
__cuda_callable__ void TNL::Meshes::GridEntity< Grid, EntityDimension >::setOrientation ( IndexType orientation)

Setter of the grid entity orientation index.

This is rather internal information. The index can be computed using the method TNL::Meshes::Grid::getOrientation.

Parameters
orientationis a index of the grid entity orientation.

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