Wrapper class for Dune-grids that allows automatic signalling of events during grid adaptation. More...
#include <AdaptiveGrid.hpp>
Inherits GridDefaultImplementation< HG::dimension, HG::dimensionworld, HG::ctype, AdaptiveGridFamily< HG > >, and Notifier< event::preAdapt, event::adapt, event::postAdapt >.
Public Types | |
using | HostGrid = HG |
using | GridFamily = AdaptiveGridFamily< HG > |
using | Traits = typename GridFamily::Traits |
using | Element = typename Traits::template Codim< 0 >::Entity |
Public Member Functions | |
template<class HostGrid_ , Dune::disableCopyMove< Self, HostGrid_ > = 0> | |
AdaptiveGrid (HostGrid_ &&hostGrid) | |
std::shared_ptr< HostGrid > const & | hostGrid () const |
Return the underlying grid. | |
bool | isLevelwiseConforming (int level) const |
Return true if the level-rid view represents a conforming grid. | |
bool | isLeafwiseConforming () const |
Return true if the leaf-grid view represents a conforming grid. | |
template<class EntitySeed > | |
auto | entity (EntitySeed const &seed) const |
Obtain Entity from EntitySeed of the HostGrid. | |
template<int codim, Dune::PartitionIteratorType pt = Dune::All_Partition> | |
auto | lbegin (int level) const |
Iterator to first entity of given codim on level. More... | |
template<int codim, Dune::PartitionIteratorType pt = Dune::All_Partition> | |
auto | lend (int level) const |
one past the end on this level | |
template<int codim, Dune::PartitionIteratorType pt = Dune::All_Partition> | |
auto | leafbegin () const |
Iterator to first leaf entity of given codim. | |
template<int codim, Dune::PartitionIteratorType pt = Dune::All_Partition> | |
auto | leafend () const |
One past the end of the sequence of leaf entities. | |
auto | ilevelbegin (Element const &e) const |
Obtain begin intersection iterator with respect to the level GridView. | |
auto | ilevelend (Element const &e) const |
Obtain end intersection iterator with respect to the level GridView. | |
auto | ileafbegin (Element const &e) const |
Obtain begin intersection iterator with respect to the leaf GridView. | |
auto | ileafend (Element const &e) const |
Obtain end intersection iterator with respect to the leaf GridView. | |
int | maxLevel () const |
Return maximum level defined in this grid. More... | |
int | size (int level, int codim) const |
Number of grid entities per level and codim. | |
int | size (int codim) const |
Return number of leaf entities of a given codim in this process. | |
int | size (int level, Dune::GeometryType type) const |
Return number of entities per level and geometry type in this process. | |
int | size (Dune::GeometryType type) const |
Return number of leaf entities per geometry type in this process. | |
std::size_t | numBoundarySegments () const |
Returns the number of boundary segments within the macro grid. | |
auto const & | globalIdSet () const |
Return const reference to the grids global id set. More... | |
auto const & | localIdSet () const |
Return const reference to the host grids local id set. | |
auto const & | levelIndexSet (int level) const |
Return const reference to the host grids level index set for level level. | |
auto const & | leafIndexSet () const |
Return const reference to the host grids leaf index set. | |
void | globalRefine (int refCount) |
Refines all grid elements refCount times. More... | |
bool | mark (int refCount, Element const &e) |
Marks an entity to be refined/coarsened in a subsequent adapt. | |
int | getMark (Element const &e) const |
Return refinement mark for entity. | |
bool | preAdapt () |
Prepare the grid for adaptation and notify observers of the preAdapt event. | |
bool | adapt () |
Adapt the grid and notify observers of the adapt event. | |
void | postAdapt () |
Perform cleanup after grid adaptation and notify observers of the postAdapt event. | |
void | update () |
Update all registered dependent objects if grid is changed manually. | |
unsigned long | changeIndex () const |
Returns the grid change index, see changeIndex. | |
auto const & | comm () const |
Return const reference to a collective communication object. More... | |
template<class DataHandle > | |
void | communicate (DataHandle &handle, Dune::InterfaceType iftype, Dune::CommunicationDirection dir, int level) const |
Communicate data of level gridView. | |
template<class DataHandle > | |
void | communicate (DataHandle &handle, Dune::InterfaceType iftype, Dune::CommunicationDirection dir) const |
Communicate data of leaf gridView. | |
bool | loadBalance () |
Calls loadBalance on the underlying grid. More... | |
template<class DataHandle > | |
bool | loadBalance (DataHandle &handle) |
Calls loadBalance(handle) on the underlying grid. More... | |
int | overlapSize (int level, int codim) const |
Return size of the overlap region for a given codim on the level grid view. | |
int | overlapSize (int codim) const |
Return size of the overlap region for a given codim on the leaf grid view. | |
int | ghostSize (int level, int codim) const |
Return size of the ghost region for a given codim on the level grid view. | |
int | ghostSize (int codim) const |
Return size of the ghost region for a given codim on the leaf grid view. | |
Wrapper class for Dune-grids that allows automatic signalling of events during grid adaptation.
Calls to grid.preAdapt(), grid.adapt() and grid.postAdapt() need to be replaced by calls to the corresponding methods of this class to use the automatic update functionality.
HG | Host grid to be wrapped. Must implement the dune grid interface. |
|
inline |
Return const reference to a collective communication object.
Parallel data distribution and communication
|
inline |
Return const reference to the grids global id set.
Access to index and id sets
|
inline |
Refines all grid elements refCount times.
Adaptivity and grid refinement
References AdaptiveGrid< HG >::adapt(), AdaptiveGrid< HG >::postAdapt(), and AdaptiveGrid< HG >::preAdapt().
|
inline |
Iterator to first entity of given codim on level.
Grid iterators
|
inline |
Calls loadBalance on the underlying grid.
Re-balances the load each process has to handle for a parallel grid.
|
inline |
Calls loadBalance(handle) on the underlying grid.
Re-balances the load each process has to handle for a parallel grid and moves the data.
data | A data handle telling the method which data should be communicated and how. Has to adhere to the interface described by Dune::CommDataHandleIf. |
|
inline |
Return maximum level defined in this grid.
Size methods