GRINS-0.8.0
List of all members | Public Member Functions | Protected Attributes
GRINS::QoIBase Class Referenceabstract

#include <qoi_base.h>

Inheritance diagram for GRINS::QoIBase:
Inheritance graph
[legend]
Collaboration diagram for GRINS::QoIBase:
Collaboration graph
[legend]

Public Member Functions

 QoIBase (const std::string &qoi_name)
 
virtual ~QoIBase ()
 
virtual QoIBaseclone () const =0
 Clone this QoI. More...
 
virtual bool assemble_on_interior () const =0
 Does the QoI need an element interior assembly loop? More...
 
virtual bool assemble_on_sides () const =0
 Does the QoI need a domain boundary assembly loop? More...
 
virtual void init (const GetPot &, const MultiphysicsSystem &, unsigned int)
 Method to allow QoI to cache any system information needed for QoI calculation, for example, solution variable indices. More...
 
virtual void init_context (AssemblyContext &)
 
virtual void reinit (MultiphysicsSystem &)
 Reinitialize QoI. More...
 
virtual void element_qoi (AssemblyContext &, const unsigned int)
 Compute the qoi value for element interiors. More...
 
virtual void element_qoi_derivative (AssemblyContext &, const unsigned int)
 Compute the qoi derivative with respect to the solution on element interiors. More...
 
virtual void side_qoi (AssemblyContext &, const unsigned int)
 Compute the qoi value on the domain boundary. More...
 
virtual void side_qoi_derivative (AssemblyContext &, const unsigned int)
 Compute the qoi derivative with respect to the solution on the domain boundary. More...
 
virtual void parallel_op (const libMesh::Parallel::Communicator &communicator, libMesh::Number &sys_qoi, libMesh::Number &local_qoi)
 Call the parallel operation for this QoI and cache the value. More...
 
virtual void thread_join (libMesh::Number &qoi, const libMesh::Number &other_qoi)
 Call the operation to accumulate this QoI from multiple threads. More...
 
virtual void output_qoi (std::ostream &out) const
 Basic output for computed QoI's. More...
 
libMesh::Number value () const
 Returns the current QoI value. More...
 
const std::string & name () const
 Returns the name of this QoI. More...
 
- Public Member Functions inherited from GRINS::ParameterUser
 ParameterUser (const std::string &user_name)
 
virtual ~ParameterUser ()
 
virtual void set_parameter (libMesh::Number &param_variable, const GetPot &input, const std::string &param_name, libMesh::Number param_default)
 Each subclass can simultaneously read a parameter value from. More...
 
virtual void set_parameter (libMesh::ParsedFunction< libMesh::Number, libMesh::Gradient > &func, const GetPot &input, const std::string &func_param_name, const std::string &param_default)
 Each subclass can simultaneously read a parsed function from. More...
 
virtual void set_parameter (libMesh::ParsedFEMFunction< libMesh::Number > &func, const GetPot &input, const std::string &func_param_name, const std::string &param_default)
 Each subclass can simultaneously read a parsed function from. More...
 
virtual void move_parameter (const libMesh::Number &old_parameter, libMesh::Number &new_parameter)
 When cloning an object, we need to update parameter pointers. More...
 
virtual void move_parameter (const libMesh::ParsedFunction< libMesh::Number, libMesh::Gradient > &old_func, libMesh::ParsedFunction< libMesh::Number, libMesh::Gradient > &new_func)
 When cloning an object, we need to update parameter pointers. More...
 
virtual void move_parameter (const libMesh::ParsedFEMFunction< libMesh::Number > &old_func, libMesh::ParsedFEMFunction< libMesh::Number > &new_func)
 When cloning an object, we need to update parameter pointers. More...
 
virtual void register_parameter (const std::string &param_name, libMesh::ParameterMultiAccessor< libMesh::Number > &param_pointer) const
 Each subclass will register its copy of an independent. More...
 

Protected Attributes

std::string _qoi_name
 
libMesh::Number _qoi_value
 

Additional Inherited Members

- Static Public Attributes inherited from GRINS::ParameterUser
static std::string zero_vector_function = std::string("{0}")
 A parseable function string with LIBMESH_DIM components, all 0. More...
 

Detailed Description

Definition at line 48 of file qoi_base.h.

Constructor & Destructor Documentation

GRINS::QoIBase::QoIBase ( const std::string &  qoi_name)

Definition at line 39 of file qoi_base.C.

40  : ParameterUser(qoi_name),
41  _qoi_name(qoi_name),
42  _qoi_value(0.0)
43  {}
std::string _qoi_name
Definition: qoi_base.h:130
libMesh::Number _qoi_value
Definition: qoi_base.h:132
ParameterUser(const std::string &user_name)
virtual GRINS::QoIBase::~QoIBase ( )
inlinevirtual

Definition at line 54 of file qoi_base.h.

54 {}

Member Function Documentation

virtual bool GRINS::QoIBase::assemble_on_interior ( ) const
pure virtual
virtual bool GRINS::QoIBase::assemble_on_sides ( ) const
pure virtual
virtual QoIBase* GRINS::QoIBase::clone ( ) const
pure virtual
virtual void GRINS::QoIBase::element_qoi ( AssemblyContext ,
const unsigned int   
)
inlinevirtual

Compute the qoi value for element interiors.

Override this method if your QoI is defined on element interiors

Reimplemented in GRINS::IntegratedFunction< Function >, GRINS::IntegratedFunction< FEMFunctionAndDerivativeBase< libMesh::Real > >, GRINS::Vorticity, and GRINS::ParsedInteriorQoI.

Definition at line 86 of file qoi_base.h.

87  {}
virtual void GRINS::QoIBase::element_qoi_derivative ( AssemblyContext ,
const unsigned int   
)
inlinevirtual

Compute the qoi derivative with respect to the solution on element interiors.

Override this method if your QoI is defined on element interiors

Reimplemented in GRINS::IntegratedFunction< Function >, GRINS::IntegratedFunction< FEMFunctionAndDerivativeBase< libMesh::Real > >, GRINS::Vorticity, and GRINS::ParsedInteriorQoI.

Definition at line 91 of file qoi_base.h.

92  {}
virtual void GRINS::QoIBase::init ( const GetPot &  ,
const MultiphysicsSystem ,
unsigned int   
)
inlinevirtual

Method to allow QoI to cache any system information needed for QoI calculation, for example, solution variable indices.

Reimplemented in GRINS::IntegratedFunction< Function >, GRINS::IntegratedFunction< FEMFunctionAndDerivativeBase< libMesh::Real > >, GRINS::Vorticity, GRINS::ParsedBoundaryQoI, GRINS::ParsedInteriorQoI, GRINS::WeightedFluxQoI, and GRINS::AverageNusseltNumber.

Definition at line 75 of file qoi_base.h.

77  {}
virtual void GRINS::QoIBase::init_context ( AssemblyContext )
inlinevirtual
const std::string & GRINS::QoIBase::name ( ) const
inline

Returns the name of this QoI.

Definition at line 142 of file qoi_base.h.

References _qoi_name.

Referenced by GRINS::SteadyVisualization::output_adjoint(), and GRINS::UnsteadyVisualization::output_adjoint().

143  {
144  return _qoi_name;
145  }
std::string _qoi_name
Definition: qoi_base.h:130
void GRINS::QoIBase::output_qoi ( std::ostream &  out) const
virtual

Basic output for computed QoI's.

If fancier output is desired, override this method.

Definition at line 61 of file qoi_base.C.

References _qoi_name, and _qoi_value.

62  {
63  out << _qoi_name+" = "
64  << std::setprecision(16)
65  << std::scientific
66  << _qoi_value << std::endl;
67  }
std::string _qoi_name
Definition: qoi_base.h:130
libMesh::Number _qoi_value
Definition: qoi_base.h:132
void GRINS::QoIBase::parallel_op ( const libMesh::Parallel::Communicator &  communicator,
libMesh::Number &  sys_qoi,
libMesh::Number &  local_qoi 
)
virtual

Call the parallel operation for this QoI and cache the value.

By default, this is just a sum. Override if QoI is more complex.

Reimplemented in GRINS::SpectroscopicAbsorption.

Definition at line 45 of file qoi_base.C.

References _qoi_value.

Referenced by GRINS::SpectroscopicAbsorption::parallel_op().

48  {
49  communicator.sum(local_qoi);
50 
51  sys_qoi = local_qoi;
52 
53  _qoi_value = sys_qoi;
54  }
libMesh::Number _qoi_value
Definition: qoi_base.h:132
virtual void GRINS::QoIBase::reinit ( MultiphysicsSystem )
inlinevirtual
virtual void GRINS::QoIBase::side_qoi ( AssemblyContext ,
const unsigned int   
)
inlinevirtual

Compute the qoi value on the domain boundary.

Override this method if your QoI is defined on the domain boundary

Reimplemented in GRINS::ParsedBoundaryQoI, and GRINS::AverageNusseltNumber.

Definition at line 96 of file qoi_base.h.

96 {}
virtual void GRINS::QoIBase::side_qoi_derivative ( AssemblyContext ,
const unsigned int   
)
inlinevirtual

Compute the qoi derivative with respect to the solution on the domain boundary.

Override this method if your QoI is defined on the domain boundary

Reimplemented in GRINS::ParsedBoundaryQoI, and GRINS::AverageNusseltNumber.

Definition at line 100 of file qoi_base.h.

101  {}
void GRINS::QoIBase::thread_join ( libMesh::Number &  qoi,
const libMesh::Number &  other_qoi 
)
virtual

Call the operation to accumulate this QoI from multiple threads.

By default, this is just a sum. Override if QoI is more complex.

Definition at line 56 of file qoi_base.C.

57  {
58  qoi += other_qoi;
59  }
libMesh::Number GRINS::QoIBase::value ( ) const
inline

Returns the current QoI value.

Definition at line 136 of file qoi_base.h.

References _qoi_value.

137  {
138  return _qoi_value;
139  }
libMesh::Number _qoi_value
Definition: qoi_base.h:132

Member Data Documentation

std::string GRINS::QoIBase::_qoi_name
protected

Definition at line 130 of file qoi_base.h.

Referenced by name(), and output_qoi().

libMesh::Number GRINS::QoIBase::_qoi_value
protected

The documentation for this class was generated from the following files:

Generated on Tue Dec 19 2017 12:47:32 for GRINS-0.8.0 by  doxygen 1.8.9.1