dune-multidomaingrid 2.8
|
A meta grid for dividing an existing DUNE grid into subdomains that can be accessed as a grid in their own right. More...
#include <dune/grid/multidomaingrid/multidomaingrid.hh>
Public Types | |
using | HostGrid = HostGrid_ |
typedef MultiDomainGridFamily< HostGrid, MDGridTraitsType > | GridFamily |
typedef GridFamily::Traits | Traits |
typedef MDGridTraitsType | MDGridTraits |
typedef HostGrid::ctype | ctype |
typedef MDGridTraits::SubDomainIndex | SubDomainIndex |
The (integer) type used to identify subdomains. | |
typedef subdomain::SubDomainGrid< ThisType > | SubDomainGrid |
The type used for representing the grid of a subdomain, always a specialization of Dune::mdgrid::subdomain::SubDomainGrid. | |
typedef Traits::LeafSubDomainInterfaceIterator | LeafSubDomainInterfaceIterator |
The type of the iterators over the codim 1 interface between two subdomains on the leaf view. | |
typedef Traits::LevelSubDomainInterfaceIterator | LevelSubDomainInterfaceIterator |
The type of the iterators over the codim 1 interface between two subdomains on a level view. | |
typedef Traits::LeafAllSubDomainInterfacesIterator | LeafAllSubDomainInterfacesIterator |
The type of the iterators over the codim 1 interfaces between all subdomains on the leaf view. | |
typedef Traits::LevelAllSubDomainInterfacesIterator | LevelAllSubDomainInterfacesIterator |
The type of the iterators over the codim 1 interfaces between all subdomains on a level view. | |
Public Member Functions | |
const SubDomainIndex | maxSubDomainIndex () const |
The largest allowed index for a subdomain. | |
Constructors | |
MultiDomainGrid (HostGrid &hostGrid, bool supportLevelIndexSets=true) | |
Constructs a new MultiDomainGrid from the given host grid. | |
MultiDomainGrid (HostGrid &hostGrid, const MDGridTraitsType &traits, bool supportLevelIndexSets=true) | |
Constructs a new MultiDomainGrid from the given host grid. | |
Dune grid interface methods | |
template<typename EntitySeed > | |
Traits::template Codim< EntitySeed::codimension >::Entity | entity (const EntitySeed &entitySeed) const |
int | maxLevel () const |
The current maximum level of the grid. | |
template<int codim> | |
Traits::template Codim< codim >::LevelIterator | lbegin (int level) const |
template<int codim> | |
Traits::template Codim< codim >::LevelIterator | lend (int level) const |
template<int codim, PartitionIteratorType pitype> | |
Traits::template Codim< codim >::template Partition< pitype >::LevelIterator | lbegin (int level) const |
template<int codim, PartitionIteratorType pitype> | |
Traits::template Codim< codim >::template Partition< pitype >::LevelIterator | lend (int level) const |
template<int codim> | |
Traits::template Codim< codim >::LeafIterator | leafbegin () const |
template<int codim> | |
Traits::template Codim< codim >::LeafIterator | leafend () const |
template<int codim, PartitionIteratorType pitype> | |
Traits::template Codim< codim >::template Partition< pitype >::LeafIterator | leafbegin () const |
template<int codim, PartitionIteratorType pitype> | |
Traits::template Codim< codim >::template Partition< pitype >::LeafIterator | leafend () const |
int | size (int level, int codim) const |
int | size (int codim) const |
int | size (int level, GeometryType type) const |
int | size (GeometryType type) const |
const Traits::GlobalIdSet & | globalIdSet () const |
const Traits::LocalIdSet & | localIdSet () const |
const Traits::LevelIndexSet & | levelIndexSet (int level) const |
const Traits::LeafIndexSet & | leafIndexSet () const |
void | globalRefine (int refCount) |
bool | mark (int refCount, const typename Traits::template Codim< 0 >::Entity &e) |
int | getMark (const typename Traits::template Codim< 0 >::Entity &e) |
bool | preAdapt () |
bool | adapt () |
void | postAdapt () |
int | overlapSize (int level, int codim) const |
int | overlapSize (int codim) const |
int | ghostSize (int level, int codim) const |
int | ghostSize (int codim) const |
const Traits::CollectiveCommunication & | comm () const |
template<typename DataHandleImp , typename DataTypeImp > | |
void | communicate (CommDataHandleIF< DataHandleImp, DataTypeImp > &data, InterfaceType iftype, CommunicationDirection dir, int level) const |
template<typename DataHandleImp , typename DataTypeImp > | |
void | communicate (CommDataHandleIF< DataHandleImp, DataTypeImp > &data, InterfaceType iftype, CommunicationDirection dir) const |
template<typename DataHandle > | |
bool | loadBalance (DataHandle &dataHandle) |
bool | loadBalance () |
size_t | numBoundarySegments () const |
Methods for iterating over subdomain interfaces | |
LeafSubDomainInterfaceIterator | leafSubDomainInterfaceBegin (SubDomainIndex subDomain1, SubDomainIndex subDomain2) const |
Returns an iterator over the leaf interface of two subdomains. | |
LeafSubDomainInterfaceIterator | leafSubDomainInterfaceEnd (SubDomainIndex subDomain1, SubDomainIndex subDomain2) const |
Returns the corresponding end iterator for leafSubDomainInterfaceBegin(). | |
LevelSubDomainInterfaceIterator | levelSubDomainInterfaceBegin (SubDomainIndex subDomain1, SubDomainIndex subDomain2, int level) const |
Returns an iterator over the interface of two subdomains at the given level. | |
LevelSubDomainInterfaceIterator | levelSubDomainInterfaceEnd (SubDomainIndex subDomain1, SubDomainIndex subDomain2, int level) const |
Returns the corresponding end iterator for levelSubDomainInterfaceBegin(). | |
LeafAllSubDomainInterfacesIterator | leafAllSubDomainInterfacesBegin () const |
Returns an iterator over all subdomain interfaces on the leaf view. | |
LeafAllSubDomainInterfacesIterator | leafAllSubDomainInterfacesEnd () const |
Returns the corresponding end iterator for leafAllSubDomainInterfacesBegin(). | |
LevelAllSubDomainInterfacesIterator | levelAllSubDomainInterfacesBegin (int level) const |
Returns an iterator over all subdomain interfaces on the requested level view. | |
LevelAllSubDomainInterfacesIterator | levelAllSubDomainInterfacesEnd (int level) const |
Returns the corresponding end iterator for levelAllSubDomainInterfacesBegin(). | |
Subdomain creation- and adaptation methods | |
void | startSubDomainMarking () |
Prepares the grid for (re-)assigning cells to subdomains. | |
void | preUpdateSubDomains () |
Calculates the new subdomain layout, but does not update the current subdomains yet. | |
void | updateSubDomains () |
Switches the subdomain layout over to the new layout. | |
void | postUpdateSubDomains () |
clears the saved state of the subdomain layout that was active before the last call to updateSubDomains(). | |
void | addToSubDomain (SubDomainIndex subDomain, const typename Traits::template Codim< 0 >::Entity &e) |
Adds the given leaf entity to the specified subdomain. | |
void | removeFromSubDomain (SubDomainIndex subDomain, const typename Traits::template Codim< 0 >::Entity &e) |
Removes the given leaf entity from the specified subdomain. | |
void | assignToSubDomain (SubDomainIndex subDomain, const typename Traits::template Codim< 0 >::Entity &e) |
Assigns the given leaf entity to the specified subdomain, clearing any previous subdomain assignments. | |
void | removeFromAllSubDomains (const typename Traits::template Codim< 0 >::Entity &e) |
Removes the given leaf entity from all subdomains it currently belongs to. | |
Access to the subdomain grids | |
const SubDomainGrid & | subDomain (SubDomainIndex subDomain) const |
Returns a reference to the SubDomainGrid associated with the given subdomain. | |
SubDomainGrid & | subDomain (SubDomainIndex subDomain) |
Returns a reference to the SubDomainGrid associated with the given subdomain. | |
SubDomainIndex | maxAssignedSubDomainIndex () const |
Returns the largest subdomain index that was ever assigned to a cell in this grid. | |
bool | supportLevelIndexSets () const |
Indicates whether this MultiDomainGrid instance supports level index sets on its SubDomainGrids. | |
Static Public Member Functions | |
static constexpr bool | maxSubDomainIndexIsStatic () |
Static Public Attributes | |
static const std::size_t | maxNumberOfSubDomains = MDGridTraits::maxSubDomainsPerCell |
The largest number of subdomains any given grid cell may belong to. | |
Entity conversion methods | |
const MDGridTraits & | traits () const |
template<typename Entity > | |
Traits::template Codim< Entity::codimension >::Entity | wrapHostEntity (const Entity &e) const |
template<int codim> | |
Traits::template Codim< codim >::Entity | wrapHostEntity (const typename HostGrid::template Codim< codim >::Entity &e) const |
template<typename EntityType > | |
static const HostEntity< EntityType >::type & | hostEntity (const EntityType &e) |
Returns a reference to the corresponding host entity. | |
template<typename EntityType > | |
static const MultiDomainEntity< EntityType >::type & | multiDomainEntity (const EntityType &e) |
template<typename IntersectionType > | |
static const auto & | multiDomainIntersection (const IntersectionType &is) |
A meta grid for dividing an existing DUNE grid into subdomains that can be accessed as a grid in their own right.
HostGrid | The type of the underlying grid implementation. |
MDGridTraitsType | A traits type for customizing how the MultiDomainGrid manages the partitioning information. |
typedef HostGrid::ctype Dune::mdgrid::MultiDomainGrid< HostGrid_, MDGridTraitsType >::ctype |
typedef MultiDomainGridFamily<HostGrid,MDGridTraitsType> Dune::mdgrid::MultiDomainGrid< HostGrid_, MDGridTraitsType >::GridFamily |
using Dune::mdgrid::MultiDomainGrid< HostGrid_, MDGridTraitsType >::HostGrid = HostGrid_ |
typedef Traits::LeafAllSubDomainInterfacesIterator Dune::mdgrid::MultiDomainGrid< HostGrid_, MDGridTraitsType >::LeafAllSubDomainInterfacesIterator |
The type of the iterators over the codim 1 interfaces between all subdomains on the leaf view.
typedef Traits::LeafSubDomainInterfaceIterator Dune::mdgrid::MultiDomainGrid< HostGrid_, MDGridTraitsType >::LeafSubDomainInterfaceIterator |
The type of the iterators over the codim 1 interface between two subdomains on the leaf view.
typedef Traits::LevelAllSubDomainInterfacesIterator Dune::mdgrid::MultiDomainGrid< HostGrid_, MDGridTraitsType >::LevelAllSubDomainInterfacesIterator |
The type of the iterators over the codim 1 interfaces between all subdomains on a level view.
typedef Traits::LevelSubDomainInterfaceIterator Dune::mdgrid::MultiDomainGrid< HostGrid_, MDGridTraitsType >::LevelSubDomainInterfaceIterator |
The type of the iterators over the codim 1 interface between two subdomains on a level view.
typedef MDGridTraitsType Dune::mdgrid::MultiDomainGrid< HostGrid_, MDGridTraitsType >::MDGridTraits |
typedef subdomain::SubDomainGrid<ThisType> Dune::mdgrid::MultiDomainGrid< HostGrid_, MDGridTraitsType >::SubDomainGrid |
The type used for representing the grid of a subdomain, always a specialization of Dune::mdgrid::subdomain::SubDomainGrid.
typedef MDGridTraits::SubDomainIndex Dune::mdgrid::MultiDomainGrid< HostGrid_, MDGridTraitsType >::SubDomainIndex |
The (integer) type used to identify subdomains.
typedef GridFamily::Traits Dune::mdgrid::MultiDomainGrid< HostGrid_, MDGridTraitsType >::Traits |
|
inlineexplicit |
Constructs a new MultiDomainGrid from the given host grid.
hostGrid | the host grid that will be wrapped by the MultiDomainGrid |
supportLevelIndexSets | flag indicating support for level index sets on subdomains |
|
inlineexplicit |
Constructs a new MultiDomainGrid from the given host grid.
hostGrid | the host grid that will be wrapped by the MultiDomainGrid |
traits | an instance of the grid traits, which might contain runtime information |
supportLevelIndexSets | flag indicating support for level index sets on subdomains |
|
inline |
|
inline |
Adds the given leaf entity to the specified subdomain.
|
inline |
Assigns the given leaf entity to the specified subdomain, clearing any previous subdomain assignments.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinestatic |
Returns a reference to the corresponding host entity.
|
inline |
|
inline |
|
inline |
Returns an iterator over all subdomain interfaces on the leaf view.
This method returns an iterator that will visit all pairwise surface interfaces between subdomains on the leaf view. In particular, given to adjacent cells
In essence, the two subdomains have to be locally disjoint on
The iterator will only traverse the host grid once for visiting all subdomain interfaces. Incrementing the iterator might thus result in an iterator pointing to the same grid intersection, but to a different pair of subdomains. The subdomains pointed to by ther iterator can be retrieved by calling LeafAllSubDomainInterfacesIterator::subDomain1() and LeafAllSubDomainInterfacesIterator::subDomain2(), respectively.
|
inline |
Returns the corresponding end iterator for leafAllSubDomainInterfacesBegin().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Returns an iterator over the leaf interface of two subdomains.
The resulting iterator will visit all cell intersections that are part of both subdomains.
subDomain1 | the first subdomain |
subDomain2 | the second subdomain |
|
inline |
Returns the corresponding end iterator for leafSubDomainInterfaceBegin().
|
inline |
|
inline |
|
inline |
Returns an iterator over all subdomain interfaces on the requested level view.
This method returns an iterator that will visit all pairwise surface interfaces between subdomains on the requested level view. In particular, given to adjacent cells
In essence, the two subdomains have to be locally disjoint on
The iterator will only traverse the host grid once for visiting all subdomain interfaces. Incrementing the iterator might thus result in an iterator pointing to the same grid intersection, but to a different pair of subdomains. The subdomains pointed to by ther iterator can be retrieved by calling LevelAllSubDomainInterfacesIterator::subDomain1() and LevelAllSubDomainInterfacesIterator::subDomain2(), respectively.
level | the grid level to be iterated over. |
|
inline |
Returns the corresponding end iterator for levelAllSubDomainInterfacesBegin().
level | the grid level to be iterated over. |
|
inline |
|
inline |
Returns an iterator over the interface of two subdomains at the given level.
The resulting iterator will visit all cell intersections that are part of both subdomains.
subDomain1 | the first subdomain |
subDomain2 | the second subdomain |
level | the grid level over which to iterate |
|
inline |
Returns the corresponding end iterator for levelSubDomainInterfaceBegin().
level | the grid level to be iterated over. |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Returns the largest subdomain index that was ever assigned to a cell in this grid.
This method returns the largest subdomain index that was passed to addToSubDomain() or assignToSubDomain() since this MultiDomainGrid was created. Keep in mind that the subdomain belonging to that index might not contain any entities anymore if all entities have been removed from it at a later point.
|
inline |
The current maximum level of the grid.
|
inline |
The largest allowed index for a subdomain.
|
inlinestaticconstexpr |
|
inlinestatic |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
clears the saved state of the subdomain layout that was active before the last call to updateSubDomains().
|
inline |
|
inline |
Calculates the new subdomain layout, but does not update the current subdomains yet.
After calling this method, you can query the grid for the changes that will occur when the new subdomain layout becomes active. This includes the possibility to obtain the new indices entities will be assigned in the modified subdomains.
To switch the grid over to the new layout, call updateSubDomains().
|
inline |
Removes the given leaf entity from all subdomains it currently belongs to.
|
inline |
Removes the given leaf entity from the specified subdomain.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Prepares the grid for (re-)assigning cells to subdomains.
After calling this method, it becomes possible to invoke the various methods for cell assignment to subdomains. When you are done marking, call preUpdateSubDomains().
IMPORTANT: Reassigning subdomains and grid adaptation are mutually exclusive, it is not possibly to do both at the same time. This restriction is enforced by the grid.
|
inline |
Returns a reference to the SubDomainGrid associated with the given subdomain.
|
inline |
Returns a reference to the SubDomainGrid associated with the given subdomain.
|
inline |
Indicates whether this MultiDomainGrid instance supports level index sets on its SubDomainGrids.
|
inline |
|
inline |
Switches the subdomain layout over to the new layout.
|
inline |
|
inline |
|
static |
The largest number of subdomains any given grid cell may belong to.