KASKADE 7 development version
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
Kaskade::GridManagerBase< Grd > Class Template Referenceabstract

Basic functionality for managing grids and their refinement. More...

#include <gridmanager.hh>

Detailed Description

template<class Grd>
class Kaskade::GridManagerBase< Grd >

Basic functionality for managing grids and their refinement.

Definition at line 260 of file gridmanager.hh.

Inheritance diagram for Kaskade::GridManagerBase< Grd >:
Kaskade::GridManager< Grd >

Public Types

using Grid = Grd
 the type of managed grid More...
 
typedef GridManagerBase< GridSelf
 

Public Member Functions

 GridManagerBase (Dune::GridPtr< Grid > grid_, bool verbose_, bool enforceConcurrentReads=false)
 
 GridManagerBase (std::unique_ptr< Grid > &&grid_, bool verbose_, bool enforceConcurrentReads=false)
 
 GridManagerBase (Grid *&&grid_, bool verbose_, bool enforceConcurrentReads=false)
 
virtual ~GridManagerBase ()
 
SelfenforceConcurrentReads (bool enforceConcurrentReads)
 Tells the grid manager that concurrent reads of the grid are safe. More...
 
SelfsetVerbosity (const bool verbosity)
 sets the verbosity level of the grid manager More...
 
bool gridIsThreadSafe () const
 Returns true if concurrent read accesses to the grid do not lead to data races. More...
 
CellRanges< typename Grid::LeafGridView > const & cellRanges (typename Grid::LeafGridView const &) const
 Returns a CellRanges object for the given grid view. The cell ranges are created on demand. The reference is valid up to the next mesh modification. This method is thread-safe. More...
 
CellRanges< typename Grid::LevelGridView > const & cellRanges (typename Grid::LevelGridView const &gridView) const
 Returns a CellRanges object for the given grid view. More...
 
EntityNumbering< typename Grid::LeafGridView > const & entityNumbering (typename Grid::LeafGridView const &) const
 Returns an EntityNumbering object for the given grid view. More...
 
Access to the managed grid.
Grid const & grid () const
 Returns a const reference on the owned grid. More...
 
Gridgrid_non_const ()
 Returns a non-const reference on the owned grid. More...
 
std::shared_ptr< Grid const > gridShared () const
 Provides shared ownership management. More...
 
Grid adaptation
bool mark (int refCount, typename Grid::template Codim< 0 >::Entity const &cell)
 Marks the given cell for refinement or coarsening. More...
 
template<class S >
void mark (CellData< Grid, S > const &cellData)
 Marks all Entities of a grid according to the corresponding entries in a CellData. More...
 
size_t countMarked () const
 Reports the number of marked elements. More...
 
bool preAdapt ()
 Calls grid.preAdapt(). More...
 
void postAdapt ()
 Calls grid.postAdapt(). More...
 
bool adaptAtOnce ()
 DEPRECATED Performs grid refinement without prolongating registered FE functions. More...
 
void flushMarks ()
 Remove all cell marks from the grid. More...
 
bool adapt ()
 Refines each marked leaf cell of the grid and prolongates registered FE functions to the new leaf grid view. More...
 
void globalRefine (int refCount)
 Refines each leaf cell of the grid and prolongates registered FE functions to the new leaf grid view. More...
 
virtual void update ()=0
 Must be overloaded by derived classes to adjust internal state immediately after mesh refinement. More...
 

Public Attributes

GridSignals signals
 

Protected Member Functions

void beforeRefinement ()
 
void afterRefinement ()
 

Protected Attributes

std::shared_ptr< Gridgridptr
 The grid itself. More...
 
bool verbose
 

Friends

template<class LocalToGlobalMapper >
class FEFunctionSpace
 
template<class GridMan , class ErrEst >
class AdaptiveGrid
 

Member Typedef Documentation

◆ Grid

template<class Grd >
using Kaskade::GridManagerBase< Grd >::Grid = Grd

the type of managed grid

Definition at line 266 of file gridmanager.hh.

◆ Self

template<class Grd >
typedef GridManagerBase<Grid> Kaskade::GridManagerBase< Grd >::Self

Definition at line 268 of file gridmanager.hh.

Constructor & Destructor Documentation

◆ GridManagerBase() [1/3]

template<class Grd >
Kaskade::GridManagerBase< Grd >::GridManagerBase ( Dune::GridPtr< Grid grid_,
bool  verbose_,
bool  enforceConcurrentReads = false 
)
inline

