libMesh
|
Data structure for specifying which Parameters should be independent variables in a parameter sensitivity calculation. More...
#include <parameter_vector.h>
Public Member Functions | |
ParameterVector () | |
Default constructor: "no parameters". More... | |
ParameterVector (const std::vector< Number * > ¶ms) | |
Constructor-from-vector-of-Number*: each points to a parameter. More... | |
~ParameterVector () | |
Destructor - deletes ParameterAccessor objects. More... | |
void | deep_copy (ParameterVector &target) const |
Deep copy constructor: the target will now own new copies of all the parameter values I'm pointing to. More... | |
void | shallow_copy (ParameterVector &target) const |
Shallow copy constructor: the target will now point to all the parameter values I'm pointing to. More... | |
void | value_copy (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. More... | |
void | clear () |
Resets to "no parameters". More... | |
std::size_t | size () const |
void | resize (std::size_t s) |
Sets the number of parameters to be used. More... | |
void | push_back (std::unique_ptr< ParameterAccessor< Number >> new_accessor) |
Adds an additional parameter accessor to the end of the vector. More... | |
void | deep_resize (std::size_t s) |
Sets the number of parameters to be used. More... | |
const ParameterAccessor< Number > & | operator[] (std::size_t i) const |
ParameterAccessor< Number > & | operator[] (std::size_t i) |
ParameterVector & | operator*= (const Number a) |
Multiplication operator; acts individually on each parameter. More... | |
ParameterVector & | operator+= (const ParameterVector &a) |
Addition operator. More... | |
Private Attributes | |
std::vector< ParameterAccessor< Number > * > | _params |
Pointers to parameters which may exist elsewhere. More... | |
std::vector< Number > | _my_data |
Parameters which I own; e.g. More... | |
bool | _is_shallow_copy |
Am I a shallow copy? If so then I shouldn't be deleting my ParameterAccessors. More... | |
Data structure for specifying which Parameters should be independent variables in a parameter sensitivity calculation.
Specifies parameters for parameter sensitivity calculations.
Definition at line 44 of file parameter_vector.h.
|
inline |
|
explicit |
Constructor-from-vector-of-Number*: each points to a parameter.
Definition at line 27 of file parameter_vector.C.
References _params.
|
inline |
Destructor - deletes ParameterAccessor objects.
Definition at line 162 of file parameter_vector.h.
References clear().
|
inline |
Resets to "no parameters".
Definition at line 170 of file parameter_vector.h.
References _is_shallow_copy, _my_data, and _params.
Referenced by deep_copy(), LaplaceSystem::get_parameter_vector(), and ~ParameterVector().
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 38 of file parameter_vector.C.
References _my_data, _params, and clear().
Referenced by libMesh::ImplicitSystem::qoi_parameter_hessian_vector_product(), libMesh::ImplicitSystem::weighted_sensitivity_adjoint_solve(), and libMesh::ImplicitSystem::weighted_sensitivity_solve().
void libMesh::ParameterVector::deep_resize | ( | std::size_t | 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 95 of file parameter_vector.C.
References _is_shallow_copy, _my_data, _params, and libMesh::libmesh_assert().
ParameterVector & libMesh::ParameterVector::operator*= | ( | const Number | a | ) |
Multiplication operator; acts individually on each parameter.
Definition at line 108 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 118 of file parameter_vector.C.
References _params.
|
inline |
Definition at line 204 of file parameter_vector.h.
References _params.
|
inline |
Definition at line 194 of file parameter_vector.h.
References _params.
|
inline |
Adds an additional parameter accessor to the end of the vector.
We will free this accessor when we are finished with it; we request that it be passed to us as a std::unique_ptr to reflect that fact in the API.
Definition at line 183 of file parameter_vector.h.
References _is_shallow_copy, _params, and libMesh::libmesh_assert().
Referenced by CoupledSystem::get_parameter_vector(), and HeatSystem::get_parameter_vector().
void libMesh::ParameterVector::resize | ( | std::size_t | s | ) |
Sets the number of parameters to be used.
If the new size is larger than the old, empty ParameterPointer accessors fill the new entries.
Definition at line 74 of file parameter_vector.C.
References _is_shallow_copy, _params, and libMesh::libmesh_assert().
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 54 of file parameter_vector.C.
References _is_shallow_copy, _my_data, and _params.
|
inline |
Definition at line 90 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().
void libMesh::ParameterVector::value_copy | ( | 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 63 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().
|
private |
Am I a shallow copy? If so then I shouldn't be deleting my ParameterAccessors.
Definition at line 153 of file parameter_vector.h.
Referenced by clear(), deep_resize(), push_back(), resize(), and shallow_copy().
|
private |
Parameters which I own; e.g.
as the result of a deep copy
Definition at line 147 of file parameter_vector.h.
Referenced by clear(), deep_copy(), deep_resize(), and shallow_copy().
|
private |
Pointers to parameters which may exist elsewhere.
Definition at line 142 of file parameter_vector.h.
Referenced by clear(), deep_copy(), deep_resize(), operator*=(), operator+=(), operator[](), ParameterVector(), push_back(), resize(), shallow_copy(), size(), and value_copy().