dune-mmesh 1.4.1-git
Loading...
Searching...
No Matches
Dune::MMeshExplicitGridFactory< Grid > Class Template Referenceabstract

specialization of the explicit GridFactory for MMesh More...

#include <dune/mmesh/grid/explicitgridfactory.hh>

Inheritance diagram for Dune::MMeshExplicitGridFactory< Grid >:
Inheritance graph

Classes

struct  Codim
 

Public Types

typedef Grid::ctype ctype
 type of (scalar) coordinates
 
typedef Grid::HostGridType HostGrid
 type of the hostgrid
 
typedef FieldVector< ctype, dimensionworld > WorldVector
 type of vector for world coordinates
 
typedef FieldMatrix< ctype, dimensionworld, dimensionworld > WorldMatrix
 type of matrix from world coordinates to world coordinates
 
typedef Dune::BoundarySegment< dimension, dimensionworld > BoundarySegment
 type of a Dune boundary segment
 
typedef Grid::IdType IdType
 type of an id
 
typedef std::unordered_map< IdType, std::size_t > BoundarySegments
 type of the boundary segment id map
 
typedef std::unordered_map< std::size_t, std::size_t > BoundaryIds
 
typedef std::unordered_map< IdType, std::size_t > InterfaceSegments
 type of the interface segment set
 
typedef Dune::Communication< typename MPIHelper::MPICommunicator > Communication
 

Public Member Functions

 MMeshExplicitGridFactory ()
 
void insertElement (const GeometryType &type, const std::vector< unsigned int > &v)
 insert an element into the macro grid
 
void insertElement (const GeometryType &type, const std::vector< unsigned int > &v, const size_t domainMarker)
 insert an element into the macro grid with a given domain marker
 
template<int d = dimension>
std::enable_if_t< d==2, bool > isElement (const std::vector< unsigned int > &v) const
 Returns if there is a face with the given vertices in the triangulation2.
 
template<int d = dimension>
std::enable_if_t< d==3, bool > isElement (const std::vector< unsigned int > &v) const
 Returns if there is a cell with the given vertices in the triangulation3.
 
virtual void insertBoundarySegment (const std::vector< unsigned int > &vertices)
 insert a boundary segment into the macro grid
 
void insertBoundarySegment (const std::vector< unsigned int > &vertices, const std::shared_ptr< BoundarySegment > &boundarySegment)
 
void insertInterfaceBoundarySegment (const std::vector< unsigned int > &vertices)
 
void insertVertex (const WorldVector &pos)
 Insert a vertex into the macro grid.
 
void insertInterface (const std::vector< unsigned int > &vertices, const std::size_t marker=1)
 insert an interface into the macro grid
 
unsigned int insertionIndex (const typename Codim< 0 >::Entity &entity) const
 return insertion index of entity
 
unsigned int insertionIndex (const typename Codim< dimension >::Entity &entity) const
 return insertion index of vertex entity
 
unsigned int insertionIndex (const typename Grid::LeafIntersection &intersection) const
 return insertion index of boundary intersection
 
const BoundarySegments & boundarySegments () const
 returns the boundary segment to index map
 
const BoundaryIds & boundaryIds () const
 returns the boundary segment index to boundary id map
 
void addBoundaryId (std::size_t boundarySegmentIndex, std::size_t boundaryId)
 add a boundary id
 
std::unique_ptr< Grid > createGrid ()
 finalize grid creation and hand over the grid
 
const std::vector< Vertex_handle > & vertexHandles () const
 return the vertex handles
 
virtual void insertVertex (const FieldVector< ctype, dimworld > &pos)=0
 
virtual void insertElement (const GeometryType &, const std::vector< unsigned int > &, std::function< FieldVector< ctype, dimworld >(FieldVector< ctype, dimension >)>)
 
virtual void insertBoundarySegment (const std::vector< unsigned int > &vertices, const std::shared_ptr< BoundarySegment< dimension, dimworld > > &boundarySegment)
 
virtual unsigned int insertionIndex (const typename GridType::LeafIntersection &intersection) const
 
virtual bool wasInserted (const typename GridType::LeafIntersection &intersection) const
 
