Dune Core Modules (2.9.0)

Dune::ALU3dGridFactory< ALUGrid > Class Template Referenceabstract

Factory class for ALUGrids. More...

#include <dune/alugrid/3d/gridfactory.hh>

Public Types

typedef Transformation::WorldVector WorldVector
 type of vector for world coordinates
 
typedef Transformation::WorldMatrix WorldMatrix
 type of matrix from world coordinates to world coordinates
 

Public Member Functions

 ALU3dGridFactory (const MPICommunicatorType &communicator=Grid::defaultCommunicator(), bool removeGeneratedFile=true)
 default constructor
 
 ALU3dGridFactory (const std::string &filename, const MPICommunicatorType &communicator=Grid::defaultCommunicator())
 constructor taking filename for temporary outfile
 
virtual ~ALU3dGridFactory ()
 Destructor.
 
virtual void insertVertex (const VertexInputType &pos)
 insert a vertex into the coarse grid More...
 
void insertVertex (const VertexInputType &pos, const VertexId globalId)
 insert a vertex into the coarse grid including the vertex's globally unique id More...
 
virtual void insertElement (const GeometryType &geometry, const std::vector< VertexId > &vertices)
 insert an element into the coarse grid More...
 
virtual void insertBoundary (const GeometryType &geometry, const std::vector< VertexId > &faceVertices, int boundaryId=1)
 insert a boundary element into the coarse grid More...
 
virtual void insertBoundary (int element, int face, int boundaryId=1)
 mark a face as boundary (and assign a boundary id) More...
 
virtual void insertBoundaryProjection (const GeometryType &type, const std::vector< VertexId > &vertices, const DuneBoundaryProjectionType *projection)
 insert a boundary projection into the macro grid More...
 
virtual void insertBoundarySegment (const std::vector< VertexId > &vertices)
 insert a boundary segment into the macro grid More...
 
virtual void insertBoundarySegment (const std::vector< VertexId > &vertices, const std::shared_ptr< BoundarySegment< dimension, dimensionworld > > &boundarySegment)
 insert a shaped boundary segment into the macro grid More...
 
virtual void insertBoundaryProjection (const DuneBoundaryProjectionType &bndProjection, const bool isSurfaceProjection=(dimension !=dimensionworld))
 insert a boundary projection object, (a copy is made) More...
 
void insertFaceTransformation (const WorldMatrix &matrix, const WorldVector &shift)
 add a face transformation (for periodic identification) More...
 
GridPtrType createGrid ()
 finalize the grid creation and hand over the grid More...
 
void setLongestEdgeFlag (bool flag=true)
 set longest edge marking for biscetion grids (default is off)
 
Communication comm () const
 Return the Communication used by the grid factory. More...
 
virtual void insertVertex (const FieldVector< ctype, dimworld > &pos)=0
 Insert a vertex into the coarse grid.
 
virtual DUNE_NO_DEPRECATED_BEGIN void insertElement ([[maybe_unused]] const GeometryType &type,[[maybe_unused]] const std::vector< unsigned int > &vertices,[[maybe_unused]] const std::shared_ptr< VirtualFunction< FieldVector< ctype, dimension >, FieldVector< ctype, dimworld > > > &elementParametrization)
 Insert a parametrized element into the coarse grid. More...
 
virtual DUNE_NO_DEPRECATED_END void insertElement (const GeometryType &type, const std::vector< unsigned int > &vertices, std::function< FieldVector< ctype, dimworld >(FieldVector< ctype, dimension >)> elementParametrization)
 Insert a parametrized element into the coarse grid. More...
 
virtual void insertBoundarySegment ([[maybe_unused]] const std::vector< unsigned int > &vertices,[[maybe_unused]] const std::shared_ptr< BoundarySegment< dimension, dimworld > > &boundarySegment)
 insert an arbitrarily shaped boundary segment More...
 
virtual unsigned int insertionIndex ([[maybe_unused]] const typename Codim< 0 >::Entity &entity) const
 obtain an element's insertion index More...
 
virtual unsigned int insertionIndex ([[maybe_unused]] const typename Codim< dimension >::Entity &entity) const
 obtain a vertex' insertion index More...
 
virtual unsigned int insertionIndex ([[maybe_unused]] const typename GridType::LeafIntersection &intersection) const
 obtain a boundary's insertion index More...
 
virtual bool wasInserted ([[maybe_unused]] const typename GridType::LeafIntersection &intersection) const
 determine whether an intersection was inserted More...
 

Protected Member Functions

 ALU3dGridFactory (const bool verbose, const MPICommunicatorType &communicator)
 constructor taking verbose flag
 

Static Protected Attributes

constexpr static int dimworld
 The grid world dimension.
 

Detailed Description

template<class ALUGrid>
class Dune::ALU3dGridFactory< ALUGrid >

Factory class for ALUGrids.

Member Function Documentation

◆ comm()

template<class ALUGrid >
Communication Dune::ALU3dGridFactory< ALUGrid >::comm ( ) const
inline

Return the Communication used by the grid factory.

