dune-vtk 2.12
Loading...
Searching...
No Matches
Dune::Vtk::LagrangeGridCreator< GridType > Class Template Reference

#include <dune/vtk/gridcreators/lagrangegridcreator.hh>

Inheritance diagram for Dune::Vtk::LagrangeGridCreator< GridType >:
Inheritance graph

Classes

struct  EntitySet
 
class  LocalFunction
 
class  LocalParametrization
 

Public Types

using Grid = GridType
 
using Element = typename Grid::template Codim< 0 >::Entity
 
using GlobalCoordinate = typename Super::GlobalCoordinate
 
using LocalCoordinate = typename Element::Geometry::LocalCoordinate
 
using LocalGeometry = MultiLinearGeometry< typename Element::Geometry::ctype, Element::dimension, Element::dimension >
 
template<class F >
using HasParametrizedElements = decltype(std::declval< F >().insertElement(std::declval< GeometryType >(), std::declval< std::vector< unsigned int > const & >(), std::declval< std::function< GlobalCoordinate(LocalCoordinate)> >()))
 
using Derived = LagrangeGridCreator< GridType >
 

Public Member Functions

void insertVerticesImpl (std::vector< GlobalCoordinate > const &points, std::vector< std::uint64_t > const &)
 Implementation of the interface function insertVertices()
 
void insertElementsImpl (std::vector< std::uint8_t > const &types, std::vector< std::int64_t > const &offsets, std::vector< std::int64_t > const &connectivity)
 Implementation of the interface function insertElements()
 
LocalParametrization localParametrization (unsigned int insertionIndex) const
 Construct an element parametrization.
 
LocalParametrization localParametrization (Element const &element) const
 Construct an element parametrization.
 
LocalGeometry localGeometry (Element const &element) const
 Construct a transformation of local element coordinates.
 
int order (GeometryType type, std::size_t nNodes) const
 Determine lagrange order from number of points.
 
int order (ElementParametrization const &localParam) const
 
int order () const
 Determine lagrange order from number of points from the first element parametrization.
 
std::string name () const
 
int numComponents () const
 
Vtk::DataTypes dataType () const
 
EntitySet entitySet () const
 Dummy function returning a placeholder entityset.
 
GlobalCoordinate operator() (GlobalCoordinate const &) const
 Dummy function returning a placeholder entityset.
 
GridFactory< Grid > & factory ()
 Return the associated GridFactory.
 
GridFactory< Grid > const & factory () const
 Return the associated (const) GridFactory.
 
void insertVertices (std::vector< GlobalCoordinate > const &points, std::vector< std::uint64_t > const &point_ids)
 Insert all points as vertices into the factory.
 
void insertElements (std::vector< std::uint8_t > const &types, std::vector< std::int64_t > const &offsets, std::vector< std::int64_t > const &connectivity)
 Create elements based on type and connectivity description.
 
void insertPieces (std::vector< std::string > const &pieces)
 Insert part of a grid stored in file into factory.
 
std::unique_ptr< Grid > createGrid () const
 Construct the actual grid using the GridFactory.
 
auto comm () const
 Return the mpi collective communicator.
 
void insertPiecesImpl (std::vector< std::string > const &)
 

Protected Member Functions

Derived & asDerived ()
 
const Derived & asDerived () const
 

Protected Attributes

std::shared_ptr< GridFactory< Grid > > factory_
 

Friends

LocalFunction localFunction (LagrangeGridCreator &gridCreator)
 Local function representing the parametrization of the grid.
 
LocalFunction localFunction (LagrangeGridCreator const &gridCreator)
 
LocalFunction localFunction (LagrangeGridCreator &&gridCreator)
 

Detailed Description

template<class GridType>
class Dune::Vtk::LagrangeGridCreator< GridType >

The grid is created from the first nodes of a cell parametrization, representing the corner vertices. Thus a piecewise "flat" grid is constructed. The parametrization is 1. passed as a local element parametrization to the insertElement() function of a gridFactory to allow the grid itself to handle the parametrization and 2. is stored internally that can be accessed by using this GridCreator object as a grid function, or by extracting locally the parametrization on each existing grid element after creation of the grid.

So, the LagrangeGridCreator models both, a GridCreator and a GridFunction.

Member Typedef Documentation

