https://mooseframework.inl.gov
Loading...
Searching...
No Matches
VectorTimeKernel.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 "VectorTimeKernel.h"
11
12// MOOSE includes
13#include "Assembly.h"
14#include "MooseVariableFE.h"
15#include "SystemBase.h"
16
17#include "libmesh/quadrature.h"
18
21{
23
24 params.set<MultiMooseEnum>("vector_tags") = "time";
25 params.set<MultiMooseEnum>("matrix_tags") = "system time";
26
27 return params;
28}
29
31 : VectorKernel(parameters), _u_dot(_var.uDot()), _du_dot_du(_var.duDotDu())
32{
33}
34
35void
37{
39
41 for (_i = 0; _i < _test.size(); _i++)
42 for (_qp = 0; _qp < _qrule->n_points(); _qp++)
44
46
47 if (_has_save_in)
48 for (unsigned int i = 0; i < _save_in.size(); i++)
49 _save_in[i]->sys().solution().add_vector(_local_re, _save_in[i]->dofIndices());
50}
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
std::vector< MooseVariableFEBase * > _save_in
Definition KernelBase.h:65
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
bool _has_save_in
The aux variables to save the residual contributions to.
Definition KernelBase.h:64
const MooseArray< Real > & _JxW
The current quadrature point weight value.
Definition KernelBase.h:52
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.
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type.
Assembly & _assembly
Reference to this Kernel's assembly object.
virtual void precalculateResidual()
void accumulateTaggedLocalResidual()
Local residual blocks will be appended by adding the current local kernel residual.
void prepareVectorTag(Assembly &assembly, unsigned int ivar)
Prepare data for computing element residual according to active tags.
DenseVector< Number > _local_re
Holds local residual entries as they are accumulated by this Kernel.
const VectorVariableTestValue & _test
the current test function
static InputParameters validParams()
const VectorMooseVariable & _var
This is a regular kernel so we cast to a regular MooseVariable.
virtual Real computeQpResidual()=0
Compute this Kernel's contribution to the residual at the current quadrature point.
VectorTimeKernel(const InputParameters &parameters)
virtual void computeResidual() override
Compute this VectorKernel's contribution to the residual.
static InputParameters validParams()