https://mooseframework.inl.gov
NodalKernel.h
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 #pragma once
11 
12 #include "NodalKernelBase.h"
13 #include "MooseVariableInterface.h"
14 
19 {
20 public:
26 
28 
35  virtual void computeResidual() override;
36 
43  virtual void computeJacobian() override;
44 
51  virtual void computeOffDiagJacobian(unsigned int jvar) override;
52 
57  const MooseVariable & variable() const override { return _var; }
58 
59 protected:
63  virtual Real computeQpResidual() = 0;
64 
70  virtual Real computeQpJacobian();
71 
76  virtual Real computeQpOffDiagJacobian(unsigned int jvar);
77 
80 
82  const VariableValue & _u;
83 
86  std::vector<MooseVariableFEBase *> _save_in;
87  std::vector<AuxVariableName> _save_in_strings;
88 
91  std::vector<MooseVariableFEBase *> _diag_save_in;
92  std::vector<AuxVariableName> _diag_save_in_strings;
93 };
std::vector< AuxVariableName > _save_in_strings
Definition: NodalKernel.h:87
const MooseVariable & variable() const override
Gets the variable this is active on.
Definition: NodalKernel.h:57
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:154
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseBase.h:131
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual void computeJacobian() override
Compute the Jacobian at one node.
Definition: NodalKernel.C:110
MooseVariable & _var
variable this works on
Definition: NodalKernel.h:79
std::vector< AuxVariableName > _diag_save_in_strings
Definition: NodalKernel.h:92
virtual void computeResidual() override
Compute the residual at the current node.
Definition: NodalKernel.C:91
virtual Real computeQpJacobian()
The user can override this function to compute the "on-diagonal" Jacobian contribution.
Definition: NodalKernel.C:148
const VariableValue & _u
Value of the unknown variable this is acting on.
Definition: NodalKernel.h:82
bool _has_diag_save_in
The aux variables to save the diagonal Jacobian contributions to.
Definition: NodalKernel.h:90
bool _has_save_in
The aux variables to save the residual contributions to.
Definition: NodalKernel.h:85
OutputTools< Real >::VariableValue VariableValue
Definition: MooseTypes.h:343
Base class for creating new types of nodal kernels.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Interface for objects that need to get values of MooseVariables.
std::vector< MooseVariableFEBase * > _save_in
Definition: NodalKernel.h:86
std::vector< MooseVariableFEBase * > _diag_save_in
Definition: NodalKernel.h:91
static InputParameters validParams()
Class constructor.
Definition: NodalKernel.C:18
Base class for creating nodal kernels with hand-coded Jacobians.
Definition: NodalKernel.h:18
virtual void computeOffDiagJacobian(unsigned int jvar) override
Compute the off-diagonal Jacobian at one node.
Definition: NodalKernel.C:127
virtual Real computeQpResidual()=0
The user can override this function to compute the residual at a node.
NodalKernel(const InputParameters &parameters)
Definition: NodalKernel.C:37