Use the Communication available from the grid.

◆ createGrid()

template<class ALUGrid >
alu_inline ALU3dGridFactory< ALUGrid >::GridPtrType Dune::ALU3dGridFactory< ALUGrid >::createGrid
virtual

finalize the grid creation and hand over the grid

The caller takes responsibility for deleing the grid.

Implements Dune::GridFactoryInterface< ALUGrid >.

◆ insertBoundary() [1/2]

template<class ALUGrid >
alu_inline void Dune::ALU3dGridFactory< ALUGrid >::insertBoundary ( const GeometryType geometry,
const std::vector< VertexId > &  faceVertices,
int  boundaryId = 1 
)
virtual

insert a boundary element into the coarse grid

Note
The order of the vertices must coincide with the vertex order in the corresponding DUNE reference element.
Parameters
[in]geometryGeometryType of the boundary element
[in]faceVerticesvertices of the boundary element
[in]boundaryIdboundary identifier of the boundary element, the default value is 1

References Dune::GeometryType::dim(), and DUNE_THROW.

◆ insertBoundary() [2/2]

template<class ALUGrid >
alu_inline void Dune::ALU3dGridFactory< ALUGrid >::insertBoundary ( int  element,
int  face,
int  boundaryId = 1 
)
virtual

mark a face as boundary (and assign a boundary id)

Parameters
[in]elementindex of the element, the face belongs to
[in]facelocal number of the face within the element
[in]boundaryIdboundary id to assign to the face, the default value is 1

◆ insertBoundaryProjection() [1/2]

template<class ALUGrid >
alu_inline void Dune::ALU3dGridFactory< ALUGrid >::insertBoundaryProjection ( const DuneBoundaryProjectionType bndProjection,
const bool  isSurfaceProjection = (dimension != dimensionworld) 
)
virtual

insert a boundary projection object, (a copy is made)

Parameters
[in]bndProjectioninstance of an ALUGridBoundaryProjection projecting vertices to a curved

References DUNE_THROW.

◆ insertBoundaryProjection() [2/2]

template<class ALUGrid >
alu_inline void Dune::ALU3dGridFactory< ALUGrid >::insertBoundaryProjection ( const GeometryType type,
const std::vector< VertexId > &  vertices,
const DuneBoundaryProjectionType projection 
)
virtual

insert a boundary projection into the macro grid

Parameters
[in]typegeometry type of boundary face
[in]verticesvertices of the boundary face
[in]projectionboundary projection
Note
The grid takes control of the projection object.

References Dune::GeometryType::dim(), DUNE_THROW, Dune::GeometryType::isCube(), and Dune::GeometryType::isSimplex().

◆ insertBoundarySegment() [1/3]

virtual void Dune::GridFactoryInterface< ALUGrid >::insertBoundarySegment ( [[maybe_unused] ] const std::vector< unsigned int > &  vertices,
[[maybe_unused] ] const std::shared_ptr< BoundarySegment< dimension, dimworld > > &  boundarySegment 
)
inlinevirtualinherited

insert an arbitrarily shaped boundary segment

This method inserts a boundary segment into the coarse grid.

Parameters
[in]verticesthe indices of the vertices of the segment
[in]boundarySegmentuser defined implementation of the boundary segment's geometry

◆ insertBoundarySegment() [2/3]

template<class ALUGrid >
void Dune::ALU3dGridFactory< ALUGrid >::insertBoundarySegment ( const std::vector< VertexId > &  vertices)
inlinevirtual

insert a boundary segment into the macro grid

Parameters
[in]verticesvertex indices of boundary face

Implements Dune::GridFactoryInterface< ALUGrid >.

References DUNE_THROW.

◆ insertBoundarySegment() [3/3]

template<class ALUGrid >
void Dune::ALU3dGridFactory< ALUGrid >::insertBoundarySegment ( const std::vector< VertexId > &  vertices,
const std::shared_ptr< BoundarySegment< dimension, dimensionworld > > &  boundarySegment 
)
inlinevirtual

insert a shaped boundary segment into the macro grid

Parameters
[in]verticesvertex indices of boundary face
[in]boundarySegmentgeometric realization of shaped boundary

References Dune::GeometryTypes::cube(), DUNE_THROW, and Dune::GeometryTypes::simplex().

◆ insertElement() [1/3]

virtual DUNE_NO_DEPRECATED_BEGIN void Dune::GridFactoryInterface< ALUGrid >::insertElement ( [[maybe_unused] ] const GeometryType type,
[[maybe_unused] ] const std::vector< unsigned int > &  vertices,
[[maybe_unused] ] const std::shared_ptr< VirtualFunction< FieldVector< ctype, dimension >, FieldVector< ctype, dimworld > > > &  elementParametrization 
)
inlinevirtualinherited

Insert a parametrized element into the coarse grid.

Parameters
typeThe GeometryType of the new element
verticesThe vertices of the new element, using the DUNE numbering
elementParametrizationA function prescribing the shape of this element

Make sure the inserted element is not inverted (this holds even for simplices). There are grids that can't handle inverted elements.

