Loading [MathJax]/extensions/tex2jax.js
https://mooseframework.inl.gov
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
TimeKernel.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 "TimeKernel.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  : Kernel(parameters), _u_dot(_var.uDot()), _du_dot_du(_var.duDotDu())
32 {
33 }
34 
35 void
37 {
39 
41  for (_i = 0; _i < _test.size(); _i++)
42  for (_qp = 0; _qp < _qrule->n_points(); _qp++)
44 
46 
48 
49  if (_has_save_in)
50  {
51  Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
52  for (unsigned int i = 0; i < _save_in.size(); i++)
53  _save_in[i]->sys().solution().add_vector(_local_re, _save_in[i]->dofIndices());
54  }
55 }
virtual void computeResidual() override
Compute this Kernel&#39;s contribution to the residual.
Definition: TimeKernel.C:36
static InputParameters validParams()
Definition: Kernel.C:24
void accumulateTaggedLocalResidual()
Local residual blocks will be appended by adding the current local kernel residual.
virtual Real computeQpResidual()=0
Compute this Kernel&#39;s contribution to the residual at the current quadrature point.
MooseVariable & _var
This is a regular kernel so we cast to a regular MooseVariable.
Definition: Kernel.h:72
std::vector< MooseVariableFEBase * > _save_in
Definition: KernelBase.h:65
const MooseArray< Real > & _JxW
The current quadrature point weight value.
Definition: KernelBase.h:52
unsigned int number() const
Get variable number coming from libMesh.
T & set(const std::string &name, bool quiet_mode=false)
Returns a writable reference to the named parameters.
virtual void precalculateResidual()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual void computeResidualAdditional()
Entry point for additional computation for the local residual after the standard calls.
Definition: TimeKernel.h:33
const VariableTestValue & _test
the current test function
Definition: Kernel.h:75
const QBase *const & _qrule
active quadrature rule
Definition: KernelBase.h:49
bool _has_save_in
The aux variables to save the residual contributions to.
Definition: KernelBase.h:64
unsigned int _i
current index for the test function
Definition: KernelBase.h:58
const MooseArray< Real > & _coord
The scaling factor to convert from cartesian to another coordinate system (e.g rz, spherical, etc.)
Definition: KernelBase.h:55
Assembly & _assembly
Reference to this Kernel&#39;s assembly object.
TimeKernel(const InputParameters &parameters)
Definition: TimeKernel.C:30
DenseVector< Number > _local_re
Holds local residual entries as they are accumulated by this Kernel.
Definition: Kernel.h:15
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type...
void prepareVectorTag(Assembly &assembly, unsigned int ivar)
Prepare data for computing element residual according to active tags.
static InputParameters validParams()
Definition: TimeKernel.C:20
unsigned int _qp
The current quadrature point index.
Definition: KernelBase.h:43