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));
This class provides all data required for a physics package (e.g.
Data structure for specifying which Quantities of Interest should be calculated in an adjoint or a pa...
unsigned int n_dof_indices() const
Total number of dof indices on the element.
The libMesh namespace provides an interface to certain functionality in the library.
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...
Defines a dense subvector for use in finite element computations.
const System & get_system() const
Accessor for associated system.
Manages consistently variables, degrees of freedom, and coefficient vectors.
This class provides all data required for a physics package (e.g.
unsigned int n_points() const
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...
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...
const std::vector< DenseVector< Number > > & get_qoi_derivatives() const
Const accessor for QoI derivatives.
This class forms the foundation from which generic finite elements may be derived.
const QBase & get_element_qrule() const
Accessor for element interior quadrature rule for the dimension of the current _elem.