42 virtual Real
value(Real time,
const Point & point)
const final;
58 mutable std::unordered_map<hashing::HashValue, Real>
_cache;
DualNumber< Real, DNDerivativeType, true > ADReal
virtual Real value(Real t, const Point &p) const
Implementation of Function that memoizes (caches) former evaluations in an unordered map using a hash...
virtual Real value(Real time, const Point &point) const final
bool _respect_time
Flag for whether changes in time invalidate the cache.
void invalidateCache()
Called by derived classes to invalidate the cache, perhaps due to a state change.
void useCache(bool use)
Enable/disable the cache.
virtual Real evaluateValue(Real time, const Point &point)=0
Used in derived classes, equivalent to Function::value()
Real _current_time
Stores the time evaluation of the cache.
virtual void meshChanged() override
bool _enable_cache
Flag for whether to cache values.
std::unordered_map< hashing::HashValue, Real > _cache
Cached evaluations for each point.
static InputParameters validParams()
const InputParameters & parameters() const