Dune::GridFactory< AlbertaGrid< dim, dimworld > > Class Template Reference
[GridFactory]

specialization of the generic GridFactory for AlbertaGrid More...

#include <dune/grid/albertagrid/gridfactory.hh>

Inheritance diagram for Dune::GridFactory< AlbertaGrid< dim, dimworld > >:
Inheritance graph

List of all members.

Classes

struct  Codim
class  ProjectionFactory

Public Types

typedef AlbertaGrid< dim,
dimworld > 
Grid
 type of grid this factory is for
typedef Grid::ctype ctype
 type of (scalar) coordinates
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 DuneBoundaryProjection
< dimensionworld
DuneProjection
typedef Dune::shared_ptr
< const DuneProjection
DuneProjectionPtr
typedef Dune::BoundarySegment
< dimension, dimensionworld
BoundarySegment

Public Member Functions

 GridFactory ()
virtual ~GridFactory ()
virtual void insertVertex (const WorldVector &pos)
 insert a vertex into the macro grid
virtual void insertElement (const GeometryType &type, const std::vector< unsigned int > &vertices)
 insert an element into the macro grid
virtual void insertBoundary (int element, int face, 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 DuneProjection *projection)
 insert a boundary projection into the macro grid
virtual void insertBoundaryProjection (const DuneProjection *projection)
 insert a global (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 > &boundarySegment)
 insert a shaped boundary segment into the macro grid
void insertFaceTransformation (const WorldMatrix &matrix, const WorldVector &shift)
 add a face transformation (for periodic identification)
void markLongestEdge ()
 mark the longest edge as refinemet edge
GridcreateGrid ()
 finalize grid creation and hand over the grid
template<GrapeIOFileFormatType type>
bool write (const std::string &filename)
 write out the macro triangulation in native grid file format
virtual bool write (const std::string &filename)
 write out the macro triangulation in native grid file format
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 Grid::LeafIntersection &intersection) const
virtual bool wasInserted (const typename Grid::LeafIntersection &intersection) const
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 AlbertaGrid< dim, dimworld >::LeafIntersection &intersection) const
 obtain a boundary's insertion index
virtual bool wasInserted (const typename AlbertaGrid< dim, dimworld >::LeafIntersection &intersection) const
 determine whether an intersection was inserted

Static Public Member Functions

static void destroyGrid (Grid *grid)
 destroy a grid previously obtain from this factory

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 = MacroData::supportPeriodicity
 is the factory able to create periodic meshes?

Protected Types

enum  
 

The grid world dimension.

More...

Detailed Description

template<int dim, int dimworld>
class Dune::GridFactory< AlbertaGrid< dim, dimworld > >

specialization of the generic GridFactory for AlbertaGrid

The GridFactory for AlbertaGrid adds some extensions to the standard GridFactoryInterface. It provides the following additional features:

  • It allows to set boundary ids via insertBoundary. For ALBERTA 1.2, these boundary ids are ignored, though.
  • For ALBERTA 3.0 and above, you can add face transformation to identify faces. This allows the construction of periodic grids.
  • The grid can be written in ALBERTA's native format for macro triangulations via write (both ASCII and XDR format are supported).
  • On grid creation, a name can be assigned to the grid.
  • On grid creation, the grid can be reordered such that ALBERTA uses the longest edge as refinement edge during recursive bisection.

Member Typedef Documentation

template<int dim, int dimworld>
typedef Dune::BoundarySegment< dimension, dimensionworld > Dune::GridFactory< AlbertaGrid< dim, dimworld > >::BoundarySegment
template<int dim, int dimworld>
typedef Grid::ctype Dune::GridFactory< AlbertaGrid< dim, dimworld > >::ctype

type of (scalar) coordinates

Reimplemented from Dune::GridFactoryInterface< AlbertaGrid< dim, dimworld > >.

template<int dim, int dimworld>
typedef DuneBoundaryProjection< dimensionworld > Dune::GridFactory< AlbertaGrid< dim, dimworld > >::DuneProjection
template<int dim, int dimworld>
typedef Dune::shared_ptr< const DuneProjection > Dune::GridFactory< AlbertaGrid< dim, dimworld > >::DuneProjectionPtr
template<int dim, int dimworld>
typedef AlbertaGrid< dim, dimworld > Dune::GridFactory< AlbertaGrid< dim, dimworld > >::Grid

type of grid this factory is for

template<int dim, int dimworld>
typedef FieldMatrix< ctype, dimensionworld, dimensionworld > Dune::GridFactory< AlbertaGrid< dim, dimworld > >::WorldMatrix

type of matrix from world coordinates to world coordinates

template<int dim, int dimworld>
typedef FieldVector< ctype, dimensionworld > Dune::GridFactory< AlbertaGrid< dim, dimworld > >::WorldVector

type of vector for world coordinates


Member Enumeration Documentation

