libMesh::ParsedFunctionParameter< T > Class Template Reference

Stores a pointer to a parsed function and a string for the parameter. More...

#include <parsed_function_parameter.h>

Inheritance diagram for libMesh::ParsedFunctionParameter< T >:

Public Member Functions

 ParsedFunctionParameter (ParsedFunction< T > &func_ref, const std::string &param_name)
virtual ParameterAccessor< T > & operator= (T *)
virtual void set (const T &new_value)
virtual const T & get () const
virtual std::unique_ptr< ParameterAccessor< T > > clone () const
ParameterProxy< T > operator* ()
ConstParameterProxy< T > operator* () const

Private Attributes

ParsedFunction< T > & _func
std::string _name
libMesh::Number _current_val

Detailed Description

template<typename T = Number>
class libMesh::ParsedFunctionParameter< T >

Stores a pointer to a parsed function and a string for the parameter.

Accessor object allowing reading and modification of the independent variables in a parameter sensitivity calculation.

This ParameterAccessor subclass is specific to ParsedFunction objects: it stores a pointer to the ParsedFunction and a string describing the parameter (an inline variable) name to be accessed.

Roy Stogner

Definition at line 45 of file parsed_function_parameter.h.

Constructor & Destructor Documentation

◆ ParsedFunctionParameter()

template<typename T = Number>
libMesh::ParsedFunctionParameter< T >::ParsedFunctionParameter ( ParsedFunction< T > &  func_ref,
const std::string &  param_name 

Constructor: take the function to be modified and the name of the inline variable within it which represents our parameter.

The restrictions of get_inline_value() and set_inline_value() in ParsedFunction apply to this interface as well.

Only the function referred to here is changed by set() - any clones of the function which precede the set() remain at their previous values.

Definition at line 59 of file parsed_function_parameter.h.

60  :
61  _func(func_ref), _name(param_name) {}

Member Function Documentation

◆ clone()

template<typename T = Number>
virtual std::unique_ptr<ParameterAccessor<T> > libMesh::ParsedFunctionParameter< T >::clone ( ) const
A new copy of the accessor.

Implements libMesh::ParameterAccessor< T >.

Definition at line 87 of file parsed_function_parameter.h.

References libMesh::ParsedFunctionParameter< T >::_func, and libMesh::ParsedFunctionParameter< T >::_name.

87  {
88  return std::unique_ptr<ParameterAccessor<T>>
89  (new ParsedFunctionParameter<T>(_func, _name));
90  }

◆ get()

template<typename T = Number>
virtual const T& libMesh::ParsedFunctionParameter< T >::get ( ) const

◆ operator*() [1/2]

template<typename T = Number>
ParameterProxy<T> libMesh::ParameterAccessor< T >::operator* ( )

Proxy: for backward compatibility, we allow codes to treat a ParameterAccessor as if it were a simple pointer-to-value. We can't safely allow "Number * n = parameter_vector[p]" to compile, but we can allow "*parameter_vector[p] += deltap" to work.

Definition at line 91 of file parameter_accessor.h.

91 { return ParameterProxy<T>(*this); }

◆ operator*() [2/2]

template<typename T = Number>
ConstParameterProxy<T> libMesh::ParameterAccessor< T >::operator* ( ) const

Definition at line 93 of file parameter_accessor.h.

93 { return ConstParameterProxy<T>(*this); }

◆ operator=()

template<typename T = Number>
virtual ParameterAccessor<T>& libMesh::ParsedFunctionParameter< T >::operator= ( T *  )

A simple reseater won't work with a parsed function

Reimplemented from libMesh::ParameterAccessor< T >.

Definition at line 67 of file parsed_function_parameter.h.

67 { libmesh_error(); return *this; }

◆ set()

template<typename T = Number>
virtual void libMesh::ParsedFunctionParameter< T >::set ( const T &  new_value)

Setter: change the value of the parameter we access.

Implements libMesh::ParameterAccessor< T >.

Definition at line 72 of file parsed_function_parameter.h.

References libMesh::ParsedFunctionParameter< T >::_func, libMesh::ParsedFunctionParameter< T >::_name, and libMesh::ParsedFunction< Output, OutputGradient >::set_inline_value().

72  {
73  _func.set_inline_value(_name, new_value);
74  }
void set_inline_value(const std::string &inline_var_name, Output newval)

Member Data Documentation

◆ _current_val

template<typename T = Number>
libMesh::Number libMesh::ParsedFunctionParameter< T >::_current_val

◆ _func

◆ _name

The documentation for this class was generated from the following file: