21#include "libmesh/libmesh_common.h"
22#include "libmesh/elem.h"
23#include "libmesh/fe_base.h"
24#include "libmesh/fem_context.h"
25#include "libmesh/point.h"
26#include "libmesh/quadrature.h"
29#include "heatsystem.h"
39 FEMContext & c = cast_ref<FEMContext &>(context);
43 FEBase * elem_fe =
nullptr;
47 const std::vector<Real> & JxW = elem_fe->
get_JxW();
50 const std::vector<std::vector<Real>> & phi = elem_fe->
get_phi();
69 std::vector<Number> old_adjoint (n_qpoints, 0);
77 for (
unsigned int qp=0; qp != n_qpoints; qp++)
78 for (
unsigned int i=0; i != n_T_dofs; i++)
79 Q(i) += -JxW[qp] * old_adjoint[qp] * phi[i][qp] * (1./(
dynamic_cast<const HeatSystem &
>(sys).
deltat));
virtual void element_qoi_derivative(DiffContext &context, const QoISet &)
Does any work that needs to be done on elem in a quantity of interest derivative assembly loop,...
Defines a dense subvector for use in finite element computations.
This class provides all data required for a physics package (e.g.
unsigned int n_dof_indices() const
Total number of dof indices on the element.
const System & get_system() const
Accessor for associated system.
const std::vector< DenseVector< Number > > & get_qoi_derivatives() const
Const accessor for QoI derivatives.
Real deltat
For time-dependent problems, this is the amount delta t to advance the solution in time.
virtual_for_inffe const std::vector< Real > & get_JxW() const
This class forms the foundation from which generic finite elements may be derived.
const std::vector< std::vector< OutputShape > > & get_phi() const
This class provides all data required for a physics package (e.g.
void interior_values(unsigned int var, const NumericVector< Number > &_system_vector, std::vector< OutputType > &interior_values_vector) const
Fills a vector of values of the _system_vector at the all the quadrature points in the current elemen...
const QBase & get_element_qrule() const
Accessor for element interior quadrature rule for the dimension of the current _elem.
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Accessor for interior finite element object for variable var for the largest dimension in the mesh.
Provides a uniform interface to vector storage schemes for different linear algebra libraries.
unsigned int n_points() const
Data structure for specifying which Quantities of Interest should be calculated in an adjoint or a pa...
Manages consistently variables, degrees of freedom, and coefficient vectors.
NumericVector< Number > & get_adjoint_solution(unsigned int i=0)
The libMesh namespace provides an interface to certain functionality in the library.