Dune Core Modules (2.4.1)
[ provides Dune::Grid ] More...
#include <dune/grid/yaspgrid.hh>
Public Types | |
typedef Coordinates::ctype | ctype |
Type used for coordinates. | |
typedef ReservedVector< YGridLevel, 32 >::const_iterator | YGridLevelIterator |
Iterator over the grid levels. | |
typedef YaspGridFamily< dim, Coordinates > | GridFamily |
the GridFamily of this grid | |
Exported constants | |
enum | |
A constant that exports the template parameter dim. | |
enum | |
A constant that exports the template parameter dimworld. | |
Exported types | |
typedef Partition< All_Partition >::LevelGridView | LevelGridView |
View types for All_Partition. | |
typedef Partition< All_Partition >::LeafGridView | LeafGridView |
typedef GridFamily::Traits::LeafIntersection | LeafIntersection |
A type that is a model of Dune::Intersection, an intersections of two codimension 1 of two codimension 0 entities in the leaf view. | |
typedef GridFamily::Traits::LevelIntersection | LevelIntersection |
A type that is a model of Dune::Intersection, an intersections of two codimension 1 of two codimension 0 entities in a level view. | |
typedef GridFamily::Traits::LeafIntersectionIterator | LeafIntersectionIterator |
A type that is a model of Dune::IntersectionIterator which is an iterator that allows to examine, but not to modify, the intersections of codimension 1 of an leaf element (entity of codimension 0) with other leaf elements. | |
typedef GridFamily::Traits::LevelIntersectionIterator | LevelIntersectionIterator |
A type that is a model of Dune::IntersectionIterator which is an iterator that allows to examine, but not to modify, the intersections of codimension 1 of an element (entity of codimension 0) with other elements on the same level. | |
typedef GridFamily::Traits::HierarchicIterator | HierarchicIterator |
A type that is a model of Dune::HierarchicIterator A type of iterator that allows to examine, but not to modify, entities of codimension 0 that result from refinement of an entity of codimension 0. | |
typedef GridFamily::Traits::LevelIndexSet | LevelIndexSet |
A type that is a model of Dune::IndexSet which provides a consecutive, but non persistent, numbering for entities on a grid level. | |
typedef GridFamily::Traits::LeafIndexSet | LeafIndexSet |
A type that is a model of Dune::IndexSet which provides a consecutive, but non persistent, numbering for entities in the leaf grid. | |
typedef GridFamily::Traits::GlobalIdSet | GlobalIdSet |
A type that is a model of Dune::IdSet which provides a unique and persistent numbering for all entities in the grid. The numbering is unique over all processes over which the grid is partitioned. The numbering is not necessarily consecutive. | |
typedef GridFamily::Traits::LocalIdSet | LocalIdSet |
A type that is a model of Dune::IdSet which provides a unique and persistent numbering for all entities in the grid. The numbering is only unique in a single process and it is not necessarily consecutive. | |
typedef GridFamily::Traits::CollectiveCommunication | CollectiveCommunication |
A type that is a model of Dune::CollectiveCommunication. It provides a portable way for collective communication on the set of processes used by the grid. | |
Public Member Functions | |
const Torus< CollectiveCommunicationType, dim > & | torus () const |
return reference to torus | |
int | globalSize (int i) const |
return number of cells on finest level in given direction on all processors | |
iTupel | globalSize () const |
return number of cells on finest level on all processors | |
int | levelSize (int l, int i) const |
return size of the grid (in cells) on level l in direction i | |
iTupel | levelSize (int l) const |
return size vector of the grid (in cells) on level l | |
bool | isPeriodic (int i) const |
return whether the grid is periodic in direction i | |
YGridLevelIterator | begin () const |
return iterator pointing to coarsest level | |
YGridLevelIterator | begin (int i) const |
return iterator pointing to given level | |
YGridLevelIterator | end () const |
return iterator pointing to one past the finest level | |
YaspGrid (Dune::FieldVector< ctype, dim > L, std::array< int, dim > s, std::bitset< dim > periodic=std::bitset< dim >(0ULL), int overlap=1, CollectiveCommunicationType comm=CollectiveCommunicationType(), const YLoadBalance< dim > *lb=defaultLoadbalancer()) | |
YaspGrid (Dune::FieldVector< ctype, dim > lowerleft, Dune::FieldVector< ctype, dim > upperright, std::array< int, dim > s, std::bitset< dim > periodic=std::bitset< dim >(0ULL), int overlap=1, CollectiveCommunicationType comm=CollectiveCommunicationType(), const YLoadBalance< dim > *lb=defaultLoadbalancer()) | |
YaspGrid (std::array< std::vector< ctype >, dim > coords, std::bitset< dim > periodic=std::bitset< dim >(0ULL), int overlap=1, CollectiveCommunicationType comm=CollectiveCommunicationType(), const YLoadBalance< dim > *lb=defaultLoadbalancer()) | |
Standard constructor for a tensorproduct YaspGrid. More... | |
YaspGrid (Dune::MPIHelper::MPICommunicator comm, Dune::FieldVector< ctype, dim > L, std::array< int, dim > s, std::bitset< dim > periodic, int overlap, const YLoadBalance< dim > *lb=defaultLoadbalancer()) | |
YaspGrid (Dune::MPIHelper::MPICommunicator comm, std::array< std::vector< ctype >, dim > coords, std::bitset< dim > periodic, int overlap, const YLoadBalance< dim > *lb=defaultLoadbalancer()) | |
Constructor for a tensorproduct YaspGrid. More... | |
int | maxLevel () const |
void | globalRefine (int refCount) |
refine the grid refCount times. | |
void | refineOptions (bool keepPhysicalOverlap) |
set options for refinement More... | |
bool | mark (int refCount, const typename Traits::template Codim< 0 >::Entity &e) |
Marks an entity to be refined/coarsened in a subsequent adapt. More... | |
int | getMark (const typename Traits::template Codim< 0 >::Entity &e) const |
returns adaptation mark for given entity More... | |
bool | adapt () |
map adapt to global refine | |
bool | preAdapt () |
returns true, if the grid will be coarsened | |
void | postAdapt () |
clean up some markers | |
template<int cd, PartitionIteratorType pitype> | |
Traits::template Codim< cd >::template Partition< pitype >::LevelIterator | lbegin (int level) const |
one past the end on this level | |
template<int cd, PartitionIteratorType pitype> | |
Traits::template Codim< cd >::template Partition< pitype >::LevelIterator | lend (int level) const |
Iterator to one past the last entity of given codim on level for partition type. | |
template<int cd> | |
Traits::template Codim< cd >::template Partition< All_Partition >::LevelIterator | lbegin (int level) const |
version without second template parameter for convenience | |
template<int cd> | |
Traits::template Codim< cd >::template Partition< All_Partition >::LevelIterator | lend (int level) const |
version without second template parameter for convenience | |
template<int cd, PartitionIteratorType pitype> | |
Traits::template Codim< cd >::template Partition< pitype >::LeafIterator | leafbegin () const |
return LeafIterator which points to the first entity in maxLevel | |
template<int cd, PartitionIteratorType pitype> | |
Traits::template Codim< cd >::template Partition< pitype >::LeafIterator | leafend () const |
return LeafIterator which points behind the last entity in maxLevel | |
template<int cd> | |
Traits::template Codim< cd >::template Partition< All_Partition >::LeafIterator | leafbegin () const |
return LeafIterator which points to the first entity in maxLevel | |
template<int cd> | |
Traits::template Codim< cd >::template Partition< All_Partition >::LeafIterator | leafend () const |
return LeafIterator which points behind the last entity in maxLevel | |
template<int cd, PartitionIteratorType pitype> | |
YaspLevelIterator< cd, pitype, GridImp > | levelbegin (int level) const |
one past the end on this level | |
template<int cd, PartitionIteratorType pitype> | |
YaspLevelIterator< cd, pitype, GridImp > | levelend (int level) const |
Iterator to one past the last entity of given codim on level for partition type. | |
Traits::template Codim< codim >::LevelIterator | DUNE_DEPRECATED_MSG ("The method lbegin( level ) is superseded by levelGridView( level ).begin.") lbegin(int level) const |
Iterator to first entity of given codim on level for PartitionType All_Partition. | |
Traits::template Codim< codim >::LevelIterator | DUNE_DEPRECATED_MSG ("The method lend( level ) is superseded by levelGridView( level ).end.") lend(int level) const |
one past the end on this level for PartitionType All_Partition | |
Traits::template Codim< codim >::template Partition< pitype >::LevelIterator | DUNE_DEPRECATED_MSG ("The method lbegin( level ) is superseded by levelGridView( level ).begin.") lbegin(int level) const |
Iterator to first entity of given codim on level. | |
Traits::template Codim< codim >::template Partition< pitype >::LevelIterator | DUNE_DEPRECATED_MSG ("The method lend( level ) is superseded by levelGridView( level ).end.") lend(int level) const |
one past the end on this level | |
Traits::template Codim< codim >::LeafIterator | DUNE_DEPRECATED_MSG ("The method leafbegin() is superseded by leafGridView().begin.") leafbegin() const |
Iterator to first entity of given codim on leaf grid for PartitionType All_Partition. | |
Traits::template Codim< codim >::LeafIterator | DUNE_DEPRECATED_MSG ("The method leafend() is superseded by leafGridView().end.") leafend() const |
one past the end on the leaf grid for PartitionType All_Partition | |
Traits::template Codim< codim >::template Partition< pitype >::LeafIterator | DUNE_DEPRECATED_MSG ("The method leafbegin() is superseded by leafGridView().begin.") leafbegin() const |
Iterator to first entity of given codim on leaf grid. | |
Traits::template Codim< codim >::template Partition< pitype >::LeafIterator | DUNE_DEPRECATED_MSG ("The method leafend() is superseded by leafGridView().end.") leafend() const |
one past the end on the leaf level grid | |
Traits::template Partition< pitype >::LevelGridView | levelGridView (int level) const |
View for a grid level. | |
Traits::template Partition< All_Partition >::LevelGridView | levelGridView (int level) const |
View for a grid level for All_Partition. | |
Traits::template Partition< pitype >::LeafGridView | leafGridView () const |
View for the leaf grid. | |
Traits::template Partition< All_Partition >::LeafGridView | leafGridView () const |
View for the leaf grid for All_Partition. | |
bool | mark (int refCount, const typename Traits ::template Codim< 0 >::Entity &e) |
Marks an entity to be refined/coarsened in a subsequent adapt. More... | |
int | ghostSize (int level, int codim) const |
ghostSize is zero by default | |
int | ghostSize (int codim) const |
ghostSize is zero by default | |
int | overlapSize (int level, int codim) const |
overlapSize is zero by default | |
int | overlapSize (int codim) const |
overlapSize is zero by default | |
void | communicate (CommDataHandleIF< DataHandleImp, DataTypeImp > &data, InterfaceType iftype, CommunicationDirection dir, int level) const |
void | communicate (CommDataHandleIF< DataHandleImp, DataTypeImp > &data, InterfaceType iftype, CommunicationDirection dir) const |
bool | loadBalance () |
default implementation of load balance does nothing and returns false | |
bool | loadBalance (DataHandle &data) |
default implementation of load balance does nothing and returns false | |
Iterators | |
Codim< cd >::template Partition< pitype >::LevelIterator | DUNE_DEPRECATED_MSG ("The method lbegin( level ) is superseded by levelGridView( level ).begin and will be removed after Dune 2.4.") lbegin(int level) const |
Iterator to first entity of given codim on level. | |
Codim< cd >::template Partition< pitype >::LevelIterator | DUNE_DEPRECATED_MSG ("The method lend( level ) is superseded by levelGridView( level ).end and will be removed after Dune 2.4.") lend(int level) const |
one past the end on this level | |
Codim< cd >::template Partition< pitype >::LeafIterator | DUNE_DEPRECATED_MSG ("The method leafbegin() is superseded by leafGridView().begin and will be removed after Dune 2.4.") leafbegin() const |
Iterator to first entity of given codim on leaf grid. | |
Codim< cd >::template Partition< pitype >::LeafIterator | DUNE_DEPRECATED_MSG ("The method leafend() is superseded by leafGridView().end and will be removed after Dune 2.4.") leafend() const |
one past the end on the leaf level grid | |
Parallel data distribution and communication | |
DUNE_DEPRECATED_MSG ("entityPointer() is deprecated and will be removed after the release of dune-grid 2.4. Use entity() instead to directly obtain an Entity object.") typename Codim< EntitySeed | |
obtain EntityPointer from EntitySeed. More... | |
const CollectiveCommunication & | comm () const |
return const reference to a collective communication object. The return type is a model of Dune::CollectiveCommunication. | |
const GridImp & | asImp () const |
Barton-Nackman trick. | |
Adaptivity and grid refinement | |
bool | mark (int refCount, const typename Codim< 0 >::Entity &e) |
Marks an entity to be refined/coarsened in a subsequent adapt. More... | |
int | getMark (const typename Codim< 0 >::Entity &e) const |
returns adaptation mark for given entity More... | |
Size methods | |
int | size (int level, int codim) const |
Return number of grid entities of a given codim on a given level in this process. | |
int | size (int codim) const |
Return number of leaf entities of a given codim in this process. | |
int | size (int level, GeometryType type) const |
Return number of entities per level and geometry type in this process. | |
int | size (GeometryType type) const |
Return number of leaf entities per geometry type in this process. | |
size_t | numBoundarySegments () const |
returns the number of boundary segments within the macro grid More... | |
Access to index and id sets | |
const GlobalIdSet & | globalIdSet () const |
return const reference to the grids global id set | |
const LocalIdSet & | localIdSet () const |
return const reference to the grids local id set | |
const LevelIndexSet & | levelIndexSet (int level) const |
return const reference to the grids level index set for level level | |
const LeafIndexSet & | leafIndexSet () const |
return const reference to the grids leaf index set | |
Protected Member Functions | |
void | makelevel (const Coordinates &coords, std::bitset< dim > periodic, iTupel o_interior, int overlap) |
Make a new YGridLevel structure. More... | |
void | intersections (const YGridComponent< Coordinates > &sendgrid, const YGridComponent< Coordinates > &recvgrid, std::deque< Intersection > &sendlist, std::deque< Intersection > &recvlist) |
Construct list of intersections with neighboring processors. More... | |
Static Protected Member Functions | |
static std::conditional< std::is_reference< InterfaceType >::value, typenamestd::add_lvalue_reference< typenameReturnImplementationType< typenamestd::remove_reference< InterfaceType >::type >::ImplementationType >::type, typenamestd::remove_const< typenameReturnImplementationType< typenamestd::remove_reference< InterfaceType >::type >::ImplementationType >::type >::type | getRealImplementation (InterfaceType &&i) |
return real implementation of interface class | |
Detailed Description
class Dune::YaspGrid< dim, Coordinates >
[ provides Dune::Grid ]
Provides a distributed structured cube mesh.
YaspGrid stands for yet another structured parallel grid. It implements the dune grid interface for structured grids with arbitrary overlap (including zero), periodic boundaries, and a fast implementation allowing on-the-fly computations.
YaspGrid supports three coordinate modes: EquidistantCoordinates, EquidistantOffsetCoordinates, and Dune::TensorProductCoordinates.
- Template Parameters
-
dim The dimension of the grid and its surrounding world Coordinates The coordinate mode of the grid.
Constructor & Destructor Documentation
◆ YaspGrid() [1/5]
|
inline |
Standard constructor for an equidistant YaspGrid
- Parameters
-
L extension of the domain s number of cells on coarse mesh in each direction periodic tells if direction is periodic or not overlap size of overlap on coarsest grid (same in all directions) comm the collective communication object for this grid. An MPI communicator can be given here. lb pointer to an overloaded YLoadBalance instance
References Dune::Grid< dim, dimworld, Coordinates::ctype, YaspGridFamily< dim, EquidistantCoordinates< double, dim > > >::comm(), DUNE_THROW, Dune::YaspGrid< dim, Coordinates >::makelevel(), and Dune::ReservedVector< T, n >::resize().
◆ YaspGrid() [2/5]
|
inline |
Constructor for an equidistant YaspGrid with non-trivial origin
- Parameters
-
lowerleft Lower left corner of the domain upperright Upper right corner of the domain s number of cells on coarse mesh in each direction periodic tells if direction is periodic or not overlap size of overlap on coarsest grid (same in all directions) comm the collective communication object for this grid. An MPI communicator can be given here. lb pointer to an overloaded YLoadBalance instance
References Dune::Grid< dim, dimworld, Coordinates::ctype, YaspGridFamily< dim, EquidistantCoordinates< double, dim > > >::comm(), DUNE_THROW, Dune::YaspGrid< dim, Coordinates >::makelevel(), and Dune::ReservedVector< T, n >::resize().
◆ YaspGrid() [3/5]
|
inline |
Standard constructor for a tensorproduct YaspGrid.
- Parameters
-
coords coordinate vectors to be used for coarse grid periodic tells if direction is periodic or not overlap size of overlap on coarsest grid (same in all directions) comm the collective communication object for this grid. An MPI communicator can be given here. lb pointer to an overloaded YLoadBalance instance
◆ YaspGrid() [4/5]
|
inline |
Constructor
- Parameters
-
comm MPI communicator where this mesh is distributed to L extension of the domain s number of cells on coarse mesh in each direction periodic tells if direction is periodic or not overlap size of overlap on coarsest grid (same in all directions) lb pointer to an overloaded YLoadBalance instance
- Deprecated:
- This constructor is deprecated and will be removed after the release of dune-grid-2.4
References Dune::YaspGrid< dim, Coordinates >::makelevel(), and Dune::ReservedVector< T, n >::resize().
◆ YaspGrid() [5/5]
|
inline |
Constructor for a tensorproduct YaspGrid.
- Parameters
-
comm MPI communicator where this mesh is distributed to coords coordinate vectors to be used for coarse grid periodic tells if direction is periodic or not overlap size of overlap on coarsest grid (same in all directions) lb pointer to an overloaded YLoadBalance instance
- Deprecated:
- This constructor is deprecated and will be removed after the release of dune-grid-2.4
Member Function Documentation
◆ communicate() [1/2]
|
inlineinherited |
dummy communicate, doing nothing
◆ communicate() [2/2]
|
inlineinherited |
dummy communicate, doing nothing
◆ DUNE_DEPRECATED_MSG()
|
inlineinherited |
obtain EntityPointer from EntitySeed.
- Deprecated:
- This method is deprecated and will be removed after the release of dune-grid 2.4. Please use entity() instead, which will directly return an Entity object that you can then store for later use. The EntityPointer concept in general is deprecated and will not be available after dune-grid 2.4 has been released.
obtain Entity from EntitySeed.
◆ getMark() [1/2]
|
inlineinherited |
◆ getMark() [2/2]
|
inline |
returns adaptation mark for given entity
- Parameters
-
[in] e Entity for which adaptation mark should be determined
- Returns
- int adaptation mark, here the default value 0 is returned
References Dune::YaspGrid< dim, Coordinates >::maxLevel().
◆ intersections()
|
inlineprotected |
Construct list of intersections with neighboring processors.
- Parameters
-
recvgrid the grid stored in this processor sendgrid the subgrid to be sent to neighboring processors sendlist the deque to fill with send intersections recvlist the deque to fill with recv intersections
- Returns
- two lists: Intersections to be sent and Intersections to be received
References Dune::YaspGrid< dim, Coordinates >::globalSize(), Dune::YGridComponent< Coordinates >::intersection(), Dune::YGridComponent< Coordinates >::move(), and Dune::Grid< dim, dimworld, Coordinates::ctype, YaspGridFamily< dim, EquidistantCoordinates< double, dim > > >::size().
Referenced by Dune::YaspGrid< dim, Coordinates >::makelevel().
◆ makelevel()
|
inlineprotected |
Make a new YGridLevel structure.
- Parameters
-
coords the coordinate container periodic indicate periodicity for each direction o_interior origin of interior (non-overlapping) cell decomposition overlap to be used on this grid level
References Dune::ReservedVector< T, n >::back(), Dune::YaspGrid< dim, Coordinates >::globalSize(), Dune::YaspGrid< dim, Coordinates >::intersections(), Dune::YaspGrid< dim, Coordinates >::maxLevel(), and Dune::Grid< dim, dimworld, Coordinates::ctype, YaspGridFamily< dim, EquidistantCoordinates< double, dim > > >::size().
Referenced by Dune::YaspGrid< dim, Coordinates >::globalRefine(), and Dune::YaspGrid< dim, Coordinates >::YaspGrid().
◆ mark() [1/3]
|
inlineinherited |
◆ mark() [2/3]
|
inlineinherited |
Marks an entity to be refined/coarsened in a subsequent adapt.
- Parameters
-
[in] refCount Number of subdivisions that should be applied. Negative value means coarsening. [in] e Entity to Entity that should be refined
- Returns
- true if Entity was marked, false otherwise.
- Note
- default implementation is: return false; for grids with no adaptation.
- for the grid programmer: this method is implemented as a template method, because the Entity type is not defined when the class is instantiated You won't need this trick in the implementation. In your implementation you should use it as typename Traits::template Codim<0>::Entity & e ).bool mark(int refCount, const typename Traits::template Codim< 0 >::Entity &e)Marks an entity to be refined/coarsened in a subsequent adapt.Definition: yaspgrid.hh:1278
◆ mark() [3/3]
|
inline |
Marks an entity to be refined/coarsened in a subsequent adapt.
- Parameters
-
[in] refCount Number of subdivisions that should be applied. Negative value means coarsening. [in] e Entity to Entity that should be refined
- Returns
- true if Entity was marked, false otherwise.
- Note
- On yaspgrid marking one element will mark all other elements of the level as well
- If refCount is lower than refCount of a previous mark-call, nothing is changed
References Dune::YaspGrid< dim, Coordinates >::maxLevel().
◆ maxLevel()
|
inline |
Return maximum level defined in this grid. Levels are numbered 0 ... maxlevel with 0 the coarsest level.
References Dune::ReservedVector< T, n >::size().
Referenced by Dune::BackupRestoreFacility< Dune::YaspGrid< dim, Coordinates > >::backup(), Dune::BackupRestoreFacility< YaspGrid< dim, TensorProductCoordinates< ctype, dim > > >::backup(), Dune::YaspGrid< dim, Coordinates >::begin(), Dune::YaspGrid< dim, Coordinates >::end(), Dune::YaspGrid< dim, Coordinates >::getMark(), Dune::YaspGrid< dim, Coordinates >::globalRefine(), Dune::YaspGrid< dim, Coordinates >::globalSize(), Dune::YaspGrid< dim, Coordinates >::leafbegin(), Dune::YaspGrid< dim, Coordinates >::leafend(), Dune::YaspGrid< dim, Coordinates >::levelbegin(), Dune::YaspGrid< dim, Coordinates >::levelend(), Dune::YaspGrid< dim, Coordinates >::makelevel(), Dune::YaspGrid< dim, Coordinates >::mark(), and Dune::operator<<().
◆ numBoundarySegments()
|
inlineinherited |
returns the number of boundary segments within the macro grid
- Returns
- number of boundary segments within the macro grid
◆ refineOptions()
|
inline |
set options for refinement
- Parameters
-
keepPhysicalOverlap [true] keep the physical size of the overlap, [false] keep the number of cells in the overlap. Default is [true].
Referenced by Dune::BackupRestoreFacility< Dune::YaspGrid< dim, Coordinates > >::restore().
The documentation for this class was generated from the following file:
- dune/grid/yaspgrid.hh