16#include "libmesh/system.h"
28 params.
set<
bool>(
"matrix_only") =
true;
37 params.
addParam<MaterialPropertyName>(
"density", 1,
"The material property defining the density");
42 :
Kernel(parameters), _density(getMaterialProperty<Real>(
"density"))
45 mooseError(
"One of 'matrix_tags' or 'extra_matrix_tags' must be provided");
48 cast_ref<NonlinearSystemBase &>(
_sys).getPreconditioner()) &&
50 mooseError(
"Elemental mass matrices likely don't make sense when using static condensation");
56 mooseError(
"Residual should not be calculated for the MassMatrix kernel");
registerMooseObject("MooseApp", MassMatrix)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
unsigned int _qp
The current quadrature point index.
unsigned int _j
current index for the shape function
unsigned int _i
current index for the test function
MooseVariable & _var
This is a regular kernel so we cast to a regular MooseVariable.
const VariablePhiValue & _phi
the current shape functions
const VariableTestValue & _test
the current test function
static InputParameters validParams()
Computes a finite element mass matrix.
static InputParameters validParams()
MassMatrix(const InputParameters ¶meters)
const MaterialProperty< Real > & _density
The density of the material.
static void setMassMatrixParams(InputParameters ¶ms)
virtual Real computeQpResidual() override
Compute this Kernel's contribution to the residual at the current quadrature point.
virtual Real computeQpJacobian() override
Compute this Kernel's contribution to the Jacobian at the current quadrature point.
bool isParamValid(const std::string &name) const
Test if the supplied parameter is valid.
Static condensation preconditioner.
libMesh::FEContinuity getContinuity() const override
Return the continuity of this variable.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type.
SystemBase & _sys
Reference to the EquationSystem object.
virtual libMesh::System & system()=0
Get the reference to the libMesh system.
bool has_static_condensation() const