#include <gridfactory.hh>
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) | |
Grid * | createGrid (const std::string &gridName, bool markLongestEdge=false) |
finalize grid creation and hand over the grid | |
virtual Grid * | createGrid () |
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? |
Dune::GridFactory< AlbertaGrid< dim, dimworld > >::GridFactory | ( | ) | [inline] |
default constructor
virtual void Dune::GridFactory< AlbertaGrid< dim, dimworld > >::insertVertex | ( | const WorldVector & | pos | ) | [inline, virtual] |
insert a vertex into the macro grid
[in] | pos | position of the vertex (in world coordinates) |
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
[in] | type | GeometryType of the new element |
[in] | vertices | indices of the element vertices (in DUNE numbering) |
Implements Dune::GridFactoryInterface< GridType >.
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)
[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 |
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.
[in] | matrix | matrix describing the linear part of T |
[in] | shift | vector describing T( 0 ) |
ALBERTA automatically adds the inverse transformation.
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.
[in] | gridName | name for the grid |
[in] | markLongestEdge | mark longest edges for refinement (defaults to false ) |
ALBERTA's grid factory provides a static method for freeing the grid (destroyGrid).
virtual Grid* Dune::GridFactory< AlbertaGrid< dim, dimworld > >::createGrid | ( | ) | [inline, virtual] |
finalize grid creation and hand over the grid
ALBERTA's grid factory provides a static method for freeing the grid (destroyGrid).
Implements Dune::GridFactoryInterface< GridType >.
References Dune::GridFactory< GridType >::createGrid().
static void Dune::GridFactory< AlbertaGrid< dim, dimworld > >::destroyGrid | ( | Grid * | grid | ) | [inline, static] |
destroy a grid previously obtain from this factory
[in] | grid | pointer to the grid to destroy |
bool Dune::GridFactory< AlbertaGrid< dim, dimworld > >::write | ( | const std::string & | filename | ) | [inline] |
write out the macro triangulation in native grid file format
type | type of file to write (either ascii or xdr) |
[in] | filename | name of the file to write to |
true
on success References Dune::xdr.
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).
[in] | filename | name of the file to write to |
true
on success 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.
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 > >.