Vulpes  0.1.0
Versatile and parallel compUtational Library for high-order discontinuous Polytopal Element Simulations
Loading...
Searching...
No Matches
vulpes::assemble::CellManager< MeshType, FeSpaceType > Class Template Reference

Manages geometrical information about the cell and its mapping to the reference element. More...

#include <cell_manager.hpp>

Collaboration diagram for vulpes::assemble::CellManager< MeshType, FeSpaceType >:
[legend]

Classes

struct  NeighInfo
 Information about the neighbouring cell for a certain face. More...

Public Types

using index_t = typename MeshType::index_t
using FeType = FeSpaceType
using CellType = geometry::Cell<dim, double, index_t>
using MappingType = std::decay_t<decltype(FeType::getMapping(CellType{}))>

Public Member Functions

 CellManager (const MeshType &mesh, const FeSpaceType &fe_space)
 Construct a new Cell Manager object.
const auto & getFeSpace () const
 Get the finite element space associated to this cell manager.
const auto & getMesh () const
 Get the underlying mesh.
const CellType & getCell (index_t cell_id)
 Get and build lazily the cells of the mesh.
const auto & getMapping (index_t cell_id) const
 Get the geometrical mapping of the reference element to physical element.
const auto & getCells () const
 Access the underlying memory buffer for cells (some might be empty).
NeighInfo findCellNeigh (index_t cell_id, index_t loc_face_id)
 Find the cell id of the neighbour of a cell given the face id in local cell enumeration.
Eigen::Array< double, MeshType::self_dim, 1 > getPeriodicShift (index_t neigh_cell_id, index_t current_cell_id) const
 Get the periodic shift needed for neighbor cell coordinate transformation.

Static Public Attributes

static constexpr std::size_t dim = MeshType::self_dim

Protected Attributes

const MeshType & m_mesh
const FeType & m_fe_space
std::vector< std::unique_ptr< CellType > > m_cells
std::vector< bool > m_cell_is_normalized
std::vector< std::unique_ptr< MappingType > > m_mappings
datastructure::CrsMap< NeighInfo, index_t > m_cell_to_facet_neigh
 For each facet of each cell store the info about its neighbour The map is built lazily, the skeleton is stolen from the cell to facet map of the mesh, so that we do not have to pass in uncompressed format.

Detailed Description

template<typename MeshType, typename FeSpaceType>
class vulpes::assemble::CellManager< MeshType, FeSpaceType >

Manages geometrical information about the cell and its mapping to the reference element.

This class constructs lazily all the cells of a mesh (in a mesh all cells are represented implicitly). This requires a lot of extra memory, but having contiguous information (e.g., for vertices) significantly improves the speed of the code. The cells are initialized by building all the extra information required by the finite element space, namely the cellInitOptions() static method that all finite elements type must implement. The cells are then mapped to the reference element and the mapping is stored. This class also offers the possibility to query the neighbour of the cell in local cell enumeration, which is more costly to do in global mesh enumeration.

Note
we have two kind of enumerations: the cell enumeration and the mesh (or MPI) enumerations. The first ranges from 0 to the number of neighbours of the cell, the second one is common to all the mesh, in particular we consider the MPI local mesh enumeration, so that the i-th cell id is the one of the i-th local (MPI) cell

Member Typedef Documentation

◆ CellType

template<typename MeshType, typename FeSpaceType>
using vulpes::assemble::CellManager< MeshType, FeSpaceType >::CellType = geometry::Cell<dim, double, index_t>

◆ FeType

template<typename MeshType, typename FeSpaceType>
using vulpes::assemble::CellManager< MeshType, FeSpaceType >::FeType = FeSpaceType

◆ index_t

template<typename MeshType, typename FeSpaceType>
using vulpes::assemble::CellManager< MeshType, FeSpaceType >::index_t = typename MeshType::index_t

◆ MappingType

template<typename MeshType, typename FeSpaceType>
using vulpes::assemble::CellManager< MeshType, FeSpaceType >::MappingType = std::decay_t<decltype(FeType::getMapping(CellType{}))>

Constructor & Destructor Documentation

◆ CellManager()

template<typename MeshType, typename FeSpaceType>
vulpes::assemble::CellManager< MeshType, FeSpaceType >::CellManager ( const MeshType & mesh,
const FeSpaceType & fe_space )
inline

Construct a new Cell Manager object.

Parameters
meshThe mesh to manage
fe_spaceThe finite element space associated to this cell manager

