https://mooseframework.inl.gov
DivDivField.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 "DivDivField.h"
11 #include "Assembly.h"
12 
13 registerMooseObject("MooseApp", DivDivField);
14 
17 {
19  params.addClassDescription(
20  "The grad-div operator optionally scaled by a constant scalar coefficient."
21  "Weak form: $(\\nabla \\cdot \\vec{\\psi_i}, k \\nabla \\cdot \\vec{u})$.");
22  params.addParam<Real>("coeff", 1.0, "The constant coefficient");
23  return params;
24 }
25 
27  : VectorKernel(parameters),
28  _div_test(_var.divPhi()),
29  _div_phi(_assembly.divPhi(_var)),
30  _div_u(_is_implicit ? _var.divSln() : _var.divSlnOld()),
31  _coeff(getParam<Real>("coeff"))
32 {
33 }
34 
35 Real
37 {
38  return _coeff * _div_u[_qp] * _div_test[_i][_qp];
39 }
40 
41 Real
43 {
44  return _coeff * _div_phi[_j][_qp] * _div_test[_i][_qp];
45 }
virtual Real computeQpResidual() override
Compute this Kernel&#39;s contribution to the residual at the current quadrature point.
Definition: DivDivField.C:36
registerMooseObject("MooseApp", DivDivField)
Weak form contribution corresponding to -grad(k*div(u))
Definition: DivDivField.h:17
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
static InputParameters validParams()
Definition: DivDivField.C:16
Real _coeff
scalar coefficient
Definition: DivDivField.h:38
unsigned int _i
current index for the test function
Definition: KernelBase.h:58
unsigned int _j
current index for the shape function
Definition: KernelBase.h:61
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
Definition: VectorKernel.C:21
const VectorVariableTestDivergence & _div_test
div of the test function
Definition: DivDivField.h:29
const VectorVariableDivergence & _div_u
div of the variable
Definition: DivDivField.h:35
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump...
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object...
const VectorVariablePhiDivergence & _div_phi
div of the shape function
Definition: DivDivField.h:32
DivDivField(const InputParameters &parameters)
Definition: DivDivField.C:26
unsigned int _qp
The current quadrature point index.
Definition: KernelBase.h:43
virtual Real computeQpJacobian() override
Compute this Kernel&#39;s contribution to the Jacobian at the current quadrature point.
Definition: DivDivField.C:42