Deprecated:
[After Dune 2.7] VirtualFunction is deprecated, use the overload taking a std::function instead

◆ insertElement() [2/3]

template<class ALUGrid >
alu_inline void Dune::ALU3dGridFactory< ALUGrid >::insertElement ( const GeometryType geometry,
const std::vector< VertexId > &  vertices 
)
virtual

insert an element into the coarse grid

Note
The order of the vertices must coincide with the vertex order in the corresponding DUNE reference element.
Parameters
[in]geometryGeometryType of the new element
[in]verticesvertices of the new element

Implements Dune::GridFactoryInterface< ALUGrid >.

References Dune::GeometryType::dim(), and DUNE_THROW.

◆ insertElement() [3/3]

virtual DUNE_NO_DEPRECATED_END void Dune::GridFactoryInterface< ALUGrid >::insertElement ( const GeometryType type,
const std::vector< unsigned int > &  vertices,
std::function< FieldVector< ctype, dimworld >(FieldVector< ctype, dimension >)>  elementParametrization 
)
inlinevirtualinherited

Insert a parametrized element into the coarse grid.

Parameters
typeThe GeometryType of the new element
verticesThe vertices of the new element, using the DUNE numbering
elementParametrizationA function prescribing the shape of this element

Make sure the inserted element is not inverted (this holds even for simplices). There are grids that can't handle inverted elements.

◆ insertFaceTransformation()

template<class ALUGrid >
alu_inline void Dune::ALU3dGridFactory< ALUGrid >::insertFaceTransformation ( const WorldMatrix matrix,
const WorldVector shift 
)

add a face transformation (for periodic identification)

A face transformation is an affine mapping T from world coordinates to world coordinates. The grid factory then glues two faces f and g if T( f ) = g or T( g ) = f.

Parameters
[in]matrixmatrix describing the linear part of T
[in]shiftvector describing T( 0 )

◆ insertionIndex() [1/3]

virtual unsigned int Dune::GridFactoryInterface< ALUGrid >::insertionIndex ( [[maybe_unused] ] const typename Codim< 0 >::Entity entity) const
inlinevirtualinherited

obtain an element's insertion index

Data can be associated to the created macro grid using the insertion index of each entity that has been inserted during the grid creation process.

Between grid construction (createGrid) and the first grid modification, this method allows to obtain this insertion index from the grid factory. This way, data can be stored using the index maps provided by the grid.

Parameters
[in]entityentity whose insertion index is requested
Returns
insertion index of the entity

◆ insertionIndex() [2/3]

virtual unsigned int Dune::GridFactoryInterface< ALUGrid >::insertionIndex ( [[maybe_unused] ] const typename Codim< dimension >::Entity entity) const
inlinevirtualinherited

obtain a vertex' insertion index

Data can be associated to the created macro grid using the insertion index of each entity that has been inserted during the grid creation process.

Between grid construction (createGrid) and the first grid modification, this method allows to obtain this insertion index from the grid factory. This way, data can be stored using the index maps provided by the grid.

Parameters
[in]entityentity whose insertion index is requested
Returns
insertion index of the entity

◆ insertionIndex() [3/3]

virtual unsigned int Dune::GridFactoryInterface< ALUGrid >::insertionIndex ( [[maybe_unused] ] const typename GridType::LeafIntersection &  intersection) const
inlinevirtualinherited

obtain a boundary's insertion index

Data can be associated to the created macro grid using the insertion index of each entity that has been inserted during the grid creation process.

Between grid construction (createGrid) and the first grid modification, this method allows to obtain this insertion index from the grid factory. This way, data can be stored using the index maps provided by the grid.

Parameters
[in]intersectionintersection whose insertion index is requested
Returns
insertion index of the intersection
Note
The insertion index can only be obtained for boundary intersections that were actually inserted (see also wasInserted).

◆ insertVertex() [1/2]

template<class ALUGrid >
alu_inline void Dune::ALU3dGridFactory< ALUGrid >::insertVertex ( const VertexInputType pos)
virtual

insert a vertex into the coarse grid

Parameters
[in]posposition of the vertex

◆ insertVertex() [2/2]

template<class ALUGrid >
alu_inline void Dune::ALU3dGridFactory< ALUGrid >::insertVertex ( const VertexInputType pos,
const VertexId  globalId 
)

insert a vertex into the coarse grid including the vertex's globally unique id

Parameters
[in]posposition of the vertex
[in]globalIdglobally unique id for vertex

◆ wasInserted()

virtual bool Dune::GridFactoryInterface< ALUGrid >::wasInserted ( [[maybe_unused] ] const typename GridType::LeafIntersection &  intersection) const
inlinevirtualinherited

determine whether an intersection was inserted

This method allows checking whether an intersection was actually inserted into the grid factory.

Note
Not all boundary segments need to be inserted into the grid factory.
This method returns false for all interior intersections
Parameters
[in]intersectionintersection in question
Returns
true, if the intersection was inserted

The documentation for this class was generated from the following files:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (Apr 24, 22:30, 2024)