Loading [MathJax]/extensions/tex2jax.js
https://mooseframework.inl.gov
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
ArrayCoupledTimeDerivative.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 
11 
13 
16 {
18  params.addClassDescription(
19  "Time derivative Array Kernel that acts on a coupled variable. Weak form: "
20  "$(\\psi_i, \\frac{\\partial v_h}{\\partial t})$. The coupled variable and "
21  "the variable must have the same dimensionality");
22  params.addRequiredCoupledVar("v", "Coupled variable");
23  return params;
24 }
25 
27  : ArrayKernel(parameters),
28  _v_dot(coupledArrayDot("v")),
29  _dv_dot(coupledArrayDotDu("v")),
30  _v_var(coupled("v"))
31 {
32 }
33 
34 void
36 {
37  mooseAssert(_var.count() == _v_dot.size(),
38  "The variable and coupled variable have unequal sizes:\n variable size : " +
39  std::to_string(_var.count()) + "\n" +
40  " coupled variable size: " + std::to_string(_v_dot.size()));
41 
42  residual = _test[_i][_qp] * _v_dot[_qp];
43 }
44 
47 {
48  return RealEigenVector::Zero(_var.count());
49 }
50 
53 {
54  if (jvar.number() == _v_var)
55  return _test[_i][_qp] * _phi[_j][_qp] * _dv_dot[_qp] *
56  RealEigenVector::Ones(jvar.count()).asDiagonal();
57 
58  return RealEigenMatrix::Zero(_var.count(), jvar.count());
59 }
const VariableValue & _dv_dot
The Jacobian of the time derivative of the coupled variable with respect to the coupled variable...
unsigned int number() const
Get variable number coming from libMesh.
const unsigned int _v_var
The number of the coupled variable.
This calculates the time derivative for a coupled variable.
unsigned int count() const
Get the number of components Note: For standard and vector variables, the number is one...
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
This class provides an interface for common operations on field variables of both FE and FV types wit...
registerMooseObject("MooseApp", ArrayCoupledTimeDerivative)
static InputParameters validParams()
Definition: ArrayKernel.C:23
const ArrayVariableValue & _v_dot
The first temporal derivative of the coupled variable.
virtual RealEigenMatrix computeQpOffDiagJacobian(const MooseVariableFEBase &jvar) override
This is the virtual that derived classes should override for computing a full Jacobian component...
const ArrayVariableTestValue & _test
the current test function
Definition: ArrayKernel.h:88
unsigned int _i
current index for the test function
Definition: KernelBase.h:58
ArrayCoupledTimeDerivative(const InputParameters &parameters)
Eigen::Matrix< Real, Eigen::Dynamic, Eigen::Dynamic > RealEigenMatrix
Definition: MooseTypes.h:149
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
This method adds a coupled variable name pair.
virtual void computeQpResidual(RealEigenVector &residual) override
Compute this Kernel&#39;s contribution to the residual at the current quadrature point, to be filled in residual.
unsigned int _j
current index for the shape function
Definition: KernelBase.h:61
const ArrayVariablePhiValue & _phi
the current shape functions
Definition: ArrayKernel.h:95
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...
Eigen::Matrix< Real, Eigen::Dynamic, 1 > RealEigenVector
Definition: MooseTypes.h:146
virtual RealEigenVector computeQpJacobian() override
Compute this Kernel&#39;s contribution to the diagonal Jacobian at the current quadrature point...
ArrayMooseVariable & _var
This is an array kernel so we cast to a ArrayMooseVariable.
Definition: ArrayKernel.h:85
static InputParameters validParams()
unsigned int _qp
The current quadrature point index.
Definition: KernelBase.h:43