anonymous enum [protected, inherited]

The grid world dimension.


Constructor & Destructor Documentation

template<int dim, int dimworld>
Dune::GridFactory< AlbertaGrid< dim, dimworld > >::GridFactory (  )  [inline]

default constructor

template<int dim, int dimworld>
Dune::GridFactory< AlbertaGrid< dim, dimworld > >::~GridFactory (  )  [virtual]

Member Function Documentation

template<int dim, int dimworld>
Grid* Dune::GridFactory< AlbertaGrid< dim, dimworld > >::createGrid (  )  [inline, virtual]

finalize grid creation and hand over the grid

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

Returns:
a pointer to the newly created grid
Note:
The caller takes responsibility of freeing the memory allocated for the grid.
ALBERTA's grid factory provides a static method for freeing the grid (destroyGrid).

Implements Dune::GridFactoryInterface< AlbertaGrid< dim, dimworld > >.

References Dune::GridFactoryInterface< GridType >::dimension, and Dune::QuadratureType::Grid.

template<int dim, int dimworld>
static void Dune::GridFactory< AlbertaGrid< dim, dimworld > >::destroyGrid ( Grid grid  )  [inline, static]

destroy a grid previously obtain from this factory

Parameters:
[in] grid pointer to the grid to destroy
template<int dim, int dimworld>
virtual void Dune::GridFactory< AlbertaGrid< dim, dimworld > >::insertBoundary ( int  element,
int  face,
int  id 
) [inline, virtual]

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

Parameters:
[in] element index of the element, the face belongs to
[in] face local number of the face within the element
[in] id boundary id to assign to the face
Note:
ALBERTA supports only boundary id in the range 1,...,127.
template<int dim, int dimworld>
virtual void Dune::GridFactory< AlbertaGrid< dim, dimworld > >::insertBoundaryProjection ( const DuneProjection projection  )  [inline, virtual]

insert a global (boundary) projection into the macro grid

Parameters:
[in] projection global (boundary) projection
Note:
The grid takes control of the projection object.
template<int dim, int dimworld>
virtual void Dune::GridFactory< AlbertaGrid< dim, dimworld > >::insertBoundaryProjection ( const GeometryType &  type,
const std::vector< unsigned int > &  vertices,
const DuneProjection projection 
) [inline, virtual]

insert a boundary projection into the macro grid

Parameters:
[in] type geometry type of boundary face
[in] vertices vertices of the boundary face
[in] projection boundary projection
Note:
The grid takes control of the projection object.

References Dune::GridFactoryInterface< GridType >::dimension.

virtual void Dune::GridFactoryInterface< AlbertaGrid< dim, dimworld > >::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] vertices the indices of the vertices of the segment
[in] boundarySegment user defined implementation of the boundary segment's geometry
template<int dim, int dimworld>
virtual void Dune::GridFactory< AlbertaGrid< dim, dimworld > >::insertBoundarySegment ( const std::vector< unsigned int > &  vertices  )  [inline, virtual]

insert a boundary segment into the macro grid

Only influences the ordering of the boundary segments

Parameters:
[in] vertices vertex indices of boundary face

Implements Dune::GridFactoryInterface< AlbertaGrid< dim, dimworld > >.

References Dune::GridFactoryInterface< GridType >::dimension.

template<int dim, int dimworld>
virtual void Dune::GridFactory< AlbertaGrid< dim, dimworld > >::insertBoundarySegment ( const std::vector< unsigned int > &  vertices,
const shared_ptr< BoundarySegment > &  boundarySegment 
) [inline, virtual]

insert a shaped boundary segment into the macro grid

Parameters:
[in] vertices vertex indices of boundary face
[in] boundarySegment geometric realization of shaped boundary

References Dune::GridFactoryInterface< GridType >::dimension.

virtual void Dune::GridFactoryInterface< AlbertaGrid< dim, dimworld > >::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:
type The GeometryType of the new element
vertices The vertices of the new element, using the DUNE numbering
elementParametrization A 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<int dim, int dimworld>
virtual void Dune::GridFactory< AlbertaGrid< dim, dimworld > >::insertElement ( const GeometryType &  type,
const std::vector< unsigned int > &  vertices 
) [inline, virtual]

insert an element into the macro grid

Parameters:
[in] type GeometryType of the new element
[in] vertices indices of the element vertices (in DUNE numbering)

Implements Dune::GridFactoryInterface< AlbertaGrid< dim, dimworld > >.

References Dune::GridFactoryInterface< GridType >::dimension.

template<int dim, int dimworld>
void Dune::GridFactory< AlbertaGrid< dim, dimworld > >::insertFaceTransformation ( const WorldMatrix matrix,
const WorldVector shift 
) [inline]

add a face transformation (for periodic identification)

A face transformation is an affine mapping T from world coordinates to world coordinates. ALBERTA periodically identifies two faces f and g if T( f ) = g or T( g ) = f.

