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

#include <gridfactory.hh>

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

Dune::GridFactoryInterface< GridType >

List of all members.


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:


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

Public Member Functions

 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 insertFaceTransformation (const WorldMatrix &matrix, const WorldVector &shift)
 add a face transformation (for periodic identification)
GridcreateGrid (const std::string &gridName, bool markLongestEdge=false)
 finalize grid creation and hand over the grid
virtual 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 void insertVertex (const FieldVector< ctype, dimworld > &pos)=0
 Insert a vertex into the coarse grid.
virtual void insertBoundarySegment (const std::vector< unsigned int > vertices, const BoundarySegment< dimworld > *boundarySegment)
 Method to insert an arbitrarily shaped boundary segment into a coarse grid.

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 = (DUNE_ALBERTA_VERSION >= 0x200)
 are boundary ids supported by this factory?
static const bool supportPeriodicity = MacroData::supportPeriodicity
 is the factory able to create periodic meshes?

Constructor & Destructor Documentation

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

default constructor


Member Function Documentation

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>
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< GridType >.

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 > >::insertFaceTransformation ( const WorldMatrix matrix,
const WorldVector shift 
) [inline, virtual]

add a face transformation (for periodic identification)

A face transformation is an affine mapping T from world coordinates to world coordinates. ALBERTA periodically identifies to faces f and g is 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.

template<int dim, int dimworld>
Grid* Dune::GridFactory< AlbertaGrid< dim, dimworld > >::createGrid ( const std::string &  gridName,
bool  markLongestEdge = false 
) [inline]

finalize grid creation and hand over the grid

This version of createGrid is original to the AlbertaGrid grid factroy. Besides allowing to specity a grid name, it provides the possibility mark the longest edge of each macro element as the refinement edge for the recursive bisection algorithms.

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.

Parameters:
[in] gridName name for the grid
[in] markLongestEdge mark longest edges for refinement (defaults to false)
Returns:
a pointer to the newly created grid
Note:
The caller takes responsibility of creeing the memory allocated for the grid.

ALBERTA's grid factory provides a static method for freeing the grid (destroyGrid).

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

finalize grid creation and hand over the grid

Returns:
a pointer to the newly created grid
Note:
The caller takes responsibility of creeing the memory allocated for the grid.

ALBERTA's grid factory provides a static method for freeing the grid (destroyGrid).

Implements Dune::GridFactoryInterface< GridType >.

References Dune::GridFactory< GridType >::createGrid().

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>
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::xdr.

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<class GridType>
virtual void Dune::GridFactoryInterface< GridType >::insertBoundarySegment ( const std::vector< unsigned int >  vertices,
const BoundarySegment< dimworld > *  boundarySegment 
) [inline, virtual, inherited]

Method to insert an arbitrarily shaped boundary segment into a coarse grid.

Parameters:
vertices The indices of the vertices of the segment
boundarySegment Class implementing the geometry of the boundary segment. The grid object takes control of this object and deallocates it when destructing itself.

Reimplemented in Dune::GridFactory< UGGrid< dimworld > >.


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

Generated on Thu Apr 2 10:40:46 2009 for dune-grid by  doxygen 1.5.6