www.mooseframework.org
ADNodalBC.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 "MooseVariableInterface.h"
14 
18 template <typename T, ComputeStage compute_stage>
20 {
21 public:
23 
24  virtual MooseVariableFE<T> & variable() override { return _var; }
25 
26  void computeResidual() override;
27  void computeJacobian() override;
28  void computeOffDiagJacobian(unsigned int jvar) override;
29 
30 protected:
35 
38 
40  const Node * const & _current_node;
41 
44 };
45 
46 template <ComputeStage compute_stage>
48 template <ComputeStage compute_stage>
50 
53 
54 #define usingTemplNodalBCMembers(type) \
55  usingMooseObjectMembers; \
56  using ADNodalBCTempl<type, compute_stage>::_u; \
57  using ADNodalBCTempl<type, compute_stage>::_var; \
58  using ADNodalBCTempl<type, compute_stage>::_current_node; \
59  using ADNodalBCTempl<type, compute_stage>::_t; \
60  using ADNodalBCTempl<type, compute_stage>::computeResidual; \
61  using ADNodalBCTempl<type, compute_stage>::computeJacobian; \
62  using ADNodalBCTempl<type, compute_stage>::computeOffDiagJacobian; \
63  using ADNodalBCTempl<type, compute_stage>::getFunction; \
64  using ADNodalBCTempl<type, compute_stage>::variable
65 
66 #define usingNodalBCMembers usingTemplNodalBCMembers(Real)
67 #define usingVectorNodalBCMembers usingTemplNodalBCMembers(RealVectorValue)
68 
void computeJacobian() override
Definition: ADNodalBC.C:82
void computeOffDiagJacobian(unsigned int jvar) override
Definition: ADNodalBC.C:112
Base class for deriving any automatic differentiation boundary condition of a integrated type...
Definition: ADNodalBC.h:19
ADNodalBCTempl(const InputParameters &parameters)
Definition: ADNodalBC.C:25
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void computeResidual() override
Definition: ADNodalBC.C:56
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:65
declareADValidParams(ADNodalBC)
Base class for deriving any boundary condition that works at nodes.
Definition: NodalBCBase.h:32
const Node *const & _current_node
current node being processed
Definition: ADNodalBC.h:40
const Moose::ValueType< T, compute_stage >::type & _u
Value of the unknown variable this BC is acting on.
Definition: ADNodalBC.h:43
Interface for objects that need to get values of MooseVariables.
virtual Moose::ValueType< T, compute_stage >::type computeQpResidual()=0
Compute this NodalBC&#39;s contribution to the residual at the current quadrature point.
MooseVariableFE< T > & _var
The variable that this NodalBC operates on.
Definition: ADNodalBC.h:37
virtual MooseVariableFE< T > & variable() override
Get a reference to the MooseVariableFE.
Definition: ADNodalBC.h:24