dune-foamgrid
2.8-git
|
An implementation of the Dune grid interface: a 1- or 2-dimensional simplicial grid in an n-dimensional world. More...
#include <dune/foamgrid/foamgrid.hh>
Public Types | |
typedef FoamGridFamily< dimgrid, dimworld, ct > | GridFamily |
FoamGrid is only implemented for 1 and 2 dimension. More... | |
typedef FoamGridFamily< dimgrid, dimworld, ct >::Traits | Traits |
Exports various types belonging to this grid class. More... | |
typedef ct | ctype |
The type used to store coordinates. More... | |
Public Member Functions | |
FoamGrid () | |
Constructor, constructs an empty grid. More... | |
~FoamGrid () | |
Destructor. More... | |
int | maxLevel () const |
template<int codim> | |
Traits::template Codim< codim >::LevelIterator | lbegin (int level) const |
Iterator to first entity of given codim on level. More... | |
template<int codim> | |
Traits::template Codim< codim >::LevelIterator | lend (int level) const |
one past the end on this level More... | |
template<int codim, PartitionIteratorType PiType> | |
Traits::template Codim< codim >::template Partition< PiType >::LevelIterator | lbegin (int level) const |
Iterator to first entity of given codim on level. More... | |
template<int codim, PartitionIteratorType PiType> | |
Traits::template Codim< codim >::template Partition< PiType >::LevelIterator | lend (int level) const |
one past the end on this level More... | |
template<int codim> | |
Traits::template Codim< codim >::LeafIterator | leafbegin () const |
Iterator to first leaf entity of given codim. More... | |
template<int codim> | |
Traits::template Codim< codim >::LeafIterator | leafend () const |
one past the end of the sequence of leaf entities More... | |
template<int codim, PartitionIteratorType PiType> | |
Traits::template Codim< codim >::template Partition< PiType >::LeafIterator | leafbegin () const |
Iterator to first leaf entity of given codim. More... | |
template<int codim, PartitionIteratorType PiType> | |
Traits::template Codim< codim >::template Partition< PiType >::LeafIterator | leafend () const |
one past the end of the sequence of leaf entities More... | |
int | size (int level, int codim) const |
Number of grid entities per level and codim. More... | |
int | size (int codim) const |
number of leaf entities per codim in this process More... | |
int | size (int level, GeometryType type) const |
number of entities per level, codim and geometry type in this process More... | |
int | size (GeometryType type) const |
number of leaf entities per codim and geometry type in this process More... | |
size_t | numBoundarySegments () const |
The number of boundary edges on the coarsest level. More... | |
const Traits::GlobalIdSet & | globalIdSet () const |
Access to the GlobalIdSet. More... | |
const Traits::LocalIdSet & | localIdSet () const |
Access to the LocalIdSet. More... | |
const Traits::LevelIndexSet & | levelIndexSet (int level) const |
Access to the LevelIndexSets. More... | |
const Traits::LeafIndexSet & | leafIndexSet () const |
Access to the LeafIndexSet. More... | |
template<class EntitySeed > | |
Traits::template Codim< EntitySeed::codimension >::Entity | entity (const EntitySeed &seed) const |
Create an Entity from an EntitySeed. More... | |
Grid Refinement Methods | |
void | globalRefine (int refCount=1) |
Refine the grid uniformly. More... | |
bool | mark (int refCount, const typename Traits::template Codim< 0 >::Entity &e) |
Mark entity for refinement. More... | |
int | getMark (const typename Traits::template Codim< 0 >::Entity &e) const |
Return refinement mark for entity. More... | |
bool | preAdapt () |
Book-keeping routine to be called before adaptation. More... | |
bool | adapt () |
Triggers the grid refinement process. More... | |
void | postAdapt () |
Clean up refinement markers. More... | |
void | setPosition (const typename Traits::template Codim< dimgrid >::Entity &e, const FieldVector< ctype, dimworld > &pos) |
Sets a (leaf) vertex to a new position. More... | |
Grid Growth Methods | |
unsigned int | insertVertex (const FieldVector< ctype, dimworld > &pos) |
Add new vertex to be added the grid. More... | |
unsigned int | insertElement (const GeometryType &type, const std::vector< unsigned int > &vertices) |
Add a new element to be added to the grid. More... | |
DUNE_NO_DEPRECATED_BEGIN unsigned int | insertElement (const GeometryType &type, const std::vector< unsigned int > &vertices, const std::shared_ptr< VirtualFunction< FieldVector< ctype, dimgrid >, FieldVector< ctype, dimworld > > > &elementParametrization) |
Add a new element to be added to the grid. More... | |
DUNE_NO_DEPRECATED_END unsigned int | insertElement (const GeometryType &type, const std::vector< unsigned int > &vertices, std::function< FieldVector< ctype, dimworld >(FieldVector< ctype, dimgrid >)> elementParametrization) |
Add a new element to be added to the grid. More... | |
void | removeElement (const typename Traits::template Codim< 0 >::Entity &e) |
Mark an element for removal from the grid. More... | |
bool | preGrow () |
Book-keeping routine to be called before growth. More... | |
bool | grow () |
Triggers the grid growth process. More... | |
void | postGrow () |
Clean up isNew markers. More... | |
unsigned int | growthInsertionIndex (const typename Traits::template Codim< 0 >::Entity &e) const |
The index of insertion if the element was created in the current growth step. If this is the first element added to the growth queue by calling insertElement the index is 0 and so on. The index will be valid until postGrow is called. More... | |
unsigned int | growthInsertionIndex (const typename Traits::template Codim< dimgrid >::Entity &e) const |
The index of insertion if the vertex was created in the current growth step. If this is the first vertex added to the growth queue by calling insertVertex the index is 0 and so on. The index will be valid until postGrow is called. More... | |
Methods for parallel computations | |
unsigned int | overlapSize (int codim) const |
Size of the overlap on the leaf level. More... | |
unsigned int | ghostSize (int codim) const |
Size of the ghost cell layer on the leaf level. More... | |
unsigned int | overlapSize (int level, int codim) const |
Size of the overlap on a given level. More... | |
unsigned int | ghostSize (int level, int codim) const |
Size of the ghost cell layer on a given level. More... | |
template<class DataHandle > | |
bool | loadBalance (DataHandle &data) |
Distributes this grid over the available nodes in a distributed machine. More... | |
bool | loadBalance () |
template<class T , template< class > class P, int codim> | |
void | communicate (T &t, InterfaceType iftype, CommunicationDirection dir, int level) const |
The communication interface. More... | |
template<class DataHandle > | |
void | communicate (DataHandle &data, InterfaceType iftype, CommunicationDirection dir, int level) const |
template<class DataHandle > | |
void | communicate (DataHandle &data, InterfaceType iftype, CommunicationDirection dir) const |
const Traits::CollectiveCommunication & | comm () const |
An implementation of the Dune grid interface: a 1- or 2-dimensional simplicial grid in an n-dimensional world.
dimgrid | Dimension of the grid; must be either 1 or 2 |
dimworld | Dimension of the world space |
typedef ct Dune::FoamGrid< dimgrid, dimworld, ct >::ctype |
The type used to store coordinates.
typedef FoamGridFamily<dimgrid, dimworld, ct> Dune::FoamGrid< dimgrid, dimworld, ct >::GridFamily |
FoamGrid is only implemented for 1 and 2 dimension.
type of the used GridFamily for this grid
typedef FoamGridFamily<dimgrid, dimworld, ct>::Traits Dune::FoamGrid< dimgrid, dimworld, ct >::Traits |
Exports various types belonging to this grid class.
|
inline |
Constructor, constructs an empty grid.
|
inline |
Destructor.
bool Dune::FoamGrid< dimgrid, dimworld, ctype >::adapt |
Triggers the grid refinement process.
|
inline |
dummy collective communication
|
inline |
|
inline |
The new communication interface communicate objects for all codims on a given level
|
inline |
The communication interface.
T | array class holding data associated with the entities |
P | type used to gather/scatter data in and out of the message buffer |
codim | communicate entites of given codim |
if | one of the predifined interface types, throws error if it is not implemented |
level | communicate for entities on the given level |
Implements a generic communication function sending an object of type P for each entity in the intersection of two processors. P has two methods gather and scatter that implement the protocol. Therefore P is called the "protocol class".
|
inline |
Create an Entity from an EntitySeed.
|
inline |
Return refinement mark for entity.
|
inline |
Size of the ghost cell layer on the leaf level.
|
inline |
Size of the ghost cell layer on a given level.
|
inline |
Access to the GlobalIdSet.
void Dune::FoamGrid< dimgrid, dimworld, ctype >::globalRefine | ( | int | refCount = 1 | ) |
Refine the grid uniformly.
refCount | Number of times the grid is to be refined uniformly |
bool Dune::FoamGrid< dimgrid, dimworld, ctype >::grow |
Triggers the grid growth process.
|
inline |
The index of insertion if the element was created in the current growth step. If this is the first element added to the growth queue by calling insertElement the index is 0 and so on. The index will be valid until postGrow is called.
|
inline |
The index of insertion if the vertex was created in the current growth step. If this is the first vertex added to the growth queue by calling insertVertex the index is 0 and so on. The index will be valid until postGrow is called.
|
inline |
Add a new element to be added to the grid.
type | The GeometryType of the new element |
vertices | The vertices of the new element, using the DUNE numbering |
|
inline |
Add a new element to be added to the grid.
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 |
|
inline |
Add a new element to be added to the grid.
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 |
|
inline |
Add new vertex to be added the grid.
pos | The position vector of the vertex |
|
inline |
Iterator to first entity of given codim on level.
|
inline |
Iterator to first entity of given codim on level.
|
inline |
Iterator to first leaf entity of given codim.
|
inline |
Iterator to first leaf entity of given codim.
|
inline |
one past the end of the sequence of leaf entities
|
inline |
one past the end of the sequence of leaf entities
|
inline |
Access to the LeafIndexSet.
|
inline |
one past the end on this level
|
inline |
one past the end on this level
|
inline |
Access to the LevelIndexSets.
|
inline |
|
inline |
Distributes this grid over the available nodes in a distributed machine.
|
inline |
Access to the LocalIdSet.
|
inline |
Mark entity for refinement.
This only works for entities of codim 0. The parameter is currently ignored
|
inline |
Return maximum level defined in this grid. Levels are numbered 0 ... maxlevel with 0 the coarsest level.
|
inline |
The number of boundary edges on the coarsest level.
|
inline |
Size of the overlap on the leaf level.
|
inline |
Size of the overlap on a given level.
void Dune::FoamGrid< dimgrid, dimworld, ctype >::postAdapt |
Clean up refinement markers.
void Dune::FoamGrid< dimgrid, dimworld, ctype >::postGrow |
Clean up isNew markers.
bool Dune::FoamGrid< dimgrid, dimworld, ctype >::preAdapt |
Book-keeping routine to be called before adaptation.
bool Dune::FoamGrid< dimgrid, dimworld, ctype >::preGrow |
Book-keeping routine to be called before growth.
|
inline |
Mark an element for removal from the grid.
e | The codim 0 entity to be removed from the grid |
void Dune::FoamGrid< dimgrid, dimworld, ctype >::setPosition | ( | const typename Traits::template Codim< dimgrid >::Entity & | e, |
const FieldVector< ctype, dimworld > & | pos | ||
) |
Sets a (leaf) vertex to a new position.
e | The codim dimgrid entity (vertex) to be moved. Note: The vertex must be a leaf vertex. The implementation stores copies of vertices for each level they exist on. Changing a vertex' position changes its position on all coarser grid levels, too! We could not think of an application for moving non-leaf vertices, write us if you need that feature. |
pos | The new global position of the vertex |
|
inline |
number of leaf entities per codim and geometry type in this process
|
inline |
number of leaf entities per codim in this process
|
inline |
number of entities per level, codim and geometry type in this process
|
inline |
Number of grid entities per level and codim.