diff --git a/ProcessLib/Parameter/ConstantParameter.h b/ProcessLib/Parameter/ConstantParameter.h index 3256d0cc3976bd805794211acb48b2894e0f3046..2c48d5c88a0b5349c6464485a116bf3721e37e4e 100644 --- a/ProcessLib/Parameter/ConstantParameter.h +++ b/ProcessLib/Parameter/ConstantParameter.h @@ -19,26 +19,30 @@ template <typename T> struct ConstantParameter final : public Parameter<T> { /// Construction with single value. - ConstantParameter(T const& value) : _value({value}) {} + explicit ConstantParameter(T const& value) : _values({value}) {} + /// Construction with a tuple. /// The given tuple must be non-empty. - ConstantParameter(std::vector<T> const& value) : _value(value) + explicit ConstantParameter(std::vector<T> const& values) : _values(values) { - assert(!value.empty()); + assert(!values.empty()); } + + bool isTimeDependent() const override { return false; } + unsigned getNumberOfComponents() const override { - return static_cast<unsigned>(_value.size()); + return static_cast<unsigned>(_values.size()); } std::vector<T> const& operator()( double const /*t*/, SpatialPosition const& /*pos*/) const override { - return _value; + return _values; } private: - std::vector<T> const _value; + std::vector<T> const _values; }; std::unique_ptr<ParameterBase> createConstantParameter( diff --git a/ProcessLib/Parameter/CurveScaledParameter.h b/ProcessLib/Parameter/CurveScaledParameter.h index d363e1e857b6d54a4ea17158256f84db482d93f7..5ff5b640d006559488b3dd511a3ea9d013ce49ee 100644 --- a/ProcessLib/Parameter/CurveScaledParameter.h +++ b/ProcessLib/Parameter/CurveScaledParameter.h @@ -26,6 +26,8 @@ struct CurveScaledParameter final : public Parameter<T> { { } + bool isTimeDependent() const override { return true; } + void initialize( std::vector< std::unique_ptr<ProcessLib::ParameterBase>> const& parameters) diff --git a/ProcessLib/Parameter/MeshElementParameter.h b/ProcessLib/Parameter/MeshElementParameter.h index eda4c4fbaa1f4f7daa12f61bec4928e3103174a9..9058ca0c3f370f10ff73528b83c74087376ae93d 100644 --- a/ProcessLib/Parameter/MeshElementParameter.h +++ b/ProcessLib/Parameter/MeshElementParameter.h @@ -29,6 +29,8 @@ struct MeshElementParameter final : public Parameter<T> { { } + bool isTimeDependent() const override { return false; } + unsigned getNumberOfComponents() const override { return _property.getNumberOfComponents(); diff --git a/ProcessLib/Parameter/MeshNodeParameter.h b/ProcessLib/Parameter/MeshNodeParameter.h index 35f9041e0639cd62f526e2c7fa7a7c541f5dda04..dd39a0ff7ffb0179230bd0b5116257d3f9ae42ee 100644 --- a/ProcessLib/Parameter/MeshNodeParameter.h +++ b/ProcessLib/Parameter/MeshNodeParameter.h @@ -29,6 +29,8 @@ struct MeshNodeParameter final : public Parameter<T> { { } + bool isTimeDependent() const override { return false; } + unsigned getNumberOfComponents() const override { return _property.getNumberOfComponents(); diff --git a/ProcessLib/Parameter/Parameter.h b/ProcessLib/Parameter/Parameter.h index 14de825b6e756724a6cd77c6d7237f261b74b3a9..ac4208ff81a46b07f9243d9ad7f41b40d985cf9c 100644 --- a/ProcessLib/Parameter/Parameter.h +++ b/ProcessLib/Parameter/Parameter.h @@ -39,6 +39,8 @@ struct ParameterBase { virtual ~ParameterBase() = default; + virtual bool isTimeDependent() const = 0; + /// Parameters might depend on each other; this method allows to set up the /// dependencies between parameters after they have been constructed. virtual void initialize(