Communication comm () const
 

Static Public Attributes

static const int dimension = Grid::dimension
 dimension of the grid
 
static const int dimensionworld = Grid::dimensionworld
 dimension of the world
 
static const bool supportsBoundaryIds = true
 are boundary ids supported by this factory?
 
static const bool supportPeriodicity = false
 the factory is not able to create periodic meshes
 

Static Protected Attributes

static constexpr int dimworld
 

Detailed Description

template<class Grid>
class Dune::MMeshExplicitGridFactory< Grid >

specialization of the explicit GridFactory for MMesh

The explicit grid factory for MMesh

Member Typedef Documentation

◆ BoundaryIds

◆ BoundarySegment

type of a Dune boundary segment

◆ BoundarySegments

template<class Grid >
typedef std::unordered_map<IdType, std::size_t> Dune::MMeshExplicitGridFactory< Grid >::BoundarySegments

type of the boundary segment id map

◆ ctype

template<class Grid >
typedef Grid::ctype Dune::MMeshExplicitGridFactory< Grid >::ctype

type of (scalar) coordinates

◆ HostGrid

template<class Grid >
typedef Grid::HostGridType Dune::MMeshExplicitGridFactory< Grid >::HostGrid

type of the hostgrid

◆ IdType

template<class Grid >
typedef Grid::IdType Dune::MMeshExplicitGridFactory< Grid >::IdType

type of an id

◆ InterfaceSegments

template<class Grid >
typedef std::unordered_map<IdType, std::size_t> Dune::MMeshExplicitGridFactory< Grid >::InterfaceSegments

type of the interface segment set

◆ WorldMatrix

type of matrix from world coordinates to world coordinates

◆ WorldVector

template<class Grid >
typedef FieldVector<ctype, dimensionworld> Dune::MMeshExplicitGridFactory< Grid >::WorldVector

type of vector for world coordinates

Constructor & Destructor Documentation

◆ MMeshExplicitGridFactory()

template<class Grid >
Dune::MMeshExplicitGridFactory< Grid >::MMeshExplicitGridFactory ( )
inline

default constructor

Member Function Documentation

◆ addBoundaryId()

template<class Grid >
void Dune::MMeshExplicitGridFactory< Grid >::addBoundaryId ( std::size_t  boundarySegmentIndex,
std::size_t  boundaryId 
)
inline

add a boundary id

◆ boundaryIds()

template<class Grid >
const BoundaryIds & Dune::MMeshExplicitGridFactory< Grid >::boundaryIds ( ) const
inline

returns the boundary segment index to boundary id map

◆ boundarySegments()

template<class Grid >
const BoundarySegments & Dune::MMeshExplicitGridFactory< Grid >::boundarySegments ( ) const
inline

returns the boundary segment to index map

◆ createGrid()

template<class Grid >
std::unique_ptr< Grid > Dune::MMeshExplicitGridFactory< Grid >::createGrid ( )
inlinevirtual

finalize grid creation and hand over the grid

This version of createGrid is original to the MMesh grid factroy, allowing to specity a grid name.

Returns
a pointer to the newly created grid

Implements Dune::GridFactoryInterface< Grid >.

◆ insertBoundarySegment() [1/2]

template<class Grid >
virtual void Dune::MMeshExplicitGridFactory< Grid >::insertBoundarySegment ( const std::vector< unsigned int > &  vertices)
inlinevirtual

insert a boundary segment into the macro grid

Only influences the ordering of the boundary segments

Parameters
[in]verticesvertex indices of boundary face

Implements Dune::GridFactoryInterface< Grid >.

◆ insertBoundarySegment() [2/2]

template<class Grid >
void Dune::MMeshExplicitGridFactory< Grid >::insertBoundarySegment ( const std::vector< unsigned int > &  vertices,
const std::shared_ptr< BoundarySegment > &  boundarySegment 
)
inline

◆ insertElement() [1/2]

template<class Grid >
void Dune::MMeshExplicitGridFactory< Grid >::insertElement ( const GeometryType &  type,
const std::vector< unsigned int > &  v 
)
inlinevirtual

insert an element into the macro grid

