dune-pdelab  2.0.0
Public Member Functions | Protected Attributes | List of all members
Dune::PDELab::MultiStepCachePolicy< Step, Time > Class Template Reference

Policy class for the MultiStepCache. More...

#include <dune/pdelab/multistep/cache.hh>

Inheritance diagram for Dune::PDELab::MultiStepCachePolicy< Step, Time >:
Inheritance graph

Public Member Functions

virtual ~MultiStepCachePolicy ()
 any virtual base needs a virtual destructor More...
 

Protected Attributes

Step stepsOfScheme
 The number of steps in the scheme, set by preStep(). More...
 
Step currentStep
 The number of the step set via preStep(). More...
 
Time endTime
 The end-time of the step set via preStep(). More...
 
Time dt
 Time step size. More...
 

methods to determine what to cache

virtual bool cacheResidualValue (std::size_t order, Step step) const
 whether to cache residual evaluations More...
 
virtual bool cacheJacobian (std::size_t order, Step step) const
 whether to cache jacobians (only relevant for affine operators) More...
 
virtual bool cacheZeroResidual (std::size_t order, Step step) const
 whether to cache zero-residuals (only relevant for affine operators) More...
 
virtual bool cacheComposedJacobian (Step step) const
 whether to cache composed jacobians (only relevant for affine operators) More...
 

methods to determine properties of the operators

virtual bool isAffine (std::size_t order, Step step) const
 Whether the operator is affine. More...
 
virtual bool isComposedAffine (Step step) const
 Whether the composed operator is affine. More...
 
virtual bool hasPureLinearAlpha (std::size_t order, Step step) const
 Whether the operator has purely linear alpha_*() methods. More...
 
virtual bool canReuseJacobian (std::size_t order, Step requested, Step available) const
 Whether a jacobian can be reused. More...
 
virtual bool canReuseZeroResidual (std::size_t order, Step requested, Step available) const
 Whether a zero-residual can be reused. More...
 
virtual bool canReuseComposedJacobian (Step requested, Step available) const
 Whether a composed jacobian can be reused. More...
 

methods for pre-/post-processing

virtual void preStep (Step step, Step stepsOfScheme_, Time endTime_, Time dt_)
 method called before starting to compute a step More...
 
virtual void postStep ()
 called after the new values for a time step have been computed More...
 

methods to determine stale items

virtual bool canEvictResidualValue (std::size_t order, Step step) const
 determine whether a residual value can be removed More...
 
virtual bool canEvictJacobian (std::size_t order, Step step) const
 determine whether a Jacobian can be removed More...
 
virtual bool canEvictZeroResidual (std::size_t order, Step step) const
 determine whether a zero-residual can be removed More...
 
virtual bool canEvictUnknowns (Step step) const
 determine whether a vector of unknowns can be removed More...
 
virtual bool canEvictComposedJacobian (Step step) const
 determine whether a composed Jacobian can be removed More...
 

Detailed Description

template<class Step = int, class Time = double>
class Dune::PDELab::MultiStepCachePolicy< Step, Time >

Policy class for the MultiStepCache.

Template Parameters
StepType used for step number. May be signed or unsigned integral. If it is unsigned, no negative step number may occur, ever.
TimeType used for temporal values. Should be floating-point.

This is a virtual base class. However, in addition to being a base class it can also be used as-is, and will provide safe behaviour in this case: cache everything, but don't assume any affine behaviour and cache-items will be evicted once they are older than the number of steps given in the contructor.

Constructor & Destructor Documentation

template<class Step = int, class Time = double>
virtual Dune::PDELab::MultiStepCachePolicy< Step, Time >::~MultiStepCachePolicy ( )
inlinevirtual

any virtual base needs a virtual destructor

Member Function Documentation

template<class Step = int, class Time = double>
virtual bool Dune::PDELab::MultiStepCachePolicy< Step, Time >::cacheComposedJacobian ( Step  step) const
inlinevirtual

whether to cache composed jacobians (only relevant for affine operators)

Returns true by default

template<class Step = int, class Time = double>
virtual bool Dune::PDELab::MultiStepCachePolicy< Step, Time >::cacheJacobian ( std::size_t  order,
Step  step 
) const
inlinevirtual

whether to cache jacobians (only relevant for affine operators)

Returns true by default

template<class Step = int, class Time = double>
virtual bool Dune::PDELab::MultiStepCachePolicy< Step, Time >::cacheResidualValue ( std::size_t  order,
Step  step 
) const
inlinevirtual

whether to cache residual evaluations

Returns true by default

template<class Step = int, class Time = double>
virtual bool Dune::PDELab::MultiStepCachePolicy< Step, Time >::cacheZeroResidual ( std::size_t  order,
Step  step 
) const
inlinevirtual

whether to cache zero-residuals (only relevant for affine operators)

Returns true by default

template<class Step = int, class Time = double>
virtual bool Dune::PDELab::MultiStepCachePolicy< Step, Time >::canEvictComposedJacobian ( Step  step) const
inlinevirtual
template<class Step = int, class Time = double>
virtual bool Dune::PDELab::MultiStepCachePolicy< Step, Time >::canEvictJacobian ( std::size_t  order,
Step  step 
) const
inlinevirtual
template<class Step = int, class Time = double>
virtual bool Dune::PDELab::MultiStepCachePolicy< Step, Time >::canEvictResidualValue ( std::size_t  order,
Step  step 
) const
inlinevirtual
template<class Step = int, class Time = double>
virtual bool Dune::PDELab::MultiStepCachePolicy< Step, Time >::canEvictUnknowns ( Step  step) const
inlinevirtual
template<class Step = int, class Time = double>
virtual bool Dune::PDELab::MultiStepCachePolicy< Step, Time >::canEvictZeroResidual ( std::size_t  order,
Step  step 
) const
inlinevirtual
template<class Step = int, class Time = double>
virtual bool Dune::PDELab::MultiStepCachePolicy< Step, Time >::canReuseComposedJacobian ( Step  requested,
Step  available 
) const
inlinevirtual

Whether a composed jacobian can be reused.

Returns false by default

Reimplemented in Dune::PDELab::VectorWave::CachePolicy< Params, Step, Time >.

template<class Step = int, class Time = double>
virtual bool Dune::PDELab::MultiStepCachePolicy< Step, Time >::canReuseJacobian ( std::size_t  order,
Step  requested,
Step  available 
) const
inlinevirtual

Whether a jacobian can be reused.

Returns false by default

Reimplemented in Dune::PDELab::VectorWave::CachePolicy< Params, Step, Time >.

template<class Step = int, class Time = double>
virtual bool Dune::PDELab::MultiStepCachePolicy< Step, Time >::canReuseZeroResidual ( std::size_t  order,
Step  requested,
Step  available 
) const
inlinevirtual

Whether a zero-residual can be reused.

Returns false by default

Reimplemented in Dune::PDELab::VectorWave::CachePolicy< Params, Step, Time >.

template<class Step = int, class Time = double>
virtual bool Dune::PDELab::MultiStepCachePolicy< Step, Time >::hasPureLinearAlpha ( std::size_t  order,
Step  step 
) const
inlinevirtual

Whether the operator has purely linear alpha_*() methods.

Returns false by default

Reimplemented in Dune::PDELab::VectorWave::CachePolicy< Params, Step, Time >.

template<class Step = int, class Time = double>
virtual bool Dune::PDELab::MultiStepCachePolicy< Step, Time >::isAffine ( std::size_t  order,
Step  step 
) const
inlinevirtual

Whether the operator is affine.

Returns false by default

Reimplemented in Dune::PDELab::VectorWave::CachePolicy< Params, Step, Time >.

template<class Step = int, class Time = double>
virtual bool Dune::PDELab::MultiStepCachePolicy< Step, Time >::isComposedAffine ( Step  step) const
inlinevirtual

Whether the composed operator is affine.

Returns false by default

Reimplemented in Dune::PDELab::VectorWave::CachePolicy< Params, Step, Time >.

template<class Step = int, class Time = double>
virtual void Dune::PDELab::MultiStepCachePolicy< Step, Time >::postStep ( )
inlinevirtual

called after the new values for a time step have been computed

does nothing by default.

template<class Step = int, class Time = double>
virtual void Dune::PDELab::MultiStepCachePolicy< Step, Time >::preStep ( Step  step,
Step  stepsOfScheme_,
Time  endTime_,
Time  dt_ 
)
inlinevirtual

method called before starting to compute a step

Parameters
stepNumber of the step that will be computed, i.e. when $u_n$ is computed, then $n=$step.
stepsOfScheme_Number of steps in the scheme: the oldest required value is $u_{\text{\tt step}-\text{\tt stepsOfScheme}}$.
endTime_$t_n$, the time at step step.
dt_Time step size, i.e. $t_n-t_{n-1}$.

The default implementation saves the parameters step, stepsOfScheme_, endTime_ and dt_ in the protected member variables currentStep, stepsOfScheme, endTime and dt, respectively.

References Dune::PDELab::MultiStepCachePolicy< Step, Time >::currentStep, Dune::PDELab::MultiStepCachePolicy< Step, Time >::dt, Dune::PDELab::MultiStepCachePolicy< Step, Time >::endTime, and Dune::PDELab::MultiStepCachePolicy< Step, Time >::stepsOfScheme.

Member Data Documentation

template<class Step = int, class Time = double>
Step Dune::PDELab::MultiStepCachePolicy< Step, Time >::currentStep
protected
template<class Step = int, class Time = double>
Time Dune::PDELab::MultiStepCachePolicy< Step, Time >::dt
protected

Time step size.

After preStep(), this denotes the size of the step currently being computed. After postStep(), this denotes the size of the step that has just been computed.

Referenced by Dune::PDELab::VectorWave::CachePolicy< Params, Step, Time >::canReuseComposedJacobian(), Dune::PDELab::VectorWave::CachePolicy< Params, Step, Time >::canReuseJacobian(), and Dune::PDELab::MultiStepCachePolicy< Step, Time >::preStep().

template<class Step = int, class Time = double>
Time Dune::PDELab::MultiStepCachePolicy< Step, Time >::endTime
protected

The end-time of the step set via preStep().

After preStep(), this denotes the end-time of the step currently being computed. After postStep(), this denotes the end-time of the step that has just been computed.

Referenced by Dune::PDELab::VectorWave::CachePolicy< Params, Step, Time >::canReuseComposedJacobian(), Dune::PDELab::VectorWave::CachePolicy< Params, Step, Time >::canReuseJacobian(), and Dune::PDELab::MultiStepCachePolicy< Step, Time >::preStep().

template<class Step = int, class Time = double>
Step Dune::PDELab::MultiStepCachePolicy< Step, Time >::stepsOfScheme
protected

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