dune-grid  2.1.1
Classes | Public Types | Public Member Functions | Protected Types | Protected Member Functions
Dune::ALU2dGridFactory< ALUGrid, dimw > Class Template Reference

Factory class for 2d ALUGrids. More...

#include <dune/grid/alugrid/2d/alu2dgridfactory.hh>

Inheritance diagram for Dune::ALU2dGridFactory< ALUGrid, dimw >:
Inheritance graph

List of all members.

Classes

struct  Codim
struct  FaceLess

Public Types

typedef ALUGrid< 2, dimw > Grid
typedef DuneBoundaryProjection
< dimw > 
DuneBoundaryProjectionType
 type of boundary projection class
typedef ALUGridTransformation
< ctype, dimensionworld > 
Transformation
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

 ALU2dGridFactory (bool removeGeneratedFile=true)
 default constructor
 ALU2dGridFactory (const std::string &filename)
 constructor taking filename for temporary outfile
virtual ~ALU2dGridFactory ()
 Destructor.
virtual void insertVertex (const VertexType &pos)
 insert a vertex into the coarse grid
virtual void insertElement (const GeometryType &geometry, const std::vector< unsigned int > &vertices)
 insert an element into the coarse grid
virtual void insertBoundary (const GeometryType &geometry, const std::vector< unsigned int > &faceVertices, const int id)
 insert a boundary element into the coarse grid
virtual void insertBoundary (const int element, const int face, const int id)
 mark a face as boundary (and assign a boundary id)
virtual void insertBoundaryProjection (const GeometryType &type, const std::vector< unsigned int > &vertices, const DuneBoundaryProjectionType *projection)
 insert a boundary projection into the macro grid
virtual void insertBoundarySegment (const std::vector< unsigned int > &vertices)
 insert a boundary segment into the macro grid
virtual void insertBoundarySegment (const std::vector< unsigned int > &vertices, const shared_ptr< BoundarySegment< 2, dimw > > &boundarySegment)
 insert a shaped boundary segment into the macro grid
virtual void insertBoundaryProjection (const DuneBoundaryProjectionType &bndProjection)
 insert a boundary projection object, (a copy is made)
void insertFaceTransformation (const WorldMatrix &matrix, const WorldVector &shift)
 add a face transformation (for periodic identification)
virtual unsigned int insertionIndex (const typename Codim< 0 >::Entity &entity) const
virtual unsigned int insertionIndex (const typename Codim< dimension >::Entity &entity) const
virtual unsigned int insertionIndex (const typename Grid::LeafIntersection &intersection) const
virtual bool wasInserted (const typename Grid::LeafIntersection &intersection) const
GridcreateGrid ()
 finalize the grid creation and hand over the grid
GridcreateGrid (const bool addMissingBoundaries, const std::string dgfName="")
GridcreateGrid (const bool addMissingBoundaries, bool temporary, const std::string dgfName="")
void setTolerance (const ctype &epsilon)
virtual void insertVertex (const FieldVector< ctype, dimworld > &pos)=0
 Insert a vertex into the coarse grid.
virtual void insertElement (const GeometryType &type, const std::vector< unsigned int > &vertices, const shared_ptr< VirtualFunction< FieldVector< ctype, dimension >, FieldVector< ctype, dimworld > > > &elementParametrization)
 Insert a parametrized element into the coarse grid.
virtual void insertBoundarySegment (const std::vector< unsigned int > &vertices, const shared_ptr< BoundarySegment< dimension, dimworld > > &boundarySegment)
 insert an arbitrarily shaped boundary segment
virtual unsigned int insertionIndex (const typename Codim< 0 >::Entity &entity) const
 obtain an element's insertion index
virtual unsigned int insertionIndex (const typename Codim< dimension >::Entity &entity) const
 obtain a vertex' insertion index
virtual unsigned int insertionIndex (const typename ALUGrid< 2, dimw >::LeafIntersection &intersection) const
 obtain a boundary's insertion index
virtual bool wasInserted (const typename ALUGrid< 2, dimw >::LeafIntersection &intersection) const
 determine whether an intersection was inserted

Protected Types

enum  
 The grid world dimension. More...

Protected Member Functions

void setVerbosity (const bool verbose)
 set factory's verbosity

Detailed Description

