64 const std::vector<dof_id_type> & dof_indices);
79 virtual unsigned int coupled(
const std::string & var_name,
unsigned int comp = 0)
const override;
101 _phi(type ==
ShapeType::
Element ? this->_assembly.phi() : this->_assembly.phiFace()),
103 : this->_assembly.gradPhiFace()),
104 _compute_jacobians(
MooseObject::getParam<bool>(
"compute_jacobians"))
106 mooseWarning(
"Jacobian calculation in UserObjects is an experimental capability with a "
107 "potentially unstable interface.");
115 params.
addParam<
bool>(
"compute_jacobians",
true,
"Compute Jacobians for coupled variables");
124 const auto * var = this->
template getVarHelper<MooseVariable>(var_name, comp);
128 _jacobian_moose_variables.insert(var);
131 return T::coupled(var_name, comp);
137 const std::vector<dof_id_type> & dof_indices)
139 for (_j = 0; _j < _phi.size(); ++_j)
141 _j_global = dof_indices[_j];
142 executeJacobian(jvar);
void mooseWarning(Args &&... args)
Emit a warning message with the given stringified, concatenated args.
OutputTools< Real >::VariablePhiValue VariablePhiValue
OutputTools< Real >::VariablePhiGradient VariablePhiGradient
ShapeType
Users of this template class must specify the type of shape functions that will be used in the Jacobi...
Every object that can be built by the factory should be derived from this class.
UserObject template class in which the _phi and _grad_phi shape function data is available and correc...
const bool & computeJacobianFlag() const
check if jacobian is to be computed in user objects
ShapeUserObject(const InputParameters ¶meters, ShapeType type)
virtual void executeJacobianWrapper(unsigned int jvar, const std::vector< dof_id_type > &dof_indices)
This function will be called with the shape functions for jvar initialized.
virtual unsigned int coupled(const std::string &var_name, unsigned int comp=0) const override
Returns the index for a coupled variable by name and requests the computation of a Jacobian w....
static InputParameters validParams()
std::set< const MooseVariableFEBase * > _jacobian_moose_variables
const VariablePhiGradient & _grad_phi
shape function gradients
dof_id_type _j_global
global DOF ID corresponding to _j
const std::set< const MooseVariableFEBase * > & jacobianMooseVariables() const
Returns the set of variables a Jacobian has been requested for.
const VariablePhiValue & _phi
shape function values
unsigned int _j
j-th index for enumerating the shape functions
virtual void executeJacobian(unsigned int)=0
Implement this function to compute Jacobian terms for this UserObject.
const bool _compute_jacobians