Definition at line 270 of file gridmanager.hh.

◆ GridManagerBase() [2/3]

template<class Grd >
Kaskade::GridManagerBase< Grd >::GridManagerBase ( std::unique_ptr< Grid > &&  grid_,
bool  verbose_,
bool  enforceConcurrentReads = false 
)
inline

Definition at line 274 of file gridmanager.hh.

◆ GridManagerBase() [3/3]

template<class Grd >
Kaskade::GridManagerBase< Grd >::GridManagerBase ( Grid *&&  grid_,
bool  verbose_,
bool  enforceConcurrentReads = false 
)
inline

Definition at line 278 of file gridmanager.hh.

◆ ~GridManagerBase()

template<class Grd >
virtual Kaskade::GridManagerBase< Grd >::~GridManagerBase ( )
inlinevirtual

Definition at line 284 of file gridmanager.hh.

Member Function Documentation

◆ adapt()

template<class Grd >
bool Kaskade::GridManagerBase< Grd >::adapt ( )
inline

Refines each marked leaf cell of the grid and prolongates registered FE functions to the new leaf grid view.

Definition at line 413 of file gridmanager.hh.

Referenced by Kaskade::Bridge::AdaptiveGrid< GridManager, Estimate >::adapt(), and Kaskade::GridManagerBase< Grd >::adaptAtOnce().

◆ adaptAtOnce()

template<class Grd >
bool Kaskade::GridManagerBase< Grd >::adaptAtOnce ( )
inline

DEPRECATED Performs grid refinement without prolongating registered FE functions.

As this can easily lead to inconsistent states of FE functions, usage is not recommended. Probably this method will be removed soon.

Definition at line 390 of file gridmanager.hh.

Referenced by Kaskade::coarsening(), Kaskade::markAndRefine(), Kaskade::refineAtBoundary(), Kaskade::Adaptivity::FixedCellFraction< Grid >::refineGrid_impl(), Kaskade::Adaptivity::FixedErrorFraction< Grid >::refineGrid_impl(), Kaskade::Adaptivity::ErrorEquilibration2< Grid >::refineGrid_impl(), Kaskade::Adaptivity::ErrorEquilibration< Grid >::refineGrid_impl(), and Kaskade::Limex< Eq >::step().

◆ afterRefinement()

template<class Grd >
void Kaskade::GridManagerBase< Grd >::afterRefinement ( )
inlineprotected

◆ beforeRefinement()

template<class Grd >
void Kaskade::GridManagerBase< Grd >::beforeRefinement ( )
inlineprotected

◆ cellRanges() [1/2]

template<class Grd >
CellRanges< typename Grid::LeafGridView > const & Kaskade::GridManagerBase< Grd >::cellRanges ( typename Grid::LeafGridView const &  ) const
inline

Returns a CellRanges object for the given grid view. The cell ranges are created on demand. The reference is valid up to the next mesh modification. This method is thread-safe.

Definition at line 531 of file gridmanager.hh.

Referenced by Kaskade::VariationalFunctionalAssembler< F, SparseIndex, BoundaryDetector, QuadRule >::assemble().

◆ cellRanges() [2/2]

template<class Grd >
CellRanges< typename Grid::LevelGridView > const & Kaskade::GridManagerBase< Grd >::cellRanges ( typename Grid::LevelGridView const &  gridView) const
inline

Returns a CellRanges object for the given grid view.

Parameters
gridViewa level grid view of the grid managed by this grid manager

The cell ranges are created on demand. The reference is valid up to the next mesh modification. This method is thread-safe.

Definition at line 547 of file gridmanager.hh.

◆ countMarked()

template<class Grd >
size_t Kaskade::GridManagerBase< Grd >::countMarked ( ) const
inline

Reports the number of marked elements.

Definition at line 359 of file gridmanager.hh.

◆ enforceConcurrentReads()

template<class Grd >
Self & Kaskade::GridManagerBase< Grd >::enforceConcurrentReads ( bool  enforceConcurrentReads)
inline

Tells the grid manager that concurrent reads of the grid are safe.

Definition at line 484 of file gridmanager.hh.

Referenced by Kaskade::GridManagerBase< Grd >::enforceConcurrentReads().

◆ entityNumbering()

template<class Grd >
EntityNumbering< typename Grid::LeafGridView > const & Kaskade::GridManagerBase< Grd >::entityNumbering ( typename Grid::LeafGridView const &  ) const
inline

Returns an EntityNumbering object for the given grid view.

Todo:
allow to specify the sorting

Definition at line 563 of file gridmanager.hh.

◆ flushMarks()

template<class Grd >
void Kaskade::GridManagerBase< Grd >::flushMarks ( )
inline

Remove all cell marks from the grid.

Definition at line 402 of file gridmanager.hh.

Referenced by Kaskade::Bridge::AdaptiveGrid< GridManager, Estimate >::flushMarks(), and Kaskade::GridManagerBase< Grd >::mark().

◆ globalRefine()

template<class Grd >
void Kaskade::GridManagerBase< Grd >::globalRefine ( int  refCount)
inline

Refines each leaf cell of the grid and prolongates registered FE functions to the new leaf grid view.

Definition at line 449 of file gridmanager.hh.

◆ grid()

template<class Grd >
Grid const & Kaskade::GridManagerBase< Grd >::grid ( ) const
inline

◆ grid_non_const()

template<class Grd >
Grid & Kaskade::GridManagerBase< Grd >::grid_non_const ( )
inline

Returns a non-const reference on the owned grid.

Definition at line 298 of file gridmanager.hh.

◆ gridIsThreadSafe()

template<class Grd >
bool Kaskade::GridManagerBase< Grd >::gridIsThreadSafe ( ) const
inline

Returns true if concurrent read accesses to the grid do not lead to data races.

This is either the case if the grid implementation itself reports that it's thread-safe, or if the user has explicitly stated that concurrent reads are safe (using enforceConcurrentReads) - even if they actually are not.

The thread-safety reported by this method is used e.g. by the assembler to decide how many threads to use during assembly.

If the grid access may not be thread-safe, consider using GridLocking.

Definition at line 516 of file gridmanager.hh.

Referenced by Kaskade::VariationalFunctionalAssembler< F, SparseIndex, BoundaryDetector, QuadRule >::assemble().

◆ gridShared()

template<class Grd >
std::shared_ptr< Grid const > Kaskade::GridManagerBase< Grd >::gridShared ( ) const
inline

Provides shared ownership management.

Note that only an immutable grid is provided, such that the responsibility for grid modifications remains with the GridManager object. This is necessary for the GridManager to trigger prolongation/interpolation on grid modification.

Definition at line 310 of file gridmanager.hh.

◆ mark() [1/2]

template<class Grd >
template<class S >
void Kaskade::GridManagerBase< Grd >::mark ( CellData< Grid, S > const &  cellData)
inline

Marks all Entities of a grid according to the corresponding entries in a CellData.

Definition at line 342 of file gridmanager.hh.

◆ mark() [2/2]

template<class Grd >
bool Kaskade::GridManagerBase< Grd >::mark ( int  refCount,
typename Grid::template Codim< 0 >::Entity const &  cell 
)
inline

◆ postAdapt()

template<class Grd >
void Kaskade::GridManagerBase< Grd >::postAdapt ( )
inline

◆ preAdapt()

template<class Grd >
bool Kaskade::GridManagerBase< Grd >::preAdapt ( )
inline

◆ setVerbosity()

template<class Grd >
Self & Kaskade::GridManagerBase< Grd >::setVerbosity ( const bool  verbosity)
inline

sets the verbosity level of the grid manager

The grid manager prints status and progress information to std::cout. The amount of information depends on the verbosity:

  • 0: no messages are printed
  • 1: mesh size change on refinement is reported

Definition at line 499 of file gridmanager.hh.

Referenced by Kaskade::Limex< Eq >::step().

◆ update()

template<class Grd >
virtual void Kaskade::GridManagerBase< Grd >::update ( )
pure virtual

Friends And Related Function Documentation

◆ AdaptiveGrid

template<class Grd >
template<class GridMan , class ErrEst >
friend class AdaptiveGrid
friend

Definition at line 603 of file gridmanager.hh.

◆ FEFunctionSpace

template<class Grd >
template<class LocalToGlobalMapper >
friend class FEFunctionSpace
friend

Definition at line 602 of file gridmanager.hh.

Member Data Documentation

◆ gridptr

template<class Grd >
std::shared_ptr<Grid> Kaskade::GridManagerBase< Grd >::gridptr
protected

◆ signals

template<class Grd >
GridSignals Kaskade::GridManagerBase< Grd >::signals

◆ verbose

template<class Grd >
bool Kaskade::GridManagerBase< Grd >::verbose
protected

The documentation for this class was generated from the following file: