33 #include "libmesh/libmesh_common.h"
34 #include "libmesh/point.h"
35 #include "libmesh/quadrature.h"
36 #include "libmesh/elem.h"
40 template<
typename FunctionType,
typename FEShape>
44 bool is_axisymmetric )
46 libmesh_assert(!_vars.empty());
48 unsigned int n_vars = this->_vars.size();
52 const unsigned int n_var_dofs = context.get_dof_indices(this->_vars[0]).size();
54 for(
unsigned int v = 1; v < n_vars; v++ )
55 libmesh_assert_equal_to( n_var_dofs, context.get_dof_indices(this->_vars[v]).size() );
58 libMesh::FEGenericBase<FEShape>* side_fe = NULL;
59 context.get_side_fe( this->_vars[0], side_fe );
62 const std::vector<libMesh::Real> &JxW_side = side_fe->get_JxW();
65 const std::vector<std::vector<FEShape> >& var_phi_side =
69 const std::vector<libMesh::Point>& var_qpoint =
72 std::vector<libMesh::DenseSubVector<libMesh::Number>*> F_vars(_vars.size(),NULL);
74 for(
unsigned int v = 0; v < n_vars; v++ )
75 F_vars[v] = &(context.get_elem_residual(this->_vars[v]));
77 unsigned int n_qpoints = context.get_side_qrule().n_points();
81 for (
unsigned int qp=0; qp != n_qpoints; qp++)
83 libMesh::Real jac = JxW_side[qp];
87 const libMesh::Number r = var_qpoint[qp](0);
91 for(
unsigned int v = 0; v < n_vars; v++ )
93 value = this->eval_func( context, var_qpoint[qp], context.get_time(), this->_vars[v], *_func );
95 for (
unsigned int i=0; i != n_var_dofs; i++)
96 (*F_vars[v])(i) += sign*(value*var_phi_side[i][qp])*jac;
101 libmesh_error_msg(
"ERROR: Analytical Jacobians of FEMFunctionBase objects currently not supported!");
103 return compute_jacobian;
virtual bool eval_flux(bool compute_jacobian, AssemblyContext &context, libMesh::Real sign, bool is_axisymmetric)