libMesh::SensitivityData Class Reference
#include <sensitivity_data.h>
Classes | |
| class | ConstRow |
| class | Row |
Public Member Functions | |
| SensitivityData () | |
| SensitivityData (const QoISet &qoi_indices, const System &sys, const ParameterVector ¶meter_vector) | |
| void | clear () |
| void | allocate_data (const QoISet &qoi_indices, const System &sys, const ParameterVector ¶meter_vector) |
| void | allocate_hessian_data (const QoISet &qoi_indices, const System &sys, const ParameterVector ¶meter_vector) |
| const Number & | derivative (unsigned int qoi_index, unsigned int parameter_index) const |
| const Number & | second_derivative (unsigned int qoi_index, unsigned int parameter_index1, unsigned int parameter_index2) const |
| Number & | derivative (unsigned int qoi_index, unsigned int parameter_index) |
| Number & | second_derivative (unsigned int qoi_index, unsigned int parameter_index1, unsigned int parameter_index2) |
| ConstRow | operator[] (unsigned int qoi) const |
| Row | operator[] (unsigned int qoi) |
Private Attributes | |
| std::vector< std::vector < Number > > | _grad_data |
| std::vector< std::vector < std::vector< Number > > > | _hess_data |
Detailed Description
Data structure for holding completed parameter sensitivity calculations.
Definition at line 42 of file sensitivity_data.h.
Constructor & Destructor Documentation
| libMesh::SensitivityData::SensitivityData | ( | ) | [inline] |
| libMesh::SensitivityData::SensitivityData | ( | const QoISet & | qoi_indices, | |
| const System & | sys, | |||
| const ParameterVector & | parameter_vector | |||
| ) | [inline] |
Constructor from QoISet and ParameterVector: allocates space for all required sensitivities
Definition at line 156 of file sensitivity_data.h.
References allocate_data().
00159 { 00160 this->allocate_data(qoi_indices, sys, parameter_vector); 00161 }
Member Function Documentation
| void libMesh::SensitivityData::allocate_data | ( | const QoISet & | qoi_indices, | |
| const System & | sys, | |||
| const ParameterVector & | parameter_vector | |||
| ) | [inline] |
Given QoISet and ParameterVector, allocates space for all required first derivative data
Definition at line 166 of file sensitivity_data.h.
References _grad_data, libMesh::QoISet::has_index(), libMesh::System::qoi, and libMesh::ParameterVector::size().
Referenced by libMesh::ImplicitSystem::adjoint_qoi_parameter_sensitivity(), libMesh::ImplicitSystem::forward_qoi_parameter_sensitivity(), libMesh::ImplicitSystem::qoi_parameter_hessian_vector_product(), and SensitivityData().
00169 { 00170 const std::size_t Np = parameter_vector.size(); 00171 const unsigned int Nq = 00172 libmesh_cast_int<unsigned int>(sys.qoi.size()); 00173 00174 if (_grad_data.size() < Nq) 00175 _grad_data.resize(Nq); 00176 00177 for (unsigned int i=0; i != Nq; ++i) 00178 if (qoi_indices.has_index(i)) 00179 { 00180 _grad_data[i].clear(); 00181 _grad_data[i].resize(Np); 00182 } 00183 }
| void libMesh::SensitivityData::allocate_hessian_data | ( | const QoISet & | qoi_indices, | |
| const System & | sys, | |||
| const ParameterVector & | parameter_vector | |||
| ) | [inline] |
Given QoISet and ParameterVector, allocates space for all required second derivative data
Definition at line 188 of file sensitivity_data.h.
References _hess_data, libMesh::QoISet::has_index(), libMesh::System::qoi, and libMesh::ParameterVector::size().
Referenced by libMesh::ImplicitSystem::qoi_parameter_hessian().
00191 { 00192 const std::size_t Np = parameter_vector.size(); 00193 const unsigned int Nq = 00194 libmesh_cast_int<unsigned int>(sys.qoi.size()); 00195 00196 if (_hess_data.size() < Nq) 00197 _hess_data.resize(Nq); 00198 00199 for (unsigned int i=0; i != Nq; ++i) 00200 if (qoi_indices.has_index(i)) 00201 { 00202 _hess_data[i].clear(); 00203 _hess_data[i].resize(Np); 00204 for (std::size_t j=0; j != Np; ++j) 00205 _hess_data[i][j].resize(Np); 00206 } 00207 }
| void libMesh::SensitivityData::clear | ( | ) | [inline] |
Clears and deallocates all data
Definition at line 83 of file sensitivity_data.h.
References _grad_data.
00083 { _grad_data.clear(); }
| Number & libMesh::SensitivityData::derivative | ( | unsigned int | qoi_index, | |
| unsigned int | parameter_index | |||
| ) | [inline] |
Gets/sets the parameter sensitivity derivative for the specified quantity of interest for the specified parameter
Definition at line 224 of file sensitivity_data.h.
References _grad_data.
00226 { 00227 libmesh_assert_less (qoi_index, _grad_data.size()); 00228 libmesh_assert_less (parameter_index, _grad_data[qoi_index].size()); 00229 00230 return _grad_data[qoi_index][parameter_index]; 00231 }
| const Number & libMesh::SensitivityData::derivative | ( | unsigned int | qoi_index, | |
| unsigned int | parameter_index | |||
| ) | const [inline] |
Returns the parameter sensitivity derivative for the specified quantity of interest for the specified parameter
Definition at line 212 of file sensitivity_data.h.
References _grad_data.
Referenced by libMesh::SensitivityData::ConstRow::operator[](), and libMesh::SensitivityData::Row::operator[]().
00214 { 00215 libmesh_assert_less (qoi_index, _grad_data.size()); 00216 libmesh_assert_less (parameter_index, _grad_data[qoi_index].size()); 00217 00218 return _grad_data[qoi_index][parameter_index]; 00219 }
| Row libMesh::SensitivityData::operator[] | ( | unsigned int | qoi | ) | [inline] |
Definition at line 138 of file sensitivity_data.h.
00138 { return Row(*this, qoi); }
| ConstRow libMesh::SensitivityData::operator[] | ( | unsigned int | qoi | ) | const [inline] |
Vector address type operator: sd[q][p] is an alias for sd.derivative(q,p)
Definition at line 136 of file sensitivity_data.h.
| Number & libMesh::SensitivityData::second_derivative | ( | unsigned int | qoi_index, | |
| unsigned int | parameter_index1, | |||
| unsigned int | parameter_index2 | |||
| ) | [inline] |
Gets/sets the parameter sensitivity second derivative for the specified quantity of interest for the specified pair of parameters
Definition at line 250 of file sensitivity_data.h.
References _hess_data.
00253 { 00254 libmesh_assert_less (qoi_index, _hess_data.size()); 00255 libmesh_assert_less (parameter_index1, _hess_data[qoi_index].size()); 00256 libmesh_assert_less (parameter_index2, _hess_data[qoi_index][parameter_index1].size()); 00257 00258 return _hess_data[qoi_index][parameter_index1][parameter_index2]; 00259 }
| const Number & libMesh::SensitivityData::second_derivative | ( | unsigned int | qoi_index, | |
| unsigned int | parameter_index1, | |||
| unsigned int | parameter_index2 | |||
| ) | const [inline] |
Returns the parameter sensitivity derivative for the specified quantity of interest for the specified pair of parameters
Definition at line 236 of file sensitivity_data.h.
References _hess_data.
Referenced by libMesh::ImplicitSystem::qoi_parameter_hessian().
00239 { 00240 libmesh_assert_less (qoi_index, _hess_data.size()); 00241 libmesh_assert_less (parameter_index1, _hess_data[qoi_index].size()); 00242 libmesh_assert_less (parameter_index2, _hess_data[qoi_index][parameter_index1].size()); 00243 00244 return _hess_data[qoi_index][parameter_index1][parameter_index2]; 00245 }
Member Data Documentation
std::vector<std::vector<Number> > libMesh::SensitivityData::_grad_data [private] |
Data storage; currently pretty trivial
Definition at line 144 of file sensitivity_data.h.
Referenced by allocate_data(), clear(), and derivative().
std::vector<std::vector<std::vector<Number> > > libMesh::SensitivityData::_hess_data [private] |
Definition at line 145 of file sensitivity_data.h.
Referenced by allocate_hessian_data(), and second_derivative().
The documentation for this class was generated from the following file:
Site Created By: libMesh Developers
Last modified: February 05 2013 19:55:38 UTC
Hosted By: