QoISet Class Reference
#include <qoi_set.h>
Classes | |
| class | iterator |
Public Member Functions | |
| QoISet () | |
| QoISet (const System &sys) | |
| QoISet (const std::vector< bool > &indices) | |
| QoISet (const std::vector< unsigned int > &indices) | |
| void | clear () |
| unsigned int | size (const System &sys) const |
| void | add_indices (const std::vector< unsigned int > &indices) |
| void | add_index (unsigned int) |
| void | remove_indices (const std::vector< unsigned int > &indices) |
| void | remove_index (unsigned int) |
| void | set_weight (unsigned int, Real) |
| Real | weight (unsigned int) const |
| bool | has_index (unsigned int) const |
Private Attributes | |
| std::vector< bool > | _indices |
| std::vector< bool > | _weights |
Detailed Description
Data structure for specifying which Quantities of Interest should be calculated in an adjoint or a parameter sensitivity calculation.Definition at line 42 of file qoi_set.h.
Constructor & Destructor Documentation
| QoISet::QoISet | ( | ) | [inline] |
| QoISet::QoISet | ( | const System & | sys | ) |
| QoISet::QoISet | ( | const std::vector< bool > & | indices | ) | [inline] |
| QoISet::QoISet | ( | const std::vector< unsigned int > & | indices | ) | [inline] |
Constructor-from-vector: "calculate the listed QoIs", "give every QoI weight 1.0"
Definition at line 180 of file qoi_set.h.
References add_indices().
00181 { 00182 this->add_indices(indices); 00183 }
Member Function Documentation
| void QoISet::add_index | ( | unsigned int | i | ) | [inline] |
| void QoISet::add_indices | ( | const std::vector< unsigned int > & | indices | ) |
Add this indices to the set to be calculated
Definition at line 50 of file qoi_set.C.
References _indices, std::max(), and size().
Referenced by QoISet().
00051 { 00052 unsigned int size = 0; 00053 for (std::vector<unsigned int>::const_iterator i = indices.begin(); 00054 i != indices.end(); ++i) 00055 size = std::max(size, *i + 1); 00056 00057 _indices.resize(size); 00058 00059 for (std::vector<unsigned int>::const_iterator i = indices.begin(); 00060 i != indices.end(); ++i) 00061 _indices[*i] = true; 00062 }
| void QoISet::clear | ( | ) | [inline] |
| bool QoISet::has_index | ( | unsigned int | i | ) | const [inline] |
Return whether or not this index is in the set to be calculated
Definition at line 207 of file qoi_set.h.
References _indices.
Referenced by ImplicitSystem::adjoint_qoi_parameter_sensitivity(), ImplicitSystem::adjoint_solve(), SensitivityData::allocate_data(), SensitivityData::allocate_hessian_data(), FEMSystem::assemble_qoi(), ExplicitSystem::assemble_qoi(), FEMSystem::assemble_qoi_derivative(), ExplicitSystem::assemble_qoi_derivative(), AdjointResidualErrorEstimator::estimate_error(), ImplicitSystem::forward_qoi_parameter_sensitivity(), ImplicitSystem::qoi_parameter_hessian(), ImplicitSystem::qoi_parameter_hessian_vector_product(), size(), and ImplicitSystem::weighted_sensitivity_adjoint_solve().
| void QoISet::remove_index | ( | unsigned int | i | ) | [inline] |
| void QoISet::remove_indices | ( | const std::vector< unsigned int > & | indices | ) | [inline] |
| void QoISet::set_weight | ( | unsigned int | i, | |
| Real | w | |||
| ) | [inline] |
| unsigned int QoISet::size | ( | const System & | sys | ) | const |
Returns the number of QoIs that would be computed for the System sys
Definition at line 39 of file qoi_set.C.
References has_index(), and System::qoi.
Referenced by add_indices(), and System::qoi_parameter_sensitivity().
00040 { 00041 unsigned int qoi_count = 0; 00042 for (unsigned int i=0; i != sys.qoi.size(); ++i) 00043 if (this->has_index(i)) 00044 qoi_count++; 00045 return qoi_count; 00046 }
| Real QoISet::weight | ( | unsigned int | i | ) | const [inline] |
Member Data Documentation
std::vector<bool> QoISet::_indices [private] |
Interpret _indices.empty() to mean "calculate all indices"
Definition at line 164 of file qoi_set.h.
Referenced by add_index(), add_indices(), clear(), has_index(), remove_index(), and remove_indices().
std::vector<bool> QoISet::_weights [private] |
Interpret _weights.size() <= i to mean "weight i = 1.0"
Definition at line 169 of file qoi_set.h.
Referenced by clear(), set_weight(), and weight().
The documentation for this class was generated from the following files: