libMesh::ParameterVector Class Reference
#include <parameter_vector.h>
Public Member Functions | |
| ParameterVector () | |
| ParameterVector (const std::vector< Number * > ¶ms) | |
| void | deep_copy (ParameterVector &target) const |
| void | shallow_copy (ParameterVector &target) const |
| void | value_copy (const ParameterVector &target) const |
| void | clear () |
| std::size_t | size () const |
| void | resize (unsigned int s) |
| void | deep_resize (unsigned int s) |
| Number * | operator[] (unsigned int i) const |
| Number *& | operator[] (unsigned int i) |
| ParameterVector & | operator*= (const Number a) |
| ParameterVector & | operator+= (const ParameterVector &a) |
| const ParameterVector & | operator+= (const ParameterVector &a) const |
Private Attributes | |
| std::vector< Number * > | _params |
| std::vector< Number > | _my_data |
Detailed Description
Data structure for specifying which Parameters should be independent variables in a parameter sensitivity calculation.
Definition at line 38 of file parameter_vector.h.
Constructor & Destructor Documentation
| libMesh::ParameterVector::ParameterVector | ( | ) | [inline] |
| libMesh::ParameterVector::ParameterVector | ( | const std::vector< Number * > & | params | ) | [inline, explicit] |
Constructor-from-vector-of-Number*: each points to a parameter
Definition at line 50 of file parameter_vector.h.
00050 : _params(params) {}
Member Function Documentation
| void libMesh::ParameterVector::clear | ( | ) | [inline] |
Resets to "no parameters"
Definition at line 74 of file parameter_vector.h.
References _params.
00074 { _params.clear(); }
| void libMesh::ParameterVector::deep_copy | ( | ParameterVector & | target | ) | const |
Deep copy constructor: the target will now own new copies of all the parameter values I'm pointing to
Definition at line 33 of file parameter_vector.C.
References _my_data, and _params.
Referenced by libMesh::ImplicitSystem::qoi_parameter_hessian_vector_product(), libMesh::ImplicitSystem::weighted_sensitivity_adjoint_solve(), and libMesh::ImplicitSystem::weighted_sensitivity_solve().
00034 { 00035 const unsigned int Np = libmesh_cast_int<unsigned int> 00036 (this->_params.size()); 00037 target._params.resize(Np); 00038 target._my_data.resize(Np); 00039 for (unsigned int i=0; i != Np; ++i) 00040 { 00041 target._params[i] = &target._my_data[i]; 00042 target._my_data[i] = *(this->_params[i]); 00043 } 00044 }
| void libMesh::ParameterVector::deep_resize | ( | unsigned int | s | ) |
Sets the number of parameters to be used. This method is for resizing a ParameterVector that owns its own parameter values
Definition at line 68 of file parameter_vector.C.
| ParameterVector & libMesh::ParameterVector::operator*= | ( | const Number | a | ) |
Multiplication operator; acts individually on each parameter.
Definition at line 78 of file parameter_vector.C.
References _params.
| const ParameterVector & libMesh::ParameterVector::operator+= | ( | const ParameterVector & | a | ) | const |
Addition operator. The parameter vector to be added in must have the same number of values.
Definition at line 89 of file parameter_vector.C.
References _params.
| ParameterVector & libMesh::ParameterVector::operator+= | ( | const ParameterVector & | a | ) |
Addition operator. The parameter vector to be added in must have the same number of values.
Definition at line 100 of file parameter_vector.C.
| Number *& libMesh::ParameterVector::operator[] | ( | unsigned int | i | ) | [inline] |
Returns a reference to a pointer to a parameter value, suitable for repointing it to a different address.
Definition at line 152 of file parameter_vector.h.
References _params.
| Number * libMesh::ParameterVector::operator[] | ( | unsigned int | i | ) | const [inline] |
Returns a pointer to a parameter value
Definition at line 142 of file parameter_vector.h.
References _params.
| void libMesh::ParameterVector::resize | ( | unsigned int | s | ) | [inline] |
Sets the number of parameters to be used. This method is for resizing a ParameterVector that acts as a proxy to other parameter values
Definition at line 86 of file parameter_vector.h.
References _params.
00086 { _params.resize(s); }
| void libMesh::ParameterVector::shallow_copy | ( | ParameterVector & | target | ) | const |
Shallow copy constructor: the target will now point to all the parameter values I'm pointing to
Definition at line 48 of file parameter_vector.C.
References _my_data, and _params.
00049 { 00050 target._my_data.clear(); 00051 target._params = this->_params; 00052 }
| std::size_t libMesh::ParameterVector::size | ( | ) | const [inline] |
Returns the number of parameters to be used
Definition at line 79 of file parameter_vector.h.
References _params.
Referenced by libMesh::ImplicitSystem::adjoint_qoi_parameter_sensitivity(), libMesh::SensitivityData::allocate_data(), libMesh::SensitivityData::allocate_hessian_data(), libMesh::ImplicitSystem::assemble_residual_derivatives(), libMesh::ImplicitSystem::forward_qoi_parameter_sensitivity(), libMesh::ImplicitSystem::qoi_parameter_hessian(), libMesh::ImplicitSystem::qoi_parameter_hessian_vector_product(), libMesh::System::qoi_parameter_sensitivity(), and libMesh::ImplicitSystem::sensitivity_solve().
00079 { return _params.size(); }
| void libMesh::ParameterVector::value_copy | ( | const ParameterVector & | target | ) | const |
Value copy method: the target, which should already have as many parameters as I do, will now have those parameters set to my values.
Definition at line 56 of file parameter_vector.C.
References _params.
Referenced by libMesh::ImplicitSystem::qoi_parameter_hessian_vector_product(), libMesh::ImplicitSystem::weighted_sensitivity_adjoint_solve(), and libMesh::ImplicitSystem::weighted_sensitivity_solve().
Member Data Documentation
std::vector<Number> libMesh::ParameterVector::_my_data [private] |
Parameters which I own; e.g. as the result of a deep copy
Definition at line 131 of file parameter_vector.h.
Referenced by deep_copy(), deep_resize(), and shallow_copy().
std::vector<Number *> libMesh::ParameterVector::_params [private] |
Pointers to parameters which may exist elsewhere
Definition at line 126 of file parameter_vector.h.
Referenced by clear(), deep_copy(), deep_resize(), operator*=(), operator+=(), operator[](), resize(), shallow_copy(), size(), and value_copy().
The documentation for this class was generated from the following files:
Site Created By: libMesh Developers
Last modified: February 05 2013 19:55:32 UTC
Hosted By: