www.mooseframework.org
NodalBC.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 #include "NodalBCBase.h"
13 #include "RandomInterface.h"
15 #include "MooseVariableInterface.h"
16 
20 class NodalBC : public NodalBCBase, public MooseVariableInterface<Real>
21 {
22 public:
24 
26 
31  virtual const MooseVariable & variable() const override { return _var; }
32  virtual void computeResidual() override;
33  virtual void computeJacobian() override;
34  virtual void computeOffDiagJacobian(unsigned int jvar) override;
35  virtual void computeResidualAndJacobian() override;
36 
37 protected:
39 
41  const Node * const & _current_node;
42 
44  const unsigned int _qp = 0;
45 
47  const VariableValue & _u;
48 
49  virtual Real computeQpResidual() = 0;
55  virtual Real computeQpJacobian();
56 
61  virtual Real computeQpOffDiagJacobian(unsigned int jvar);
62 };
virtual void computeOffDiagJacobian(unsigned int jvar) override
Computes this object&#39;s contribution to off-diagonal blocks of the system Jacobian matrix...
Definition: NodalBC.C:116
Class for stuff related to variables.
Definition: Adaptivity.h:31
virtual void computeResidualAndJacobian() override
Compute this object&#39;s contribution to the residual and Jacobian simultaneously.
Definition: NodalBC.C:158
virtual Real computeQpResidual()=0
const Node *const & _current_node
current node being processed
Definition: NodalBC.h:41
NodalBC(const InputParameters &parameters)
Definition: NodalBC.C:25
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Base class for deriving any boundary condition that works at nodes.
Definition: NodalBC.h:20
const unsigned int _qp
Pseudo-"quadrature point" index (Always zero for the current node)
Definition: NodalBC.h:44
virtual void computeResidual() override
Compute this object&#39;s contribution to the residual.
Definition: NodalBC.C:77
MooseVariable & _var
Definition: NodalBC.h:38
virtual Real computeQpJacobian()
The user can override this function to compute the "on-diagonal" Jacobian contribution for this Nodal...
Definition: NodalBC.C:146
virtual const MooseVariable & variable() const override
Gets the variable this BC is active on.
Definition: NodalBC.h:31
Base class for deriving any boundary condition that works at nodes.
Definition: NodalBCBase.h:26
virtual Real computeQpOffDiagJacobian(unsigned int jvar)
This is the virtual that derived classes should override for computing an off-diagonal jacobian compo...
Definition: NodalBC.C:152
forward declarations
Definition: MooseArray.h:17
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
Interface for objects that need to get values of MooseVariables.
const InputParameters & parameters() const
Get the parameters of the object.
static InputParameters validParams()
Definition: NodalBC.C:18
const VariableValue & _u
Value of the unknown variable this BC is acting on.
Definition: NodalBC.h:47
virtual void computeJacobian() override
Compute this object&#39;s contribution to the diagonal Jacobian entries.
Definition: NodalBC.C:91