https://mooseframework.inl.gov
Loading...
Searching...
No Matches
VectorTimeDerivative.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
12// MOOSE includes
13#include "Assembly.h"
14#include "MooseVariableFE.h"
15
16#include "libmesh/quadrature.h"
17
19
22{
24 params.addClassDescription("The time derivative operator with the weak form of $(\\vec{\\psi_i}, "
25 "\\frac{\\partial \\vec{u_h}}{\\partial t})$.");
26 params.addParam<bool>("lumping", false, "True for mass matrix lumping, false otherwise");
27
28 return params;
29}
30
32 : VectorTimeKernel(parameters), _lumping(getParam<bool>("lumping"))
33{
34}
35
36Real
41
42Real
47
48void
50{
51 if (_lumping)
52 {
54
56 for (_i = 0; _i < _test.size(); _i++)
57 for (_j = 0; _j < _phi.size(); _j++)
58 for (_qp = 0; _qp < _qrule->n_points(); _qp++)
60
62 }
63 else
65}
registerMooseObject("MooseApp", VectorTimeDerivative)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
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.
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.
const MooseArray< Real > & _coord
The scaling factor to convert from cartesian to another coordinate system (e.g rz,...
Definition KernelBase.h:55
unsigned int _qp
The current quadrature point index.
Definition KernelBase.h:43
const MooseArray< Real > & _JxW
The current quadrature point weight value.
Definition KernelBase.h:52
unsigned int _j
current index for the shape function
Definition KernelBase.h:61
unsigned int _i
current index for the test function
Definition KernelBase.h:58
const QBase *const & _qrule
active quadrature rule
Definition KernelBase.h:49
unsigned int number() const
Get variable number coming from libMesh.
virtual void precalculateJacobian()
Assembly & _assembly
Reference to this Kernel's assembly object.
virtual void computeJacobian()=0
Compute this object's contribution to the diagonal Jacobian entries.
DenseMatrix< Number > _local_ke
Holds local Jacobian entries as they are accumulated by this Kernel.
void accumulateTaggedLocalMatrix()
Local Jacobian blocks will be appended by adding the current local kernel Jacobian.
void prepareMatrixTag(Assembly &assembly, unsigned int ivar, unsigned int jvar)
Prepare data for computing element jacobian according to the active tags.
const VectorVariableTestValue & _test
the current test function
const VectorVariablePhiValue & _phi
the current shape functions
const VectorMooseVariable & _var
This is a regular kernel so we cast to a regular MooseVariable.
virtual Real computeQpResidual() override
Compute this Kernel's contribution to the residual at the current quadrature point.
static InputParameters validParams()
VectorTimeDerivative(const InputParameters &parameters)
virtual void computeJacobian() override
Compute this VectorKernel's contribution to the diagonal Jacobian entries.
virtual Real computeQpJacobian() override
Compute this Kernel's contribution to the Jacobian at the current quadrature point.
All vector time kernels should inherit from this class.
static InputParameters validParams()
const VectorVariableValue & _u_dot
Time derivative of u.
const VariableValue & _du_dot_du
Derivative of u_dot with respect to u.