SG++
sgpp::base::SurplusVolumeCoarseningFunctor Class Reference

A coarsening functor, removing points according to the minimal absolute values in a DataVector provided, weighted with the corresponding basis function's surplus, i.e., with \(2^{-|\vec{l}|_1} = 2^{\sum_{k=1}^d l_d}\). More...

#include <SurplusVolumeCoarseningFunctor.hpp>

Inheritance diagram for sgpp::base::SurplusVolumeCoarseningFunctor:
sgpp::base::CoarseningFunctor

Public Member Functions

double getCoarseningThreshold () const override
 Returns the threshold value. More...
 
size_t getRemovementsNum () const override
 Returns the maximal number of points that should be removed. More...
 
double operator() (GridStorage &storage, size_t seq) override
 This should be returning a coarsening value for every grid point. More...
 
double start () const override
 This should return the initial value of coarsening criterion (e.g. More...
 
 SurplusVolumeCoarseningFunctor (DataVector &alpha, size_t removements_num=1, double threshold=0.0)
 Constructor. More...
 
 ~SurplusVolumeCoarseningFunctor () override
 Destructor. More...
 
- Public Member Functions inherited from sgpp::base::CoarseningFunctor
 CoarseningFunctor ()
 Constructor. More...
 
virtual ~CoarseningFunctor ()
 Destructor. More...
 

Protected Attributes

DataVectoralpha
 pointer to the vector that stores the alpha values More...
 
size_t removements_num
 number of grid points to remove More...
 
double threshold
 threshold, only the points with greater to equal absolute values of the refinement criterion (e.g. More...
 

Additional Inherited Members

- Public Types inherited from sgpp::base::CoarseningFunctor
typedef double value_type
 

Detailed Description

A coarsening functor, removing points according to the minimal absolute values in a DataVector provided, weighted with the corresponding basis function's surplus, i.e., with \(2^{-|\vec{l}|_1} = 2^{\sum_{k=1}^d l_d}\).

Constructor & Destructor Documentation

sgpp::base::SurplusVolumeCoarseningFunctor::SurplusVolumeCoarseningFunctor ( DataVector alpha,
size_t  removements_num = 1,
double  threshold = 0.0 
)

Constructor.

Parameters
alphaDataVector that is basis for coarsening decisions. The i-th entry corresponds to the i-th grid point.
removements_numNumber of grid points which should be removed (if possible - there could be less removable grid points)
thresholdThe absolute value of the entries have to be greater or equal than the threshold
sgpp::base::SurplusVolumeCoarseningFunctor::~SurplusVolumeCoarseningFunctor ( )
override

Destructor.

Member Function Documentation

double sgpp::base::SurplusVolumeCoarseningFunctor::getCoarseningThreshold ( ) const
overridevirtual

Returns the threshold value.

Only the grid points with absolute value of coarsening criterion (e.g. alpha) less or equal to this threshold will be removed

Returns
threshold value for refinement. Default value: 0.

Implements sgpp::base::CoarseningFunctor.

References threshold.

size_t sgpp::base::SurplusVolumeCoarseningFunctor::getRemovementsNum ( ) const
overridevirtual

Returns the maximal number of points that should be removed.

The maximal number of points to removed is set in the constructor of implementation class.

Returns
number of points that should removed. Default value: 1.

Reimplemented from sgpp::base::CoarseningFunctor.

References removements_num.

double sgpp::base::SurplusVolumeCoarseningFunctor::operator() ( GridStorage storage,
size_t  seq 
)
overridevirtual

This should be returning a coarsening value for every grid point.

The point with the lowest value will be removed first.

Parameters
storagereference to the grids storage object
seqsequence number in the coefficients array
Returns
refinement value

Implements sgpp::base::CoarseningFunctor.

References alpha, sgpp::base::HashGridPoint::getLevelSum(), sgpp::base::HashGridStorage::getPoint(), and sgpp::combigrid::pow().

double sgpp::base::SurplusVolumeCoarseningFunctor::start ( ) const
overridevirtual

This should return the initial value of coarsening criterion (e.g.

alpha or error).

Returns
the initial value

Implements sgpp::base::CoarseningFunctor.

Member Data Documentation

size_t sgpp::base::SurplusVolumeCoarseningFunctor::removements_num
protected

number of grid points to remove

Referenced by getRemovementsNum().

double sgpp::base::SurplusVolumeCoarseningFunctor::threshold
protected

threshold, only the points with greater to equal absolute values of the refinement criterion (e.g.

alpha or error) will be refined

Referenced by getCoarseningThreshold().


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