*/
const unsigned int n_components;
+ /**
+ * The scalar-valued real type used for representing time.
+ */
+ using typename FunctionTime<
+ typename numbers::NumberTraits<RangeNumberType>::real_type>::time_type;
+
/**
* Constructor. May take an initial value for the number of components
* (which defaults to one, i.e. a scalar function), and the time variable,
* which defaults to zero.
*/
Function(const unsigned int n_components = 1,
- const typename numbers::NumberTraits<RangeNumberType>::real_type
- initial_time = 0.0);
+ const time_type initial_time = 0.0);
/**
* Virtual destructor; absolutely necessary in this case.
template <int dim, typename RangeNumberType>
Function<dim, RangeNumberType>::Function(
- const unsigned int n_components,
- const typename numbers::NumberTraits<RangeNumberType>::real_type initial_time)
- : FunctionTime<typename numbers::NumberTraits<RangeNumberType>::real_type>(
+ const unsigned int n_components,
+ const typename Function<dim, RangeNumberType>::time_type initial_time)
+ : FunctionTime<typename Function<dim, RangeNumberType>::time_type>(
initial_time)
, n_components(n_components)
{
virtual void
advance_time(const Number delta_t);
+ /**
+ * The type this class is initialized with and that is used to represent time.
+ */
+ using time_type = Number;
+
private:
/**
* Store the present time.
{
public:
/**
- * Define alias for the return types of the <tt>value</tt> functions.
+ * Alias for the return types of the <tt>value</tt> function.
*/
using value_type = Tensor<rank, dim, Number>;
+ /**
+ * Alias for the return types of the <tt>gradient</tt> functions.
+ */
using gradient_type = Tensor<rank + 1, dim, Number>;
+ /**
+ * The scalar-valued real type used for representing time.
+ */
+ using typename FunctionTime<
+ typename numbers::NumberTraits<Number>::real_type>::time_type;
+
/**
* Constructor. May take an initial value for the time variable, which
* defaults to zero.
*/
- TensorFunction(
- const typename numbers::NumberTraits<Number>::real_type initial_time =
- typename numbers::NumberTraits<Number>::real_type(0.0));
+ TensorFunction(const time_type initial_time = time_type(0.0));
/**
* Virtual destructor; absolutely necessary in this case, as classes are
class ConstantTensorFunction : public TensorFunction<rank, dim, Number>
{
public:
+ /**
+ * The scalar-valued real type used for representing time.
+ */
+ using typename TensorFunction<rank, dim, Number>::time_type;
+
/**
* Constructor; takes the constant tensor value as an argument. The
* reference value is copied internally.
* An initial value for the time variable may be specified, otherwise it
* defaults to zero.
*/
- ConstantTensorFunction(
- const dealii::Tensor<rank, dim, Number> & value,
- const typename numbers::NumberTraits<Number>::real_type initial_time = 0.0);
+ ConstantTensorFunction(const dealii::Tensor<rank, dim, Number> &value,
+ const time_type initial_time = 0.0);
virtual ~ConstantTensorFunction() override = default;
class ZeroTensorFunction : public ConstantTensorFunction<rank, dim, Number>
{
public:
+ /**
+ * The scalar-valued real type used for representing time.
+ */
+ using typename ConstantTensorFunction<rank, dim, Number>::time_type;
+
/**
* Constructor.
*
* An initial value for the time variable may be specified, otherwise it
* defaults to zero.
*/
- ZeroTensorFunction(
- const typename numbers::NumberTraits<Number>::real_type initial_time = 0.0);
+ ZeroTensorFunction(const time_type initial_time = 0.0);
};
template <int rank, int dim, typename Number>
TensorFunction<rank, dim, Number>::TensorFunction(
- const typename numbers::NumberTraits<Number>::real_type initial_time)
- : FunctionTime<typename numbers::NumberTraits<Number>::real_type>(
+ const typename TensorFunction<rank, dim, Number>::time_type initial_time)
+ : FunctionTime<typename TensorFunction<rank, dim, Number>::time_type>(
initial_time)
{}
template <int rank, int dim, typename Number>
ConstantTensorFunction<rank, dim, Number>::ConstantTensorFunction(
- const Tensor<rank, dim, Number> & value,
- const typename numbers::NumberTraits<Number>::real_type initial_time)
+ const Tensor<rank, dim, Number> & value,
+ const typename ConstantTensorFunction<rank, dim, Number>::time_type initial_time)
: TensorFunction<rank, dim, Number>(initial_time)
, _value(value)
{}
template <int rank, int dim, typename Number>
ZeroTensorFunction<rank, dim, Number>::ZeroTensorFunction(
- const typename numbers::NumberTraits<Number>::real_type initial_time)
+ const typename ZeroTensorFunction<rank, dim, Number>::time_type initial_time)
: ConstantTensorFunction<rank, dim, Number>(
dealii::Tensor<rank, dim, Number>(),
initial_time)