20 #ifndef LIBMESH_PARSED_FUNCTION_PARAMETER_H
21 #define LIBMESH_PARSED_FUNCTION_PARAMETER_H
25 #include "libmesh/libmesh_common.h"
26 #include "libmesh/parameter_accessor.h"
27 #include "libmesh/parsed_function.h"
45 template <
typename T=Number>
57 std::string param_name) :
58 _func(func_ref),
_name(std::move(param_name)) {}
63 virtual ParameterAccessor<T> &
69 virtual void set (
const T & new_value)
override {
76 virtual const T &
get ()
const override {
84 virtual std::unique_ptr<ParameterAccessor<T>>
clone()
const override {
85 return std::make_unique<ParsedFunctionParameter<T>>(
_func,
_name);
98 #endif // LIBMESH_PARSED_FUNCTION_PARAMETER_H
void set_inline_value(std::string_view inline_var_name, Output newval)
Changes the value of an inline variable.
virtual void set(const T &new_value) override
设置器:更改我们访问的参数的值。
Output get_inline_value(std::string_view inline_var_name) const
获取内联变量的值。
访问器对象,允许在参数敏感性计算中读取和修改参数的独立变量。
ParsedFunctionParameter(ParsedFunction< T > &func_ref, std::string param_name)
构造函数:接受要修改的函数和表示我们要访问的内联变量的名称。
libMesh::Number _current_val
virtual ParameterAccessor< T > & operator=(T *)
简单的重置器对于解析函数是无效的
ParsedFunction< T > & _func
virtual std::unique_ptr< ParameterAccessor< T > > clone() const override