◆ Derived

using Dune::Vtk::GridCreatorInterface< GridType, LagrangeGridCreator< GridType > >::Derived = LagrangeGridCreator< GridType >
inherited

◆ Element

template<class GridType >
using Dune::Vtk::LagrangeGridCreator< GridType >::Element = typename Grid::template Codim<0>::Entity

◆ GlobalCoordinate

template<class GridType >
using Dune::Vtk::LagrangeGridCreator< GridType >::GlobalCoordinate = typename Super::GlobalCoordinate

◆ Grid

template<class GridType >
using Dune::Vtk::LagrangeGridCreator< GridType >::Grid = GridType

◆ HasParametrizedElements

template<class GridType >
template<class F >
using Dune::Vtk::LagrangeGridCreator< GridType >::HasParametrizedElements = decltype(std::declval<F>().insertElement(std::declval<GeometryType>(), std::declval<std::vector<unsigned int> const&>(), std::declval<std::function<GlobalCoordinate(LocalCoordinate)> >()))

◆ LocalCoordinate

template<class GridType >
using Dune::Vtk::LagrangeGridCreator< GridType >::LocalCoordinate = typename Element::Geometry::LocalCoordinate

◆ LocalGeometry

template<class GridType >
using Dune::Vtk::LagrangeGridCreator< GridType >::LocalGeometry = MultiLinearGeometry<typename Element::Geometry::ctype,Element::dimension,Element::dimension>

Member Function Documentation

◆ asDerived() [1/2]

Derived & Dune::Vtk::GridCreatorInterface< GridType, LagrangeGridCreator< GridType > >::asDerived ( )
inlineprotectedinherited

◆ asDerived() [2/2]

const Derived & Dune::Vtk::GridCreatorInterface< GridType, LagrangeGridCreator< GridType > >::asDerived ( ) const
inlineprotectedinherited

◆ comm()

auto Dune::Vtk::GridCreatorInterface< GridType, LagrangeGridCreator< GridType > >::comm ( ) const
inlineinherited

Return the mpi collective communicator.

◆ createGrid()

std::unique_ptr< Grid > Dune::Vtk::GridCreatorInterface< GridType, LagrangeGridCreator< GridType > >::createGrid ( ) const
inlineinherited

Construct the actual grid using the GridFactory.

◆ dataType()

template<class GridType >
Vtk::DataTypes Dune::Vtk::LagrangeGridCreator< GridType >::dataType ( ) const
inline

◆ entitySet()

template<class GridType >
EntitySet Dune::Vtk::LagrangeGridCreator< GridType >::entitySet ( ) const
inline

Dummy function returning a placeholder entityset.

◆ factory() [1/2]

template<class GridType >
GridFactory< Grid > & Dune::Vtk::GridCreatorInterface< GridType, DerivedType >::factory ( )
inline

Return the associated GridFactory.

◆ factory() [2/2]

template<class GridType >
GridFactory< Grid > const & Dune::Vtk::GridCreatorInterface< GridType, DerivedType >::factory ( ) const
inline

Return the associated (const) GridFactory.

◆ insertElements()

void Dune::Vtk::GridCreatorInterface< GridType, LagrangeGridCreator< GridType > >::insertElements ( std::vector< std::uint8_t > const &  types,
std::vector< std::int64_t > const &  offsets,
std::vector< std::int64_t > const &  connectivity 
)
inlineinherited

Create elements based on type and connectivity description.

◆ insertElementsImpl()

template<class GridType >
void Dune::Vtk::LagrangeGridCreator< GridType >::insertElementsImpl ( std::vector< std::uint8_t > const &  types,
std::vector< std::int64_t > const &  offsets,
std::vector< std::int64_t > const &  connectivity 
)
inline

Implementation of the interface function insertElements()

◆ insertPieces()

void Dune::Vtk::GridCreatorInterface< GridType, LagrangeGridCreator< GridType > >::insertPieces ( std::vector< std::string > const &  pieces)
inlineinherited

Insert part of a grid stored in file into factory.

◆ insertPiecesImpl()

void Dune::Vtk::GridCreatorInterface< GridType, LagrangeGridCreator< GridType > >::insertPiecesImpl ( std::vector< std::string > const &  )
inlineinherited

◆ insertVertices()

