https://mooseframework.inl.gov
ADMortarScalarBase.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 "ADMortarConstraint.h"
13 
24 {
25 public:
27 
29 
30  // Using declarations necessary to pull in computeResidual with different parameter list and avoid
31  // hidden method warning
33 
34  // Using declarations necessary to pull in computeJacobian with different parameter list and avoid
35  // hidden method warning
37 
42  {
43  mooseAssert(_kappa_var_ptr, "kappa pointer should have been set in the constructor");
44  return *_kappa_var_ptr;
45  }
46 
50  virtual void computeResidual() override;
55  virtual void computeJacobian() override;
56 
57 protected:
62 
66  virtual void initScalarQpResidual() {}
67 
69  const bool _use_scalar;
70 
73 
76 
78  const unsigned int _kappa_var;
79 
81  const unsigned int _k_order;
82 
85 
87  unsigned int _h;
88 };
89 
90 inline ADReal
92 {
93  mooseError(
94  "A scalar_variable has been set and compute_scalar_residuals=true, ",
95  "but the computeScalarQpResidual method was not overridden. Accidental call of base class?");
96  return 0;
97 }
static InputParameters validParams()
This Constraint adds standardized methods for assembling to a primary scalar variable associated with...
const MooseVariableScalar *const _kappa_var_ptr
(Pointer to) Scalar variable this kernel operates on
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseBase.h:127
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
const bool _compute_scalar_residuals
Whether to compute scalar contributions for this instance.
DualNumber< Real, DNDerivativeType, true > ADReal
Definition: ADRealForward.h:46
const unsigned int _k_order
Order of the scalar variable, used in several places.
virtual void computeResidual() override
Method for computing the residual.
const ADVariableValue & _kappa
Reference to the current solution at the current quadrature point.
const bool _use_scalar
Whether a scalar variable is declared for this constraint.
const unsigned int _kappa_var
The unknown scalar variable ID.
forward declarations
virtual void computeResidual() override
Computes _var-residuals as well as _kappa-residual.
virtual void computeJacobian() override
Method for computing the Jacobian.
Class for scalar variables (they are different).
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
Definition: MooseBase.h:267
ADMortarScalarBase(const InputParameters &parameters)
virtual void initScalarQpResidual()
Put necessary evaluations depending on qp but independent of test functions here. ...
const MooseVariableScalar & scalarVariable() const
The scalar variable that this kernel operates on.
unsigned int _h
Used internally to iterate over each scalar component.
virtual void computeJacobian() override
Computes d-_var-residual / d-_var and d-_var-residual / d-jvar, as well as d-_kappa-residual / d-_var...
virtual ADReal computeScalarQpResidual()
Method for computing the scalar part of residual at quadrature points.