$extrastylesheet
#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 |
| iterator | begin () const |
Private Attributes | |
| std::vector< bool > | _indices |
| std::vector< Real > | _weights |
Data structure for specifying which Quantities of Interest should be calculated in an adjoint or a parameter sensitivity calculation.
| libMesh::QoISet::QoISet | ( | ) | [inline] |
| libMesh::QoISet::QoISet | ( | const System & | sys | ) | [explicit] |
| libMesh::QoISet::QoISet | ( | const std::vector< bool > & | indices | ) | [inline, explicit] |
| libMesh::QoISet::QoISet | ( | const std::vector< unsigned int > & | indices | ) | [inline, explicit] |
Constructor-from-vector: "calculate the listed QoIs", "give every QoI weight 1.0"
Definition at line 188 of file qoi_set.h.
References add_indices().
: _indices(), _weights() { this->add_indices(indices); }
| void libMesh::QoISet::add_index | ( | unsigned int | i | ) | [inline] |
| void libMesh::QoISet::add_indices | ( | const std::vector< unsigned int > & | indices | ) |
Add this indices to the set to be calculated
Definition at line 49 of file qoi_set.C.
References _indices, and std::max().
Referenced by QoISet().
{
unsigned int max_size = 0;
for (std::vector<unsigned int>::const_iterator i = indices.begin();
i != indices.end(); ++i)
max_size = std::max(max_size, *i + 1);
_indices.resize(max_size);
for (std::vector<unsigned int>::const_iterator i = indices.begin();
i != indices.end(); ++i)
_indices[*i] = true;
}
| iterator libMesh::QoISet::begin | ( | ) | const [inline] |
| void libMesh::QoISet::clear | ( | ) | [inline] |
| bool libMesh::QoISet::has_index | ( | unsigned int | i | ) | const [inline] |
Return whether or not this index is in the set to be calculated
Definition at line 217 of file qoi_set.h.
References _indices.
Referenced by libMesh::ImplicitSystem::adjoint_qoi_parameter_sensitivity(), libMesh::ImplicitSystem::adjoint_solve(), libMesh::SensitivityData::allocate_data(), libMesh::SensitivityData::allocate_hessian_data(), libMesh::ExplicitSystem::assemble_qoi(), libMesh::FEMSystem::assemble_qoi(), libMesh::ExplicitSystem::assemble_qoi_derivative(), libMesh::FEMSystem::assemble_qoi_derivative(), libMesh::AdjointRefinementEstimator::estimate_error(), libMesh::AdjointResidualErrorEstimator::estimate_error(), libMesh::ImplicitSystem::forward_qoi_parameter_sensitivity(), libMesh::ImplicitSystem::qoi_parameter_hessian(), libMesh::ImplicitSystem::qoi_parameter_hessian_vector_product(), size(), and libMesh::ImplicitSystem::weighted_sensitivity_adjoint_solve().
| void libMesh::QoISet::remove_index | ( | unsigned int | i | ) | [inline] |
| void libMesh::QoISet::remove_indices | ( | const std::vector< unsigned int > & | indices | ) | [inline] |
| void libMesh::QoISet::set_weight | ( | unsigned int | i, |
| Real | w | ||
| ) | [inline] |
| unsigned int libMesh::QoISet::size | ( | const System & | sys | ) | const |
Returns the number of QoIs that would be computed for the System sys
Definition at line 38 of file qoi_set.C.
References has_index(), and libMesh::System::qoi.
Referenced by libMesh::System::qoi_parameter_sensitivity().
| Real libMesh::QoISet::weight | ( | unsigned int | i | ) | const [inline] |
Get the weight for this index (default 1.0)
Definition at line 236 of file qoi_set.h.
References _weights.
Referenced by libMesh::AdjointRefinementEstimator::estimate_error(), and libMesh::AdjointResidualErrorEstimator::estimate_error().
std::vector<bool> libMesh::QoISet::_indices [private] |
Interpret _indices.empty() to mean "calculate all indices"
Definition at line 172 of file qoi_set.h.
Referenced by add_index(), add_indices(), begin(), clear(), has_index(), remove_index(), and remove_indices().
std::vector<Real> libMesh::QoISet::_weights [private] |
Interpret _weights.size() <= i to mean "weight i = 1.0"
Definition at line 177 of file qoi_set.h.
Referenced by clear(), set_weight(), and weight().