www.mooseframework.org
NodalKernel.h
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 #pragma once
11 
12 // MOOSE
13 #include "MooseObject.h"
14 #include "BlockRestrictable.h"
15 #include "SetupInterface.h"
16 #include "FunctionInterface.h"
17 #include "UserObjectInterface.h"
18 #include "TransientInterface.h"
19 #include "PostprocessorInterface.h"
21 #include "BlockRestrictable.h"
22 #include "BoundaryRestrictable.h"
23 #include "Restartable.h"
24 #include "MeshChangedInterface.h"
25 #include "RandomInterface.h"
27 #include "MooseVariableInterface.h"
28 #include "TaggingInterface.h"
29 
30 // Forward declerations
31 template <typename>
35 class MooseMesh;
36 class SubProblem;
37 class SystemBase;
38 class NodalKernel;
39 class Assembly;
40 
41 template <>
43 
48 class NodalKernel : public MooseObject,
49  public BlockRestrictable,
50  public BoundaryRestrictable,
51  public SetupInterface,
52  public FunctionInterface,
53  public UserObjectInterface,
54  public TransientInterface,
57  public Restartable,
58  public MeshChangedInterface,
59  public RandomInterface,
61  public MooseVariableInterface<Real>,
62  public TaggingInterface
63 {
64 public:
70 
76 
82 
89  virtual void computeResidual();
90 
97  virtual void computeJacobian();
98 
105  virtual void computeOffDiagJacobian(unsigned int jvar);
106 
107 protected:
111  virtual Real computeQpResidual() = 0;
112 
118  virtual Real computeQpJacobian();
119 
124  virtual Real computeQpOffDiagJacobian(unsigned int jvar);
125 
128 
131 
134 
137 
140 
143 
146 
148  const Node * const & _current_node;
149 
151  unsigned int _qp;
152 
154  const VariableValue & _u;
155 
158  std::vector<MooseVariableFEBase *> _save_in;
159  std::vector<AuxVariableName> _save_in_strings;
160 
163  std::vector<MooseVariableFEBase *> _diag_save_in;
164  std::vector<AuxVariableName> _diag_save_in_strings;
165 };
166 
Interface for objects that need parallel consistent random numbers without patterns over the course o...
MooseVariable & variable()
Gets the variable this is active on.
Definition: NodalKernel.C:134
std::vector< AuxVariableName > _save_in_strings
Definition: NodalKernel.h:159
MooseVariableFE< VectorValue< Real > > VectorMooseVariable
Definition: NodalKernel.h:34
A class for creating restricted objects.
Definition: Restartable.h:29
Keeps track of stuff related to assembling.
Definition: Assembly.h:62
Class for stuff related to variables.
Definition: Adaptivity.h:29
SubProblem & subProblem()
Get a reference to the subproblem.
Definition: NodalKernel.C:140
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
This is the virtual that derived classes should override for computing an off-diagonal jacobian compo...
Definition: NodalKernel.C:208
Assembly & _assembly
Reference to assembly.
Definition: NodalKernel.h:139
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
InputParameters validParams< NodalKernel >()
Definition: NodalKernel.C:19
/class BoundaryRestrictable /brief Provides functionality for limiting the object to certain boundary...
virtual void computeJacobian()
Compute the Jacobian at one node.
Definition: NodalKernel.C:165
virtual void computeResidual()
Compute the residual at the current node.
Definition: NodalKernel.C:146
Base class for a system (of equations)
Definition: SystemBase.h:92
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
SubProblem & _subproblem
Reference to SubProblem.
Definition: NodalKernel.h:127
MooseVariable & _var
variable this works on
Definition: NodalKernel.h:142
Interface for objects that needs transient capabilities.
std::vector< AuxVariableName > _diag_save_in_strings
Definition: NodalKernel.h:164
virtual void computeOffDiagJacobian(unsigned int jvar)
Compute the off-diagonal Jacobian at one node.
Definition: NodalKernel.C:185
Interface for notifications that the mesh has changed.
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:42
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:65
MooseMesh wraps a libMesh::Mesh object and enhances its capabilities by caching additional data and s...
Definition: MooseMesh.h:74
virtual Real computeQpJacobian()
The user can override this function to compute the "on-diagonal" Jacobian contribution.
Definition: NodalKernel.C:202
const VariableValue & _u
Value of the unknown variable this is acting on.
Definition: NodalKernel.h:154
Interface for objects that need to use UserObjects.
SystemBase & _sys
Reference to SystemBase.
Definition: NodalKernel.h:133
bool _has_diag_save_in
The aux variables to save the diagonal Jacobian contributions to.
Definition: NodalKernel.h:162
const Node *const & _current_node
current node being processed
Definition: NodalKernel.h:148
bool _has_save_in
The aux variables to save the residual contributions to.
Definition: NodalKernel.h:157
MooseVariableFE< Real > MooseVariable
Definition: NodalKernel.h:32
OutputTools< Real >::VariableValue VariableValue
Definition: MooseTypes.h:197
MooseMesh & _mesh
Mesh this is defined on.
Definition: NodalKernel.h:145
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:59
FEProblemBase & _fe_problem
Reference to FEProblemBase.
Definition: NodalKernel.h:130
Intermediate base class that ties together all the interfaces for getting MooseVariableFEBases with t...
Interface for objects that need to get values of MooseVariables.
An interface that restricts an object to subdomains via the &#39;blocks&#39; input parameter.
unsigned int _qp
Quadrature point index.
Definition: NodalKernel.h:151
std::vector< MooseVariableFEBase * > _save_in
Definition: NodalKernel.h:158
std::vector< MooseVariableFEBase * > _diag_save_in
Definition: NodalKernel.h:163
Base class for creating new types of boundary conditions.
Definition: NodalKernel.h:48
Interface for objects that need to use functions.
THREAD_ID _tid
Thread id.
Definition: NodalKernel.h:136
virtual Real computeQpResidual()=0
The user can override this function to compute the residual at a node.
Interface class for classes which interact with Postprocessors.
NodalKernel(const InputParameters &parameters)
Class constructor.
Definition: NodalKernel.C:59
unsigned int THREAD_ID
Definition: MooseTypes.h:161