libMesh::ParsedFEMFunctionParameter< T > Class Template Reference

Stores a pointer to a ParsedFEMFunction and a string for the parameter. More...

#include <parsed_fem_function_parameter.h>

Inheritance diagram for libMesh::ParsedFEMFunctionParameter< T >:

Public Member Functions

 ParsedFEMFunctionParameter (ParsedFEMFunction< 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 UniquePtr< ParameterAccessor< T > > clone () const
 
ParameterProxy< T > operator* ()
 
ConstParameterProxy< T > operator* () const
 

Private Attributes

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

Detailed Description

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

Stores a pointer to a ParsedFEMFunction 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 ParsedFEMFunction objects: it stores a pointer to the ParsedFEMFunction and a string describing the parameter (an inline variable) name to be accessed.

Author
Roy Stogner
Date
2015

Definition at line 47 of file parsed_fem_function_parameter.h.

Constructor & Destructor Documentation

template<typename T = Number>
libMesh::ParsedFEMFunctionParameter< T >::ParsedFEMFunctionParameter ( ParsedFEMFunction< T > &  func_ref,
const std::string &  param_name 
)
inline

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 ParsedFEMFunction apply to this interface as well.

Note that 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 61 of file parsed_fem_function_parameter.h.

62  :
63  _func(func_ref), _name(param_name) {}

Member Function Documentation

template<typename T = Number>
virtual UniquePtr<ParameterAccessor<T> > libMesh::ParsedFEMFunctionParameter< T >::clone ( ) const
inlinevirtual

Returns a new copy of the accessor.

Implements libMesh::ParameterAccessor< T >.

Definition at line 89 of file parsed_fem_function_parameter.h.

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

89  {
90  return UniquePtr<ParameterAccessor<T> >
91  (new ParsedFEMFunctionParameter<T>(_func, _name));
92  }
template<typename T = Number>
ParameterProxy<T> libMesh::ParameterAccessor< T >::operator* ( )
inlineinherited

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 86 of file parameter_accessor.h.

86 { return ParameterProxy<T>(*this); }
template<typename T = Number>
ConstParameterProxy<T> libMesh::ParameterAccessor< T >::operator* ( ) const
inlineinherited

Definition at line 88 of file parameter_accessor.h.

References libMesh::ParameterAccessor< T >::clone().

88 { return ConstParameterProxy<T>(*this); }
template<typename T = Number>
virtual ParameterAccessor<T>& libMesh::ParsedFEMFunctionParameter< T >::operator= ( T *  )
inlinevirtual

A simple reseater won't work with a parsed function

Reimplemented from libMesh::ParameterAccessor< T >.

Definition at line 69 of file parsed_fem_function_parameter.h.

69 { libmesh_error(); return *this; }
template<typename T = Number>
virtual void libMesh::ParsedFEMFunctionParameter< T >::set ( const T &  new_value)
inlinevirtual

Setter: change the value of the parameter we access.

Implements libMesh::ParameterAccessor< T >.

Definition at line 74 of file parsed_fem_function_parameter.h.

References libMesh::ParsedFEMFunctionParameter< T >::_func, libMesh::ParsedFEMFunctionParameter< T >::_name, and libMesh::ParsedFEMFunction< Output >::set_inline_value().

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

Member Data Documentation

template<typename T = Number>
libMesh::Number libMesh::ParsedFEMFunctionParameter< T >::_current_val
mutableprivate

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