Dune Core Modules (2.9.0)

Dune::GridFactory< ALUGrid< dim, dimw, eltype, refinementtype, Comm > > Class Template Referenceabstract

Specialization of the generic GridFactory for ALUGrid. 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

 GridFactory (const MPICommunicatorType &communicator=Grid::defaultCommunicator())
 Default constructor.
 
template<class MPIComm >
 GridFactory (const MPIComm &)
 Default constructor ignoring MPIComm.
 
 GridFactory (const std::string &filename, const MPICommunicatorType &communicator=Grid::defaultCommunicator())
 constructor taking filename
 
template<class MPIComm >
 GridFactory (const std::string &filename, const MPIComm &)
 constructor taking filename and ignoring MPIComm
 
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 insertVertex (const FieldVector< ctype, dimworld > &pos)=0
 Insert a vertex into the coarse grid.
 
virtual void insertElement (const GeometryType &geometry, const std::vector< VertexId > &vertices)
 insert an element into the coarse grid More...
 
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 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 insertBoundaryProjection (const DuneBoundaryProjectionType &bndProjection, const bool isSurfaceProjection=(dimension !=dimensionworld))
 insert a boundary projection object, (a copy is made) 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 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...
 
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...
 
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...
 
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...
 

Static Protected Attributes

constexpr static int dimworld
 The grid world dimension.
 

Detailed Description

template<int dim, int dimw, ALUGridElementType eltype, ALUGridRefinementType refinementtype, class Comm>
class Dune::GridFactory< ALUGrid< dim, dimw, eltype, refinementtype, Comm > >

Specialization of the generic GridFactory for ALUGrid.

Member Function Documentation

◆ comm()

Communication Dune::ALU3dGridFactory< ALUGrid< dim, dimw, eltype, refinementtype, Comm > >::comm ( ) const
inlineinherited

Return the Communication used by the grid factory.

Use the Communication available from the grid.

◆ createGrid()

alu_inline ALU3dGridFactory< ALUGrid< dim, dimw, eltype, refinementtype, Comm > >::GridPtrType Dune::ALU3dGridFactory< ALUGrid< dim, dimw, eltype, refinementtype, Comm > >::createGrid
virtualinherited

finalize the grid creation and hand over the grid

The caller takes responsibility for deleing the grid.

Implements Dune::GridFactoryInterface< ALUGrid< dim, dimw, eltype, refinementtype, Comm > >.

◆ insertBoundary() [1/2]

alu_inline void Dune::ALU3dGridFactory< ALUGrid< dim, dimw, eltype, refinementtype, Comm > >::insertBoundary ( const GeometryType geometry,
const std::vector< VertexId > &  faceVertices,
int  boundaryId = 1 
)
virtualinherited

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

◆ insertBoundary() [2/2]

alu_inline void Dune::ALU3dGridFactory< ALUGrid< dim, dimw, eltype, refinementtype, Comm > >::insertBoundary ( int  element,
int  face,
int  boundaryId = 1 
)
virtualinherited

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]

alu_inline void Dune::ALU3dGridFactory< ALUGrid< dim, dimw, eltype, refinementtype, Comm > >::insertBoundaryProjection ( const DuneBoundaryProjectionType bndProjection,
const bool  isSurfaceProjection = (dimension != dimensionworld) 
)
virtualinherited

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

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

◆ insertBoundaryProjection() [2/2]

alu_inline void Dune::ALU3dGridFactory< ALUGrid< dim, dimw, eltype, refinementtype, Comm > >::insertBoundaryProjection ( const GeometryType type,
const std::vector< VertexId > &  vertices,
const DuneBoundaryProjectionType projection 
)
virtualinherited

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.

◆ insertBoundarySegment() [1/3]

virtual void Dune::GridFactoryInterface< ALUGrid< dim, dimw, eltype, refinementtype, Comm > >::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]

void Dune::ALU3dGridFactory< ALUGrid< dim, dimw, eltype, refinementtype, Comm > >::insertBoundarySegment ( const std::vector< VertexId > &  vertices)
inlinevirtualinherited

insert a boundary segment into the macro grid

Parameters
[in]verticesvertex indices of boundary face

Implements Dune::GridFactoryInterface< ALUGrid< dim, dimw, eltype, refinementtype, Comm > >.

◆ insertBoundarySegment() [3/3]

void Dune::ALU3dGridFactory< ALUGrid< dim, dimw, eltype, refinementtype, Comm > >::insertBoundarySegment ( const std::vector< VertexId > &  vertices,
const std::shared_ptr< BoundarySegment< dimension, dimensionworld > > &  boundarySegment 
)
inlinevirtualinherited

insert a shaped boundary segment into the macro grid

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

◆ insertElement() [1/3]

virtual DUNE_NO_DEPRECATED_BEGIN void Dune::GridFactoryInterface< ALUGrid< dim, dimw, eltype, refinementtype, Comm > >::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]

alu_inline void Dune::ALU3dGridFactory< ALUGrid< dim, dimw, eltype, refinementtype, Comm > >::insertElement ( const GeometryType geometry,
const std::vector< VertexId > &  vertices 
)
virtualinherited

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< dim, dimw, eltype, refinementtype, Comm > >.

◆ insertElement() [3/3]

virtual DUNE_NO_DEPRECATED_END void Dune::GridFactoryInterface< ALUGrid< dim, dimw, eltype, refinementtype, Comm > >::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()

alu_inline void Dune::ALU3dGridFactory< ALUGrid< dim, dimw, eltype, refinementtype, Comm > >::insertFaceTransformation ( const WorldMatrix matrix,
const WorldVector shift 
)
inherited

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< dim, dimw, eltype, refinementtype, Comm > >::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< dim, dimw, eltype, refinementtype, Comm > >::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< dim, dimw, eltype, refinementtype, Comm > >::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]

alu_inline void Dune::ALU3dGridFactory< ALUGrid< dim, dimw, eltype, refinementtype, Comm > >::insertVertex ( const VertexInputType pos)
virtualinherited

insert a vertex into the coarse grid

Parameters
[in]posposition of the vertex

◆ insertVertex() [2/2]

alu_inline void Dune::ALU3dGridFactory< ALUGrid< dim, dimw, eltype, refinementtype, Comm > >::insertVertex ( const VertexInputType pos,
const VertexId  globalId 
)
inherited

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< dim, dimw, eltype, refinementtype, Comm > >::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 file:
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (Apr 24, 22:30, 2024)