template<template< int, int > class ALUGrid, int dimw>
class Dune::ALU2dGridFactory< ALUGrid, dimw >

Factory class for 2d ALUGrids.


Member Typedef Documentation

template<template< int, int > class ALUGrid, int dimw>
typedef DuneBoundaryProjection< dimw > Dune::ALU2dGridFactory< ALUGrid, dimw >::DuneBoundaryProjectionType

type of boundary projection class

template<template< int, int > class ALUGrid, int dimw>
typedef ALUGrid< 2, dimw > Dune::ALU2dGridFactory< ALUGrid, dimw >::Grid
template<template< int, int > class ALUGrid, int dimw>
typedef ALUGridTransformation< ctype, dimensionworld > Dune::ALU2dGridFactory< ALUGrid, dimw >::Transformation
template<template< int, int > class ALUGrid, int dimw>
typedef Transformation::WorldMatrix Dune::ALU2dGridFactory< ALUGrid, dimw >::WorldMatrix

type of matrix from world coordinates to world coordinates

template<template< int, int > class ALUGrid, int dimw>
typedef Transformation::WorldVector Dune::ALU2dGridFactory< ALUGrid, dimw >::WorldVector

type of vector for world coordinates


Member Enumeration Documentation

anonymous enum [protected, inherited]

The grid world dimension.


Constructor & Destructor Documentation

template<template< int, int > class ALUGrid, int dimw>
Dune::ALU2dGridFactory< ALUGrid, dimw >::ALU2dGridFactory ( bool  removeGeneratedFile = true) [inline, explicit]

default constructor

template<template< int, int > class ALUGrid, int dimw>
Dune::ALU2dGridFactory< ALUGrid, dimw >::ALU2dGridFactory ( const std::string &  filename) [inline, explicit]

constructor taking filename for temporary outfile

template<template< int, int > class ALUGrid, int dimw>
Dune::ALU2dGridFactory< ALUGrid, dimw >::~ALU2dGridFactory ( ) [inline, virtual]

Destructor.


Member Function Documentation

template<template< int, int > class ALUGrid, int dimw>
ALUGrid< 2, dimw > * Dune::ALU2dGridFactory< ALUGrid, dimw >::createGrid ( ) [inline, virtual]

finalize the grid creation and hand over the grid

The called takes responsibility for deleing the grid.

Implements Dune::GridFactoryInterface< ALUGrid< 2, dimw > >.

