KASKADE 7 development version
Classes | Public Types | Public Member Functions | Static Public Attributes | List of all members
Kaskade::CellData< Grd, T > Class Template Reference

Class that stores information for each cell of a grid. More...

#include <celldata.hh>

Detailed Description

template<class Grd, class T = Dune::FieldVector<double,1>>
class Kaskade::CellData< Grd, T >

Class that stores information for each cell of a grid.

In many cases it is useful to store information on a cell in a vector. An example is the storage of error indicators, or some debugging information, such as which entity has been marked for refinement, or has been refined. The class CellData provides infrastructure for these tasks with an emphasis on error estimation.

Since a CellData object contains many EntityPointers, it may become very large. If memory space is an urgent issue, it may be a good idea to replace the current data structure by a different one. In any case it might be a good idea to restrict the livetime of these objects to when they are actually needed.

Definition at line 36 of file celldata.hh.

Public Types

typedef Grd Grid
 
typedef T ValueType
 
typedef Grid::template Codim< 0 >::Entity Cell
 
typedef std::pair< T, typename Cell::EntityPointer > CellDataPair
 A pair, where the data and an EntityPointer is stored. More...
 
typedef std::vector< CellDataPairCellDataVector
 

Public Member Functions

 CellData ()
 Default constructor. More...
 
 CellData (CellDataVector const &data_)
 Construct Cell Data from a given CellDataVector. More...
 
template<class S >
 CellData (std::vector< std::pair< S, typename Cell::EntityPointer > > const &data_)
 Construct Cell Data from a given CellDataVector of different scalar type. More...
 
template<class Space , class Vector >
 CellData (Vector const &data_, Space const &ds)
 
CellData< Grid, T > & operator= (const CellData< Grid, T > &ei)
 Assignment operator from a CellData object. More...
 
CellData< Grid, T > & operator= (const CellDataVector &ei)
 Assignment operator between two CellDataVector. More...
 
double sum () const
 Compute the sum over all entries. More...
 
double abssum () const
 Compute the sum over the absolute values of all entries. More...
 
void sort ()
 Sort all entries from large to small. More...
 
double maxElement () const
 Compute the maximal value of all entries. More...
 
void normalize ()
 Scale all entries, such that their maximal value is 1. More...
 
CellDataVector::const_iterator begin () const
 Return a const_iterator on data.begin() More...
 
CellDataVector::const_iterator end () const
 Return a const_iterator on data.end() More...
 
CellDataVector::iterator begin ()
 Return a const_iterator on data.begin() More...
 
CellDataVector::iterator end ()
 Return a const_iterator on data.end() More...
 
template<typename FSElement >
void toFunction (FSElement &fse) const
 Create a function space element from *this. More...
 
void setCorrectedEstimate (double est)
 
double getCorrectedEstimate () const
 
bool estIsCorrected () const
 

Static Public Attributes

static int const dim = Grid::dimension
 

Member Typedef Documentation

◆ Cell

template<class Grd , class T = Dune::FieldVector<double,1>>
typedef Grid::template Codim<0>::Entity Kaskade::CellData< Grd, T >::Cell

Definition at line 41 of file celldata.hh.

◆ CellDataPair

template<class Grd , class T = Dune::FieldVector<double,1>>
typedef std::pair<T, typename Cell::EntityPointer> Kaskade::CellData< Grd, T >::CellDataPair

A pair, where the data and an EntityPointer is stored.

Definition at line 43 of file celldata.hh.

◆ CellDataVector

template<class Grd , class T = Dune::FieldVector<double,1>>
typedef std::vector<CellDataPair> Kaskade::CellData< Grd, T >::CellDataVector

Definition at line 44 of file celldata.hh.

◆ Grid

template<class Grd , class T = Dune::FieldVector<double,1>>
typedef Grd Kaskade::CellData< Grd, T >::Grid

Definition at line 39 of file celldata.hh.

◆ ValueType

template<class Grd , class T = Dune::FieldVector<double,1>>
typedef T Kaskade::CellData< Grd, T >::ValueType

Definition at line 40 of file celldata.hh.

Constructor & Destructor Documentation

◆ CellData() [1/4]

template<class Grd , class T = Dune::FieldVector<double,1>>
Kaskade::CellData< Grd, T >::CellData ( )
inline

Default constructor.

Definition at line 56 of file celldata.hh.

◆ CellData() [2/4]

template<class Grd , class T = Dune::FieldVector<double,1>>
Kaskade::CellData< Grd, T >::CellData ( CellDataVector const &  data_)
inlineexplicit

Construct Cell Data from a given CellDataVector.

Definition at line 59 of file celldata.hh.

◆ CellData() [3/4]

