2#include "libmesh/libmesh_common.h"
3#include "libmesh/elem.h"
4#include "libmesh/fe_base.h"
5#include "libmesh/fem_context.h"
6#include "libmesh/point.h"
7#include "libmesh/quadrature.h"
20 FEMContext & c = cast_ref<FEMContext &>(context);
24 FEBase * elem_fe =
nullptr;
28 const std::vector<Real> & JxW = elem_fe->
get_JxW();
31 const std::vector<std::vector<Real>> & phi = elem_fe->
get_phi();
34 const std::vector<Point > & q_point = elem_fe->
get_xyz();
46 for (
unsigned int qp=0; qp != n_qpoints; qp++)
48 const Real x = q_point[qp](0);
49 const Real y = q_point[qp](1);
53 if (std::abs(x - 0.875) <= 0.125 && std::abs(y - 0.125) <= 0.125)
54 for (
unsigned int i=0; i != n_T_dofs; i++)
55 Q(i) += JxW[qp] *phi[i][qp];
virtual void element_qoi_derivative(DiffContext &context, const QoISet &qois)
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 std::vector< DenseVector< Number > > & get_qoi_derivatives() const
Const accessor for QoI derivatives.
virtual_for_inffe const std::vector< Real > & get_JxW() const
virtual_for_inffe const std::vector< Point > & get_xyz() 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.
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.
unsigned int n_points() const
Data structure for specifying which Quantities of Interest should be calculated in an adjoint or a pa...
The libMesh namespace provides an interface to certain functionality in the library.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real