33 #include "libmesh/diff_context.h"
41 assemble_qoi_sides =
false;
42 assemble_qoi_elements =
false;
49 for( std::vector<QoIBase*>::iterator qoi =
_qois.begin();
50 qoi !=
_qois.end(); ++qoi )
62 for(
unsigned int q = 0; q < this->
n_qois(); q++ )
67 return libMesh::UniquePtr<libMesh::DifferentiableQoI>(
clone);
76 this->assemble_qoi_elements =
true;
81 this->assemble_qoi_sides =
true;
89 sys_qoi.resize(
_qois.size(), 0.0);
96 for(
unsigned int q = 0; q <
_qois.size(); q++ )
104 for( std::vector<QoIBase*>::iterator qoi =
_qois.begin();
105 qoi !=
_qois.end(); ++qoi )
107 (*qoi)->init_context(c);
114 (
const std::string & param_name,
118 for(
unsigned int q = 0; q < _qois.size(); q++ )
119 (*_qois[q]).register_parameter(param_name, param_pointer);
125 for (
unsigned int i=0; i<this->
n_qois(); i++)
130 const libMesh::QoISet& )
134 for(
unsigned int q = 0; q <
_qois.size(); q++ )
143 const libMesh::QoISet& )
147 for(
unsigned int q = 0; q <
_qois.size(); q++ )
156 const libMesh::QoISet& )
160 for(
unsigned int q = 0; q <
_qois.size(); q++ )
169 const libMesh::QoISet& )
173 for(
unsigned int q = 0; q <
_qois.size(); q++ )
182 std::vector<libMesh::Number>& sys_qoi,
183 std::vector<libMesh::Number>& local_qoi,
184 const libMesh::QoISet& )
186 for(
unsigned int q = 0; q <
_qois.size(); q++ )
195 const std::vector<libMesh::Number>& other_qoi,
196 const libMesh::QoISet& )
198 for(
unsigned int q = 0; q <
_qois.size(); q++ )
208 for( std::vector<QoIBase*>::const_iterator qoi =
_qois.begin();
209 qoi !=
_qois.end(); ++qoi )
211 (*qoi)->output_qoi(out);
219 return (*
_qois[qoi_index]).value();
virtual bool assemble_on_interior() const =0
Does the QoI need an element interior assembly loop?
virtual void thread_join(std::vector< libMesh::Number > &qoi, const std::vector< libMesh::Number > &other_qoi, const libMesh::QoISet &qoi_indices)
Operation to accumulate the QoI from multiple MPI processes.
std::vector< QoIBase * > _qois
virtual void init_context(libMesh::DiffContext &context)
virtual void side_qoi_derivative(libMesh::DiffContext &context, const libMesh::QoISet &qois)
Compute the qoi derivative with respect to the solution on the domain boundary.
const QoIBase & get_qoi(unsigned int qoi_index) const
virtual bool assemble_on_sides() const =0
Does the QoI need a domain boundary assembly loop?
void register_parameter(const std::string ¶m_name, libMesh::ParameterMultiAccessor< libMesh::Number > ¶m_pointer) const
Each QoI will register its copy(s) of an independent variable.
virtual libMesh::UniquePtr< libMesh::DifferentiableQoI > clone()
Required to provide clone for adding QoI object to libMesh objects.
virtual void side_qoi(libMesh::DiffContext &context, const libMesh::QoISet &qoi_indices)
Compute the qoi value on the domain boundary.
virtual void element_qoi(libMesh::DiffContext &context, const libMesh::QoISet &qoi_indices)
Compute the qoi value for element interiors.
virtual void init_qoi(std::vector< libMesh::Number > &sys_qoi)
Method to allow QoI to resize libMesh::System storage of QoI computations.
virtual void parallel_op(const libMesh::Parallel::Communicator &communicator, std::vector< libMesh::Number > &sys_qoi, std::vector< libMesh::Number > &local_qoi, const libMesh::QoISet &qoi_indices)
Operation to accumulate the QoI from multiple MPI processes.
Interface with libMesh for solving Multiphysics problems.
virtual void add_qoi(const QoIBase &qoi)
void output_qoi(std::ostream &out) const
Basic output for computed QoI's.
virtual void init(const GetPot &input, const MultiphysicsSystem &system)
Method to allow QoI to cache any system information needed for QoI calculation, for example...
virtual void element_qoi_derivative(libMesh::DiffContext &context, const libMesh::QoISet &qoi_indices)
Compute the qoi derivative with respect to the solution on element interiors.
virtual QoIBase * clone() const =0
Clone this QoI.
libMesh::Number get_qoi_value(unsigned int qoi_index) const
Accessor for value of QoI for given qoi_index.
virtual void reinit(MultiphysicsSystem &system)
Reinitialize qoi.
unsigned int n_qois() const