template<class Grd , class T = Dune::FieldVector<double,1>>
template<class S >
Kaskade::CellData< Grd, T >::CellData ( std::vector< std::pair< S, typename Cell::EntityPointer > > const &  data_)
inlineexplicit

Construct Cell Data from a given CellDataVector of different scalar type.

Definition at line 63 of file celldata.hh.

◆ CellData() [4/4]

template<class Grd , class T = Dune::FieldVector<double,1>>
template<class Space , class Vector >
Kaskade::CellData< Grd, T >::CellData ( Vector const &  data_,
Space const &  ds 
)
inlineexplicit

Definition at line 71 of file celldata.hh.

Member Function Documentation

◆ abssum()

template<class Grd , class T = Dune::FieldVector<double,1>>
double Kaskade::CellData< Grd, T >::abssum ( ) const
inline

Compute the sum over the absolute values of all entries.

Definition at line 114 of file celldata.hh.

Referenced by Kaskade::markByBulkCriterion().

◆ begin() [1/2]

template<class Grd , class T = Dune::FieldVector<double,1>>
CellDataVector::iterator Kaskade::CellData< Grd, T >::begin ( )
inline

Return a const_iterator on data.begin()

Definition at line 162 of file celldata.hh.

◆ begin() [2/2]

template<class Grd , class T = Dune::FieldVector<double,1>>
CellDataVector::const_iterator Kaskade::CellData< Grd, T >::begin ( ) const
inline

◆ end() [1/2]

template<class Grd , class T = Dune::FieldVector<double,1>>
CellDataVector::iterator Kaskade::CellData< Grd, T >::end ( )
inline

Return a const_iterator on data.end()

Definition at line 165 of file celldata.hh.

◆ end() [2/2]

template<class Grd , class T = Dune::FieldVector<double,1>>
CellDataVector::const_iterator Kaskade::CellData< Grd, T >::end ( ) const
inline

◆ estIsCorrected()

template<class Grd , class T = Dune::FieldVector<double,1>>
bool Kaskade::CellData< Grd, T >::estIsCorrected ( ) const
inline

Definition at line 206 of file celldata.hh.

◆ getCorrectedEstimate()

template<class Grd , class T = Dune::FieldVector<double,1>>
double Kaskade::CellData< Grd, T >::getCorrectedEstimate ( ) const
inline

Definition at line 201 of file celldata.hh.

◆ maxElement()

template<class Grd , class T = Dune::FieldVector<double,1>>
double Kaskade::CellData< Grd, T >::maxElement ( ) const
inline

Compute the maximal value of all entries.

Definition at line 130 of file celldata.hh.

Referenced by Kaskade::markByMaxCriterion(), and Kaskade::CellData< Grd, T >::normalize().

◆ normalize()

template<class Grd , class T = Dune::FieldVector<double,1>>
void Kaskade::CellData< Grd, T >::normalize ( )
inline

Scale all entries, such that their maximal value is 1.

Definition at line 146 of file celldata.hh.

◆ operator=() [1/2]

template<class Grd , class T = Dune::FieldVector<double,1>>
CellData< Grid, T > & Kaskade::CellData< Grd, T >::operator= ( const CellData< Grid, T > &  ei)
inline

Assignment operator from a CellData object.

Definition at line 87 of file celldata.hh.

◆ operator=() [2/2]

template<class Grd , class T = Dune::FieldVector<double,1>>
CellData< Grid, T > & Kaskade::CellData< Grd, T >::operator= ( const CellDataVector ei)
inline

Assignment operator between two CellDataVector.

Definition at line 96 of file celldata.hh.

◆ setCorrectedEstimate()

template<class Grd , class T = Dune::FieldVector<double,1>>
void Kaskade::CellData< Grd, T >::setCorrectedEstimate ( double  est)
inline

Definition at line 195 of file celldata.hh.

◆ sort()

template<class Grd , class T = Dune::FieldVector<double,1>>
void Kaskade::CellData< Grd, T >::sort ( )
inline

Sort all entries from large to small.

Definition at line 123 of file celldata.hh.

Referenced by Kaskade::markByBulkCriterion().

◆ sum()

template<class Grd , class T = Dune::FieldVector<double,1>>
double Kaskade::CellData< Grd, T >::sum ( ) const
inline

Compute the sum over all entries.

Definition at line 105 of file celldata.hh.

◆ toFunction()

template<class Grd , class T = Dune::FieldVector<double,1>>
template<typename FSElement >
void Kaskade::CellData< Grd, T >::toFunction ( FSElement &  fse) const
inline

Create a function space element from *this.

Definition at line 169 of file celldata.hh.

Member Data Documentation

◆ dim

template<class Grd , class T = Dune::FieldVector<double,1>>
int const Kaskade::CellData< Grd, T >::dim = Grid::dimension
static

Definition at line 45 of file celldata.hh.


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