16 #include <deal.II/base/incremental_function.h> 17 #include <deal.II/base/signaling_nan.h> 19 #include <deal.II/lac/vector.h> 21 DEAL_II_NAMESPACE_OPEN
25 template <
int dim,
typename RangeNumberType>
28 :
Function<dim, RangeNumberType>(base.n_components)
31 , values_old(base.n_components)
36 template <
int dim,
typename RangeNumberType>
42 ExcMessage(
"The decrement must be set to a non-negative value."));
48 template <
int dim,
typename RangeNumberType>
52 const unsigned int comp)
const 56 std::lock_guard<std::mutex> lock(mutex);
61 const auto orig_time = base.get_time();
63 base.set_time(this->get_time());
64 const RangeNumberType current = base.value(p, comp);
66 base.set_time(this->get_time() - delta_t);
67 const RangeNumberType old = base.value(p, comp);
70 base.set_time(orig_time);
77 template <
int dim,
typename RangeNumberType>
85 std::lock_guard<std::mutex> lock(mutex);
90 const auto orig_time = base.get_time();
92 base.set_time(this->get_time());
93 base.vector_value(p, values);
95 base.set_time(this->get_time() - delta_t);
96 base.vector_value(p, values_old);
101 base.set_time(orig_time);
106 #include "incremental_function.inst" 108 DEAL_II_NAMESPACE_CLOSE
virtual void vector_value(const Point< dim > &p, Vector< RangeNumberType > &values) const override
static ::ExceptionBase & ExcMessage(std::string arg1)
typename FunctionTime< typename numbers::NumberTraits< RangeNumberType >::real_type >::time_type time_type
#define Assert(cond, exc)
void set_decrement(const time_type delta_t)
virtual RangeNumberType value(const Point< dim > &p, const unsigned int component=0) const override
IncrementalFunction(Function< dim, RangeNumberType > &base)