void Dune::Vtk::GridCreatorInterface< GridType, LagrangeGridCreator< GridType > >::insertVertices ( std::vector< GlobalCoordinate > const &  points,
std::vector< std::uint64_t > const &  point_ids 
)
inlineinherited

Insert all points as vertices into the factory.

◆ insertVerticesImpl()

template<class GridType >
void Dune::Vtk::LagrangeGridCreator< GridType >::insertVerticesImpl ( std::vector< GlobalCoordinate > const &  points,
std::vector< std::uint64_t > const &   
)
inline

Implementation of the interface function insertVertices()

◆ localGeometry()

template<class GridType >
LocalGeometry Dune::Vtk::LagrangeGridCreator< GridType >::localGeometry ( Element const &  element) const
inline

Construct a transformation of local element coordinates.

An element might have a different local coordinate system than the coordinate system used to defined the element parametrization. Thus coordinate transform of the local parametrization is needed for element-local evaluations. This local geometry transform is obtained by figuring out the permutation of corners in the element corresponding to the inserted corner vertices.

◆ localParametrization() [1/2]

template<class GridType >
LocalParametrization Dune::Vtk::LagrangeGridCreator< GridType >::localParametrization ( Element const &  element) const
inline

Construct an element parametrization.

The returned LocalParametrization is a mapping GlobalCoordinate(LocalCoordinate) where LocalCoordinate is w.r.t. the local coordinate system in the passed element andGlobalCoordinate` a world coordinate in the parametrized grid.

◆ localParametrization() [2/2]

template<class GridType >
LocalParametrization Dune::Vtk::LagrangeGridCreator< GridType >::localParametrization ( unsigned int  insertionIndex) const
inline

Construct an element parametrization.

The returned LocalParametrization is a mapping GlobalCoordinate(LocalCoordinate) where LocalCoordinate is w.r.t. the local coordinate system in an element with giveninsertionIndex<tt>(defined by the inserted corner vertices) and GlobalCoordinate` a world coordinate in the parametrized grid.

◆ name()

template<class GridType >
std::string Dune::Vtk::LagrangeGridCreator< GridType >::name ( ) const
inline

◆ numComponents()

template<class GridType >
int Dune::Vtk::LagrangeGridCreator< GridType >::numComponents ( ) const
inline

◆ operator()()

template<class GridType >
GlobalCoordinate Dune::Vtk::LagrangeGridCreator< GridType >::operator() ( GlobalCoordinate const &  ) const
inline

Dummy function returning a placeholder entityset.

◆ order() [1/3]

template<class GridType >
int Dune::Vtk::LagrangeGridCreator< GridType >::order ( ) const
inline

Determine lagrange order from number of points from the first element parametrization.

◆ order() [2/3]

template<class GridType >
int Dune::Vtk::LagrangeGridCreator< GridType >::order ( ElementParametrization const &  localParam) const
inline

◆ order() [3/3]

template<class GridType >
int Dune::Vtk::LagrangeGridCreator< GridType >::order ( GeometryType  type,
std::size_t  nNodes 
) const
inline

Determine lagrange order from number of points.

Friends And Related Symbol Documentation

◆ localFunction [1/3]

template<class GridType >
LocalFunction localFunction ( LagrangeGridCreator< GridType > &&  gridCreator)
friend

◆ localFunction [2/3]

template<class GridType >
LocalFunction localFunction ( LagrangeGridCreator< GridType > &  gridCreator)
friend

Local function representing the parametrization of the grid.

The returned object models Functions::Concept::LocalFunction and can thus be bound to an element of the created grid and evaluated in the local coordinates of the bound element.

It is implemented in terms of the LocalParametrization function returned by the method localParametrization(element). See comments there for further details.

Note, this methods requires the GridCreator to be based by lvalue-reference. This is necessary, since we want to guarantee that all internal storage is preserved while evaluating the local function.

◆ localFunction [3/3]

template<class GridType >
LocalFunction localFunction ( LagrangeGridCreator< GridType > const &  gridCreator)
friend

Member Data Documentation

◆ factory_

std::shared_ptr<GridFactory<Grid> > Dune::Vtk::GridCreatorInterface< GridType, LagrangeGridCreator< GridType > >::factory_
protectedinherited

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