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];
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.
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...
The libMesh namespace provides an interface to certain functionality in the library.
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_points() const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
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...
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.