Parameters:
[in] matrix matrix describing the linear part of T
[in] shift vector describing T( 0 )
Note:
ALBERTA requires the matrix to be orthogonal.
ALBERTA automatically adds the inverse transformation.

References Dune::Alberta::abs().

template<int dim, int dimworld>
virtual unsigned int Dune::GridFactory< AlbertaGrid< dim, dimworld > >::insertionIndex ( const typename Codim< dimension >::Entity entity  )  const [inline, virtual]

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] entity entity whose insertion index is requested
Returns:
insertion index of the entity

Reimplemented from Dune::GridFactoryInterface< AlbertaGrid< dim, dimworld > >.

References Dune::GridFactoryInterface< GridType >::insertionIndex().

template<int dim, int dimworld>
virtual unsigned int Dune::GridFactory< AlbertaGrid< dim, dimworld > >::insertionIndex ( const typename Grid::LeafIntersection intersection  )  const [inline, virtual]
virtual unsigned int Dune::GridFactoryInterface< AlbertaGrid< dim, dimworld > >::insertionIndex ( const typename AlbertaGrid< dim, dimworld > ::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] intersection intersection 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).
template<int dim, int dimworld>
virtual unsigned int Dune::GridFactory< AlbertaGrid< dim, dimworld > >::insertionIndex ( const typename Codim< 0 >::Entity entity  )  const [inline, virtual]

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] entity entity whose insertion index is requested
Returns:
insertion index of the entity

Reimplemented from Dune::GridFactoryInterface< AlbertaGrid< dim, dimworld > >.

References Dune::GridFactoryInterface< GridType >::insertionIndex().

virtual void Dune::GridFactoryInterface< AlbertaGrid< dim, dimworld > >::insertVertex ( const FieldVector< ctype, dimworld > &  pos  )  [pure virtual, inherited]

Insert a vertex into the coarse grid.

template<int dim, int dimworld>
virtual void Dune::GridFactory< AlbertaGrid< dim, dimworld > >::insertVertex ( const WorldVector pos  )  [inline, virtual]

insert a vertex into the macro grid

Parameters:
[in] pos position of the vertex (in world coordinates)
template<int dim, int dimworld>
void Dune::GridFactory< AlbertaGrid< dim, dimworld > >::markLongestEdge (  )  [inline]

mark the longest edge as refinemet edge

Marking the longest edge avoids cycles in the recursive bisection algorithm, if the longest edge of each element is unique. It also makes sure the angles degenerate least. It can, hoowever, produce more nonlocal refinements than necessary. Therefore this feature is disabled by default.

virtual bool Dune::GridFactoryInterface< AlbertaGrid< dim, dimworld > >::wasInserted ( const typename AlbertaGrid< dim, dimworld > ::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] intersection intersection in question
Returns:
true, if the intersection was inserted
template<int dim, int dimworld>
virtual bool Dune::GridFactory< AlbertaGrid< dim, dimworld > >::wasInserted ( const typename Grid::LeafIntersection intersection  )  const [inline, virtual]
template<int dim, int dimworld>
virtual bool Dune::GridFactory< AlbertaGrid< dim, dimworld > >::write ( const std::string &  filename  )  [inline, virtual]

write out the macro triangulation in native grid file format

The grid is written in human readable form (ascii).

Parameters:
[in] filename name of the file to write to
Returns:
true on success
template<int dim, int dimworld>
template<GrapeIOFileFormatType type>
bool Dune::GridFactory< AlbertaGrid< dim, dimworld > >::write ( const std::string &  filename  )  [inline]

write out the macro triangulation in native grid file format

Template Parameters:
type type of file to write (either ascii or xdr)
Parameters:
[in] filename name of the file to write to
Returns:
true on success

References Dune::GridFactoryInterface< GridType >::dimension, Dune::pgm, and Dune::xdr.


Member Data Documentation

template<int dim, int dimworld>
const int Dune::GridFactory< AlbertaGrid< dim, dimworld > >::dimension = Grid::dimension [static]

dimension of the grid

Reimplemented from Dune::GridFactoryInterface< AlbertaGrid< dim, dimworld > >.

template<int dim, int dimworld>
const int Dune::GridFactory< AlbertaGrid< dim, dimworld > >::dimensionworld = Grid::dimensionworld [static]

dimension of the world

template<int dim, int dimworld>
const bool Dune::GridFactory< AlbertaGrid< dim, dimworld > >::supportPeriodicity = MacroData::supportPeriodicity [static]

is the factory able to create periodic meshes?

template<int dim, int dimworld>
const bool Dune::GridFactory< AlbertaGrid< dim, dimworld > >::supportsBoundaryIds = true [static]

are boundary ids supported by this factory?


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

Generated on Fri Apr 29 2011 with Doxygen (ver 1.7.1) [doxygen-log,error-log].