libMesh
Public Member Functions | List of all members
libMesh::ParameterAccessor< T > Class Template Referenceabstract

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

#include <parameter_accessor.h>

Inheritance diagram for libMesh::ParameterAccessor< T >:
[legend]

Public Member Functions

virtual ~ParameterAccessor ()
 Virtual destructor - we'll be deleting subclasses from pointers-to-ParameterAccessor. More...
 
virtual void set (const T &new_value)=0
 Setter: change the value of the parameter we access. More...
 
virtual const T & get () const =0
 Getter: get the value of the parameter we access. More...
 
virtual ParameterAccessor< T > & operator= (T *)
 Reseater: change the location of the parameter we access. More...
 
ParameterProxy< T > operator* ()
 Proxy: for backward compatibility, we allow codes to treat a ParameterAccessor as if it were a simple pointer-to-value. More...
 
ConstParameterProxy< T > operator* () const
 
virtual UniquePtr< ParameterAccessor< T > > clone () const =0
 

Detailed Description

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

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

This is an abstract base class. Derived objects may simply modify the parameter value at some address in memory, or may call arbitrary setter/getter functions.

Author
Roy Stogner
Date
2015 Base class for reading/writing sensitivity parameters.

Definition at line 53 of file parameter_accessor.h.

Constructor & Destructor Documentation

template<typename T = Number>
virtual libMesh::ParameterAccessor< T >::~ParameterAccessor ( )
virtual

Virtual destructor - we'll be deleting subclasses from pointers-to-ParameterAccessor.

Definition at line 60 of file parameter_accessor.h.

60 {}

Member Function Documentation

template<typename T = Number>
virtual UniquePtr<ParameterAccessor<T> > libMesh::ParameterAccessor< T >::clone ( ) const
pure virtual
Returns
A new copy of the accessor. The new copy should probably be as shallow as possible, but should still access the same parameter.

Implemented in libMesh::ParameterMultiAccessor< T >, libMesh::ParameterMultiPointer< T >, libMesh::ParsedFEMFunctionParameter< T >, libMesh::ParsedFunctionParameter< T >, and libMesh::ParameterPointer< T >.

Referenced by libMesh::ParameterAccessor< T >::operator*(), and libMesh::ParameterMultiAccessor< T >::push_back().

template<typename T = Number>
virtual const T& libMesh::ParameterAccessor< T >::get ( ) const
pure virtual
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 88 of file parameter_accessor.h.

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

Definition at line 90 of file parameter_accessor.h.

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

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

Reseater: change the location of the parameter we access.

This is included for backward compatibility, but will be deprecated in some classes and not implemented in others.

Reimplemented in libMesh::ParameterMultiAccessor< T >, libMesh::ParameterPointer< T >, libMesh::ParsedFEMFunctionParameter< T >, libMesh::ParsedFunctionParameter< T >, and libMesh::ParameterMultiPointer< T >.

Definition at line 79 of file parameter_accessor.h.

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

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