SG++
sgpp::combigrid::FullGridGridBasedEvaluator< V > Class Template Reference

Implementation of the AbstractFullGridLinearEvaluator class using a callback function that If you want to be able to use different function values at the same point in different levels (for example because you are implementing a PDE solver), set exploitNesting to false in the constructor of CombigridTreeStorage. More...

#include <FullGridGridBasedEvaluator.hpp>

Inheritance diagram for sgpp::combigrid::FullGridGridBasedEvaluator< V >:
sgpp::combigrid::AbstractFullGridEvaluationStrategy< V > sgpp::combigrid::AbstractFullGridEvaluator< V >

Public Member Functions

virtual V eval (MultiIndex const &level)
 Evaluates the function given through the storage for a certain level-multi-index (see class description). More...
 
 FullGridGridBasedEvaluator (std::shared_ptr< AbstractCombigridStorage > storage, std::vector< std::shared_ptr< AbstractLinearEvaluator< V >>> evaluatorPrototypes, std::vector< std::shared_ptr< AbstractPointHierarchy >> pointHierarchies, GridFunction gridFunction, FullGridSummationStrategyType summationStrategyType=FullGridSummationStrategyType::LINEAR)
 Constructor. More...
 
std::vector< ThreadPool::TaskgetLevelTasks (MultiIndex const &level, ThreadPool::Task callback)
 
virtual ~FullGridGridBasedEvaluator ()
 
- Public Member Functions inherited from sgpp::combigrid::AbstractFullGridEvaluationStrategy< V >
 AbstractFullGridEvaluationStrategy (std::shared_ptr< AbstractCombigridStorage > storage, std::vector< std::shared_ptr< AbstractLinearEvaluator< V >>> evaluatorPrototypes, std::vector< std::shared_ptr< AbstractPointHierarchy >> pointHierarchies, FullGridSummationStrategyType summationStrategyType)
 
std::vector< std::shared_ptr< AbstractLinearEvaluator< V > > > getEvaluatorPrototypes ()
 
FullGridSummationStrategyType getSummationStrategyType ()
 
void setParameters (std::vector< V > const &params)
 Sets the parameters for the evaluators. More...
 
virtual ~AbstractFullGridEvaluationStrategy ()
 
- Public Member Functions inherited from sgpp::combigrid::AbstractFullGridEvaluator< V >
 AbstractFullGridEvaluator (std::shared_ptr< AbstractCombigridStorage > storage, std::vector< std::shared_ptr< AbstractPointHierarchy >> pointHierarchies)
 Constructor. More...
 
virtual std::vector< base::DataVectorgetGridPoints (MultiIndex const &level)
 
std::shared_ptr< AbstractCombigridStoragegetStorage ()
 
virtual std::shared_ptr< TensorGridgetTensorGrid (MultiIndex const &level, std::vector< bool > orderingConfiguration)
 
virtual size_t maxNewPoints (MultiIndex const &level)
 
virtual size_t numPoints (MultiIndex const &level)
 
virtual void setMutex (std::shared_ptr< std::recursive_mutex > mutexPtr)
 Updates the current mutex. More...
 
virtual ~AbstractFullGridEvaluator ()
 

Protected Member Functions

void addResults (MultiIndex const &level, std::shared_ptr< TreeStorage< double >> results)
 

Protected Attributes

GridFunction gridFunction
 
std::shared_ptr< TreeStorage< uint8_t > > precomputedLevels
 
- Protected Attributes inherited from sgpp::combigrid::AbstractFullGridEvaluationStrategy< V >
std::vector< std::shared_ptr< AbstractLinearEvaluator< V > > > evaluatorPrototypes
 
std::shared_ptr< AbstractFullGridSummationStrategy< V > > summationStrategy
 
FullGridSummationStrategyType summationStrategyType
 
- Protected Attributes inherited from sgpp::combigrid::AbstractFullGridEvaluator< V >
std::shared_ptr< std::recursive_mutex > mutexPtr
 Pointer to a mutex that is locked when doing critical operations on data. More...
 
std::vector< std::shared_ptr< AbstractPointHierarchy > > pointHierarchies
 
std::shared_ptr< AbstractCombigridStoragestorage
 Provides access to the function values (stored or computed on demand) More...
 

Detailed Description

template<typename V>
class sgpp::combigrid::FullGridGridBasedEvaluator< V >

Implementation of the AbstractFullGridLinearEvaluator class using a callback function that If you want to be able to use different function values at the same point in different levels (for example because you are implementing a PDE solver), set exploitNesting to false in the constructor of CombigridTreeStorage.

Constructor & Destructor Documentation

template<typename V >
sgpp::combigrid::FullGridGridBasedEvaluator< V >::FullGridGridBasedEvaluator ( std::shared_ptr< AbstractCombigridStorage storage,
std::vector< std::shared_ptr< AbstractLinearEvaluator< V >>>  evaluatorPrototypes,
std::vector< std::shared_ptr< AbstractPointHierarchy >>  pointHierarchies,
GridFunction  gridFunction,
FullGridSummationStrategyType  summationStrategyType = FullGridSummationStrategyType::LINEAR 
)
inline

Constructor.

Parameters
storageStorage that stores and provides the function values for each grid point.
evaluatorPrototypesprototype objects for the evaluators that are cloned to get an evaluator for each dimension and each level.
pointHierarchiesPointHierarchy objects for each dimension providing the points for each level and information about their ordering.
gridFunctioncallback function that is called with a grid as parameters and should
summationStrategyTypestrategy to gather the results of the univariate evaluators on each anisotropic full grid

return a TreeStorage that contains the values at these grid points

template<typename V >
virtual sgpp::combigrid::FullGridGridBasedEvaluator< V >::~FullGridGridBasedEvaluator ( )
inlinevirtual

Member Function Documentation

template<typename V >
std::vector<ThreadPool::Task> sgpp::combigrid::FullGridGridBasedEvaluator< V >::getLevelTasks ( MultiIndex const &  level,
ThreadPool::Task  callback 
)
inlinevirtual
Returns
a vector of tasks which can be precomputed in parallel to make the (serialized) execution of eval() faster. This class only returns one task in the vector.
Parameters
levelthe level which one wants to compute
callbackThis callback is called (with already locked mutex) from inside one of the returned tasks when all tasks for the given level are completed and the level can be added.

Implements sgpp::combigrid::AbstractFullGridEvaluator< V >.

References sgpp::combigrid::FullGridGridBasedEvaluator< V >::addResults(), sgpp::combigrid::AbstractFullGridEvaluationStrategy< V >::evaluatorPrototypes, sgpp::combigrid::AbstractFullGridEvaluator< V >::getTensorGrid(), grid(), sgpp::combigrid::FullGridGridBasedEvaluator< V >::gridFunction, sgpp::combigrid::AbstractFullGridEvaluator< V >::mutexPtr, and sgpp::combigrid::AbstractFullGridEvaluator< V >::pointHierarchies.

Member Data Documentation

template<typename V >
std::shared_ptr<TreeStorage<uint8_t> > sgpp::combigrid::FullGridGridBasedEvaluator< V >::precomputedLevels
protected

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