20 #ifndef __mast_libmesh_output_derivative_h__ 21 #define __mast_libmesh_output_derivative_h__ 31 #include <libmesh/nonlinear_implicit_system.h> 32 #include <libmesh/dof_map.h> 38 namespace libMeshWrapper {
44 template <
typename ScalarType,
51 "Scalar type of assembly and element operations must be same");
61 template <
typename VecType,
typename ContextType>
71 sol_accessor(*c.sys, X);
73 using elem_vector_t =
typename ElemOpsType::vector_t;
77 libMesh::MeshBase::const_element_iterator
78 el = c.mesh->active_local_elements_begin(),
79 end_el = c.mesh->active_local_elements_end();
81 for ( ; el != end_el; ++el) {
86 sol_accessor.
init(*c.elem);
88 dqdX_e.setZero(sol_accessor.
n_dofs());
91 _e_ops->derivativeX(c, sol_accessor, dqdX_e);
96 <ScalarType, VecType, elem_vector_t>
97 (dqdX, c.sys->get_dof_map(), sol_accessor.
dof_indices(), dqdX_e);
115 #endif // __mast_libmesh_output_derivative_h__
void init(const libMesh::Elem &e)
void assemble(ContextType &c, const VecType &X, VecType &dqdX)
void finalize(ValType &m)
const std::vector< libMesh::dof_id_type > & dof_indices() const
std::enable_if< Dim< 3, ScalarType >::typesource_load_multiplier(const SourceLoadFieldType *f, const SectionAreaType *s, ContextType &c) { Assert0(f, "Invalid pointer");Assert0(s, "Invalid pointer");return f-> value(c) *s -> value(c)
provides a method for global assembly of derivative of output functional with respect to the solution...
std::enable_if< std::is_same< ScalarType, real_t >::value, void >::type constrain_and_add_vector(VecType &v, const libMesh::DofMap &dof_map, std::vector< libMesh::dof_id_type > &dof_indices, SubVecType &v_sub)
virtual ~OutputDerivative()
void set_elem_ops(ElemOpsType &e_ops)