Member Function Documentation

◆ findCellNeigh()

template<typename MeshType, typename FeSpaceType>
NeighInfo vulpes::assemble::CellManager< MeshType, FeSpaceType >::findCellNeigh ( index_t cell_id,
index_t loc_face_id )
inline

Find the cell id of the neighbour of a cell given the face id in local cell enumeration.

Parameters
cell_idCell id of the considered cell, in mesh (local MPI) enumeration
loc_face_idFace id in local cell enumeration (of the cell pointed by cell_id)
Returns
NeighInfo structure containing the cell id of the neigh in local cell enumeration

◆ getCell()

template<typename MeshType, typename FeSpaceType>
const CellType & vulpes::assemble::CellManager< MeshType, FeSpaceType >::getCell ( index_t cell_id)
inline

Get and build lazily the cells of the mesh.

Parameters
cell_idCell id of the considered cell in mesh (local MPI) enumeration
Returns
Cell<Dim, FloatType, IndexType>& class

◆ getCells()

template<typename MeshType, typename FeSpaceType>
const auto & vulpes::assemble::CellManager< MeshType, FeSpaceType >::getCells ( ) const
inline

Access the underlying memory buffer for cells (some might be empty).

◆ getFeSpace()

template<typename MeshType, typename FeSpaceType>
const auto & vulpes::assemble::CellManager< MeshType, FeSpaceType >::getFeSpace ( ) const
inline

Get the finite element space associated to this cell manager.

◆ getMapping()

template<typename MeshType, typename FeSpaceType>
const auto & vulpes::assemble::CellManager< MeshType, FeSpaceType >::getMapping ( index_t cell_id) const
inline

Get the geometrical mapping of the reference element to physical element.

Parameters
cell_idCell id of the considered cell in mesh (local MPI) enumeration
Returns
Class deriving from MappingBase

◆ getMesh()

template<typename MeshType, typename FeSpaceType>
const auto & vulpes::assemble::CellManager< MeshType, FeSpaceType >::getMesh ( ) const
inline

Get the underlying mesh.

◆ getPeriodicShift()

template<typename MeshType, typename FeSpaceType>
Eigen::Array< double, MeshType::self_dim, 1 > vulpes::assemble::CellManager< MeshType, FeSpaceType >::getPeriodicShift ( index_t neigh_cell_id,
index_t current_cell_id ) const
inline

Get the periodic shift needed for neighbor cell coordinate transformation.

Parameters
neigh_cell_idNeighbor cell ID
current_cell_idCurrent cell ID
Returns
Periodic shift in PHYSICAL coordinates (+/- period per wrapped dimension)

Extracts period values from mesh metadata and delegates geometric calculation to geometry::computePeriodicShift. Returns zero if cells are not initialized.

Member Data Documentation

◆ dim

template<typename MeshType, typename FeSpaceType>
std::size_t vulpes::assemble::CellManager< MeshType, FeSpaceType >::dim = MeshType::self_dim
inlinestaticconstexpr

◆ m_cell_is_normalized

template<typename MeshType, typename FeSpaceType>
std::vector<bool> vulpes::assemble::CellManager< MeshType, FeSpaceType >::m_cell_is_normalized
protected

◆ m_cell_to_facet_neigh

template<typename MeshType, typename FeSpaceType>
datastructure::CrsMap<NeighInfo, index_t> vulpes::assemble::CellManager< MeshType, FeSpaceType >::m_cell_to_facet_neigh
protected

For each facet of each cell store the info about its neighbour The map is built lazily, the skeleton is stolen from the cell to facet map of the mesh, so that we do not have to pass in uncompressed format.

◆ m_cells

template<typename MeshType, typename FeSpaceType>
std::vector<std::unique_ptr<CellType> > vulpes::assemble::CellManager< MeshType, FeSpaceType >::m_cells
protected

◆ m_fe_space

template<typename MeshType, typename FeSpaceType>
const FeType& vulpes::assemble::CellManager< MeshType, FeSpaceType >::m_fe_space
protected

◆ m_mappings

template<typename MeshType, typename FeSpaceType>
std::vector<std::unique_ptr<MappingType> > vulpes::assemble::CellManager< MeshType, FeSpaceType >::m_mappings
protected

◆ m_mesh

template<typename MeshType, typename FeSpaceType>
const MeshType& vulpes::assemble::CellManager< MeshType, FeSpaceType >::m_mesh
protected

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