libMesh
|
This class provides a specific system class. More...
#include <diff_qoi.h>
Public Member Functions | |
DifferentiableQoI () | |
Constructor. More... | |
virtual | ~DifferentiableQoI ()=default |
Destructor. More... | |
virtual void | init_qoi (std::vector< Number > &) |
Initialize system qoi. More... | |
void | init_qoi (std::vector< Number > &) |
Non-virtual, to try to help deprecated user code catch this change at compile time (if they specified override) More... | |
virtual void | init_qoi_count (System &) |
Initialize system qoi. More... | |
virtual void | clear_qoi () |
Clear all the data structures associated with the QoI. More... | |
virtual void | element_qoi (DiffContext &, const QoISet &) |
Does any work that needs to be done on elem in a quantity of interest assembly loop, outputting to elem_qoi. More... | |
virtual void | element_qoi_derivative (DiffContext &, const QoISet &) |
Does any work that needs to be done on elem in a quantity of interest derivative assembly loop, outputting to elem_qoi_derivative. More... | |
virtual void | side_qoi (DiffContext &, const QoISet &) |
Does any work that needs to be done on side of elem in a quantity of interest assembly loop, outputting to elem_qoi. More... | |
virtual void | side_qoi_derivative (DiffContext &, const QoISet &) |
Does any work that needs to be done on side of elem in a quantity of interest derivative assembly loop, outputting to elem_qoi_derivative. More... | |
virtual void | init_context (DiffContext &) |
Prepares the result of a build_context() call for use. More... | |
virtual std::unique_ptr< DifferentiableQoI > | clone ()=0 |
Copy of this object. More... | |
virtual void | thread_join (std::vector< Number > &qoi, const std::vector< Number > &other_qoi, const QoISet &qoi_indices) |
Method to combine thread-local qois. More... | |
virtual void | parallel_op (const Parallel::Communicator &communicator, std::vector< Number > &sys_qoi, std::vector< Number > &local_qoi, const QoISet &qoi_indices) |
Method to populate system qoi data structure with process-local qoi. More... | |
virtual void | finalize_derivative (NumericVector< Number > &derivatives, std::size_t qoi_index) |
Method to finalize qoi derivatives which require more than just a simple sum of element contributions. More... | |
Public Attributes | |
bool | assemble_qoi_sides |
If assemble_qoi_sides is true (it is false by default), the assembly loop for a quantity of interest or its derivatives will loop over domain boundary sides. More... | |
bool | assemble_qoi_internal_sides |
If assemble_qoi_internal_sides is true (it is false by default), the assembly loop for a quantity of interest or its derivatives will loop over element sides which do not fall on domain boundaries. More... | |
bool | assemble_qoi_elements |
If assemble_qoi_elements is false (it is true by default), the assembly loop for a quantity of interest or its derivatives will skip computing on mesh elements, and will only compute on mesh sides. More... | |
This class provides a specific system class.
It aims to generalize any system, linear or nonlinear, which provides both a residual and a Jacobian.
This class is part of the new DifferentiableSystem framework, which is still experimental. Users of this framework should beware of bugs and future API changes.
Definition at line 52 of file diff_qoi.h.
libMesh::DifferentiableQoI::DifferentiableQoI | ( | ) |
Constructor.
Optionally initializes required data structures.
Definition at line 26 of file diff_qoi.C.
|
virtualdefault |
Destructor.
|
inlinevirtual |
Clear all the data structures associated with the QoI.
Definition at line 91 of file diff_qoi.h.
Referenced by libMesh::DifferentiableSystem::clear().
|
pure virtual |
Copy of this object.
User should override to copy any needed state.
Implemented in libMesh::DifferentiableSystem, LaplaceQoI, and CoupledSystemQoI.
Referenced by libMesh::DifferentiableSystem::attach_qoi().
|
inlinevirtual |
Does any work that needs to be done on elem
in a quantity of interest assembly loop, outputting to elem_qoi.
Only qois included in the supplied QoISet
need to be assembled.
Reimplemented in HeatSystem, and LaplaceQoI.
Definition at line 124 of file diff_qoi.h.
|
inlinevirtual |
Does any work that needs to be done on elem
in a quantity of interest derivative assembly loop, outputting to elem_qoi_derivative.
Only qois included in the supplied QoISet
need their derivatives assembled.
Reimplemented in HeatSystem, LaplaceSystem, HeatSystem, LaplaceSystem, and LaplaceQoI.
Definition at line 136 of file diff_qoi.h.
|
virtual |
Method to finalize qoi derivatives which require more than just a simple sum of element contributions.
Definition at line 53 of file diff_qoi.C.
Referenced by libMesh::FEMSystem::assemble_qoi_derivative().
|
inlinevirtual |
Prepares the result of a build_context() call for use.
FEMSystem-based problems will need to reimplement this in order to call FE::get_*() as their particular QoI requires. Trying to evaluate a QoI without overriding init_context is both inefficient and deprecated.
Reimplemented in libMesh::FEMSystem, HeatSystem, CoupledSystem, L2System, ElasticitySystem, ElasticitySystem, HeatSystem, LaplaceSystem, CurlCurlSystem, LaplaceSystem, PoissonSystem, LaplaceSystem, LaplaceSystem, CurlCurlSystem, SolidSystem, NavierSystem, HeatSystem, LaplaceQoI, and CoupledSystemQoI.
Definition at line 171 of file diff_qoi.h.
|
inlinevirtual |
Initialize system qoi.
This version of the function required direct vector access, and is now deprecated.
Definition at line 72 of file diff_qoi.h.
|
inline |
Non-virtual, to try to help deprecated user code catch this change at compile time (if they specified override)
Definition at line 78 of file diff_qoi.h.
|
inlinevirtual |
Initialize system qoi.
Often this will just call sys.init_qois(some_desired_number_of_qois)
Reimplemented in LaplaceQoI, and CoupledSystemQoI.
Definition at line 85 of file diff_qoi.h.
|
virtual |
Method to populate system qoi data structure with process-local qoi.
By default, simply sums process qois into system qoi.
Definition at line 41 of file diff_qoi.C.
References communicator.
Referenced by libMesh::FEMSystem::assemble_qoi().
|
inlinevirtual |
Does any work that needs to be done on side
of elem
in a quantity of interest assembly loop, outputting to elem_qoi.
Only qois included in the supplied QoISet
need to be assembled.
Reimplemented in CoupledSystemQoI.
Definition at line 147 of file diff_qoi.h.
|
inlinevirtual |
Does any work that needs to be done on side
of elem
in a quantity of interest derivative assembly loop, outputting to elem_qoi_derivative.
Only qois included in the supplied QoISet
need their derivatives assembled.
Reimplemented in LaplaceSystem, LaplaceSystem, and CoupledSystemQoI.
Definition at line 159 of file diff_qoi.h.
|
virtual |
Method to combine thread-local qois.
By default, simply sums thread qois.
Definition at line 33 of file diff_qoi.C.
References libMesh::index_range().
bool libMesh::DifferentiableQoI::assemble_qoi_elements |
If assemble_qoi_elements
is false (it is true by default), the assembly loop for a quantity of interest or its derivatives will skip computing on mesh elements, and will only compute on mesh sides.
Definition at line 115 of file diff_qoi.h.
bool libMesh::DifferentiableQoI::assemble_qoi_internal_sides |
If assemble_qoi_internal_sides
is true (it is false by default), the assembly loop for a quantity of interest or its derivatives will loop over element sides which do not fall on domain boundaries.
Definition at line 107 of file diff_qoi.h.
bool libMesh::DifferentiableQoI::assemble_qoi_sides |
If assemble_qoi_sides
is true (it is false by default), the assembly loop for a quantity of interest or its derivatives will loop over domain boundary sides.
To add domain interior sides, also set assemble_qoi_internal_sides to true.
Definition at line 99 of file diff_qoi.h.
Referenced by main().