Parameters
[in]typeGeometryType of the new element
[in]vindices of the element vertices (starting with 0)

Implements Dune::GridFactoryInterface< Grid >.

◆ insertElement() [2/2]

template<class Grid >
void Dune::MMeshExplicitGridFactory< Grid >::insertElement ( const GeometryType &  type,
const std::vector< unsigned int > &  v,
const size_t  domainMarker 
)
inline

insert an element into the macro grid with a given domain marker

Parameters
[in]typeGeometryType of the new element
[in]vindices of the element vertices (starting with 0)
[in]domainMarkerdomain marker of element

◆ insertInterface()

template<class Grid >
void Dune::MMeshExplicitGridFactory< Grid >::insertInterface ( const std::vector< unsigned int > &  vertices,
const std::size_t  marker = 1 
)
inline

insert an interface into the macro grid

Parameters
[in]verticesindices of the interface vertices (starting with 0)
[in]markermarker value of the interface segment (default 1)

◆ insertInterfaceBoundarySegment()

template<class Grid >
void Dune::MMeshExplicitGridFactory< Grid >::insertInterfaceBoundarySegment ( const std::vector< unsigned int > &  vertices)
inline

◆ insertionIndex() [1/3]

template<class Grid >
unsigned int Dune::MMeshExplicitGridFactory< Grid >::insertionIndex ( const typename Codim< 0 >::Entity &  entity) const
inlinevirtual

return insertion index of entity

Parameters
[in]entityEntity of codim 0

Reimplemented from Dune::GridFactoryInterface< Grid >.

◆ insertionIndex() [2/3]

template<class Grid >
unsigned int Dune::MMeshExplicitGridFactory< Grid >::insertionIndex ( const typename Codim< dimension >::Entity &  entity) const
inlinevirtual

return insertion index of vertex entity

Parameters
[in]entityEntity of codim dimension

Reimplemented from Dune::GridFactoryInterface< Grid >.

◆ insertionIndex() [3/3]

template<class Grid >
unsigned int Dune::MMeshExplicitGridFactory< Grid >::insertionIndex ( const typename Grid::LeafIntersection &  intersection) const
inline

return insertion index of boundary intersection

Parameters
[in]intersectionLeaf intersection

◆ insertVertex()

template<class Grid >
void Dune::MMeshExplicitGridFactory< Grid >::insertVertex ( const WorldVector &  pos)
inline

Insert a vertex into the macro grid.

Parameters
[in]posposition of the vertex (in world coordinates)
Note
This method assumes that the vertices are inserted consecutively with respect to their index.

◆ isElement() [1/2]

template<class Grid >
template<int d = dimension>
std::enable_if_t< d==2, bool > Dune::MMeshExplicitGridFactory< Grid >::isElement ( const std::vector< unsigned int > &  v) const
inline

Returns if there is a face with the given vertices in the triangulation2.

Parameters
[in]vindices of the element vertices

◆ isElement() [2/2]

template<class Grid >
template<int d = dimension>
std::enable_if_t< d==3, bool > Dune::MMeshExplicitGridFactory< Grid >::isElement ( const std::vector< unsigned int > &  v) const
inline

Returns if there is a cell with the given vertices in the triangulation3.

Parameters
[in]vindices of the element vertices

◆ vertexHandles()

template<class Grid >
const std::vector< Vertex_handle > & Dune::MMeshExplicitGridFactory< Grid >::vertexHandles ( ) const
inline

return the vertex handles

Member Data Documentation

◆ dimension

template<class Grid >
const int Dune::MMeshExplicitGridFactory< Grid >::dimension = Grid::dimension
static

dimension of the grid

◆ dimensionworld

template<class Grid >
const int Dune::MMeshExplicitGridFactory< Grid >::dimensionworld = Grid::dimensionworld
static

dimension of the world

◆ supportPeriodicity

template<class Grid >
const bool Dune::MMeshExplicitGridFactory< Grid >::supportPeriodicity = false
static

the factory is not able to create periodic meshes

◆ supportsBoundaryIds

template<class Grid >
const bool Dune::MMeshExplicitGridFactory< Grid >::supportsBoundaryIds = true
static

are boundary ids supported by this factory?


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