template<template< int, int > class ALUGrid, int dimw>
ALUGrid< 2, dimw > * Dune::ALU2dGridFactory< ALUGrid, dimw >::createGrid ( const bool  addMissingBoundaries,
const std::string  dgfName = "" 
) [inline]
template<template< int, int > class ALUGrid, int dimw>
ALUGrid< 2, dimw > * Dune::ALU2dGridFactory< ALUGrid, dimw >::createGrid ( const bool  addMissingBoundaries,
bool  temporary,
const std::string  dgfName = "" 
)
template<template< int, int > class ALUGrid, int dimw>
void Dune::ALU2dGridFactory< ALUGrid, dimw >::insertBoundary ( const GeometryType &  geometry,
const std::vector< unsigned int > &  faceVertices,
const int  id 
) [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]idboundary identifier of the boundary element, the default value is 0 (invalid boundary id)
template<template< int, int > class ALUGrid, int dimw>
void Dune::ALU2dGridFactory< ALUGrid, dimw >::insertBoundary ( const int  element,
const int  face,
const int  id 
) [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]idboundary id to assign to the face
template<template< int, int > class ALUGrid, int dimw>
void Dune::ALU2dGridFactory< ALUGrid, dimw >::insertBoundaryProjection ( const GeometryType &  type,
const std::vector< unsigned int > &  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.
template<template< int, int > class ALUGrid, int dimw>
void Dune::ALU2dGridFactory< ALUGrid, dimw >::insertBoundaryProjection ( const DuneBoundaryProjectionType bndProjection) [virtual]

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

Parameters:
[in]bndProjectioninstance of an ALUGridBoundaryProjection projecting vertices to a
virtual void Dune::GridFactoryInterface< ALUGrid< 2, dimw > >::insertBoundarySegment ( const std::vector< unsigned int > &  vertices,
const shared_ptr< BoundarySegment< dimension, dimworld > > &  boundarySegment 
) [inline, virtual, inherited]

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
template<template< int, int > class ALUGrid, int dimw>
void Dune::ALU2dGridFactory< ALUGrid, dimw >::insertBoundarySegment ( const std::vector< unsigned int > &  vertices) [virtual]

insert a boundary segment into the macro grid

Parameters:
[in]verticesvertex indices of boundary face

Implements Dune::GridFactoryInterface< ALUGrid< 2, dimw > >.

template<template< int, int > class ALUGrid, int dimw>
void Dune::ALU2dGridFactory< ALUGrid, dimw >::insertBoundarySegment ( const std::vector< unsigned int > &  vertices,
const shared_ptr< BoundarySegment< 2, dimw > > &  boundarySegment 
) [virtual]

insert a shaped boundary segment into the macro grid

Parameters:
[in]verticesvertex indices of boundary face
[in]boundarySegmentgeometric realization of shaped boundary
template<template< int, int > class ALUGrid, int dimw>
void Dune::ALU2dGridFactory< ALUGrid, dimw >::insertElement ( const GeometryType &  geometry,
const std::vector< unsigned int > &  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< 2, dimw > >.

References ALU2DSPACE, ALU2DSPACENAME::quadrilateral, and ALU2DSPACENAME::triangle.

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

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.

template<template< int, int > class ALUGrid, int dimw>
void Dune::ALU2dGridFactory< ALUGrid, dimw >::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 )
virtual unsigned int Dune::GridFactoryInterface< ALUGrid< 2, dimw > >::insertionIndex ( const typename Codim< 0 >::Entity entity) const [inline, virtual, inherited]

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
template<template< int, int > class ALUGrid, int dimw>
virtual unsigned int Dune::ALU2dGridFactory< ALUGrid, dimw >::insertionIndex ( const typename Codim< 0 >::Entity entity) const [inline, virtual]
template<template< int, int > class ALUGrid, int dimw>
virtual unsigned int Dune::ALU2dGridFactory< ALUGrid, dimw >::insertionIndex ( const typename Codim< dimension >::Entity entity) const [inline, virtual]
virtual unsigned int Dune::GridFactoryInterface< ALUGrid< 2, dimw > >::insertionIndex ( const typename Codim< dimension >::Entity entity) const [inline, virtual, inherited]

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
template<template< int, int > class ALUGrid, int dimw>
virtual unsigned int Dune::ALU2dGridFactory< ALUGrid, dimw >::insertionIndex ( const typename Grid::LeafIntersection intersection) const [inline, virtual]
virtual unsigned int Dune::GridFactoryInterface< ALUGrid< 2, dimw > >::insertionIndex ( const typename ALUGrid< 2, dimw > ::LeafIntersection &  intersection) const [inline, virtual, inherited]

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).
virtual void Dune::GridFactoryInterface< ALUGrid< 2, dimw > >::insertVertex ( const FieldVector< ctype, dimworld > &  pos) [pure virtual, inherited]

Insert a vertex into the coarse grid.

template<template< int, int > class ALUGrid, int dimw>
void Dune::ALU2dGridFactory< ALUGrid, dimw >::insertVertex ( const VertexType &  pos) [virtual]

insert a vertex into the coarse grid

Parameters:
[in]posposition of the vertex
template<template< int, int > class ALUGrid, int dimw>
void Dune::ALU2dGridFactory< ALUGrid, dimw >::setTolerance ( const ctype &  epsilon) [inline]
template<template< int, int > class ALUGrid, int dimw>
void Dune::ALU2dGridFactory< ALUGrid, dimw >::setVerbosity ( const bool  verbose) [inline, protected]

set factory's verbosity

Parameters:
[in]verboseverbosity (true/flase)
template<template< int, int > class ALUGrid, int dimw>
virtual bool Dune::ALU2dGridFactory< ALUGrid, dimw >::wasInserted ( const typename Grid::LeafIntersection intersection) const [inline, virtual]
virtual bool Dune::GridFactoryInterface< ALUGrid< 2, dimw > >::wasInserted ( const typename ALUGrid< 2, dimw > ::LeafIntersection &  intersection) const [inline, virtual, inherited]

determine whether an intersection was inserted

This method allows checking wheter 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: