https://mooseframework.inl.gov
VectorMassMatrix.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
10 #include "VectorMassMatrix.h"
11 
12 registerMooseObject("NavierStokesApp", VectorMassMatrix);
13 
16 {
18  params.addClassDescription("Computes a finite element mass matrix meant for use in "
19  "preconditioning schemes which require one");
20  params.addParam<Real>("density", 1, "Optional density for scaling the computed mass.");
21  params.set<MultiMooseEnum>("vector_tags") = "";
22  params.set<MultiMooseEnum>("matrix_tags") = "";
23  params.suppressParameter<MultiMooseEnum>("vector_tags");
24  params.suppressParameter<std::vector<TagName>>("extra_vector_tags");
25  params.suppressParameter<std::vector<TagName>>("absolute_value_vector_tags");
26  params.set<bool>("matrix_only") = true;
27  return params;
28 }
29 
31  : VectorKernel(parameters), _density(getParam<Real>("density"))
32 {
33  if (!isParamValid("matrix_tags") && !isParamValid("extra_matrix_tags"))
34  mooseError("One of 'matrix_tags' or 'extra_matrix_tags' must be provided");
35 }
36 
37 Real
39 {
40  mooseError("should never be called");
41 }
42 
43 Real
45 {
46  return _density * _phi[_j][_qp] * _test[_i][_qp];
47 }
const VectorVariableTestValue & _test
VectorMassMatrix(const InputParameters &parameters)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
virtual Real computeQpJacobian() override
Computes a finite element mass matrix meant for use in preconditioning schemes which require one...
static InputParameters validParams()
T & set(const std::string &name, bool quiet_mode=false)
void suppressParameter(const std::string &name)
bool isParamValid(const std::string &name) const
virtual Real computeQpResidual() override
unsigned int _i
unsigned int _j
const VectorVariablePhiValue & _phi
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
registerMooseObject("NavierStokesApp", VectorMassMatrix)
static InputParameters validParams()
void mooseError(Args &&... args) const
void addClassDescription(const std::string &doc_string)
unsigned int _qp