OGS
Function.h
Go to the documentation of this file.
1
9#pragma once
10
11#include <utility>
12#include <vector>
13
16
17namespace MaterialPropertyLib
18{
25class Function final : public Property
26{
27public:
29 std::string name,
30 std::vector<std::string> const& value_string_expressions,
31 std::vector<std::pair<std::string, std::vector<std::string>>> const&
32 dvalue_string_expressions);
33
34 PropertyDataType value(VariableArray const& variable_array,
36 double const t,
37 double const dt) const override;
38
39 PropertyDataType dValue(VariableArray const& variable_array,
40 Variable const variable,
42 double const t,
43 double const dt) const override;
44
46
47private:
48 template <int D>
50
51 std::unique_ptr<Implementation<2>> impl2_;
52 std::unique_ptr<Implementation<3>> impl3_;
53
54 std::variant<Function::Implementation<2>*, Function::Implementation<3>*>
56 VariableArray const& variable_array) const;
57
59 std::vector<Variable> variables_;
60
61 mutable std::mutex mutex_;
62};
63} // namespace MaterialPropertyLib
std::unique_ptr< Implementation< 3 > > impl3_
Definition Function.h:52
std::vector< Variable > variables_
Variables used in the exprtk expressions.
Definition Function.h:59
std::variant< Function::Implementation< 2 > *, Function::Implementation< 3 > * > getImplementationForDimensionOfVariableArray(VariableArray const &variable_array) const
Definition Function.cpp:346
Function(std::string name, std::vector< std::string > const &value_string_expressions, std::vector< std::pair< std::string, std::vector< std::string > > > const &dvalue_string_expressions)
Definition Function.cpp:323
PropertyDataType dValue(VariableArray const &variable_array, Variable const variable, ParameterLib::SpatialPosition const &pos, double const t, double const dt) const override
Definition Function.cpp:377
std::unique_ptr< Implementation< 2 > > impl2_
Definition Function.h:51
virtual PropertyDataType value() const
Definition Property.cpp:76
std::variant< double, Eigen::Matrix< double, 2, 1 >, Eigen::Matrix< double, 3, 1 >, Eigen::Matrix< double, 2, 2 >, Eigen::Matrix< double, 3, 3 >, Eigen::Matrix< double, 4, 1 >, Eigen::Matrix< double, 6, 1 >, Eigen::MatrixXd > PropertyDataType
Definition Property.h:31