https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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{
25public:
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
57protected:
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
90inline ADReal
92{
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}
DualNumber< Real, DNDerivativeType, true > ADReal
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
virtual void computeJacobian() override
Method for computing the Jacobian.
virtual void computeResidual() override
Method for computing the residual.
This Constraint adds standardized methods for assembling to a primary scalar variable associated with...
virtual void initScalarQpResidual()
Put necessary evaluations depending on qp but independent of test functions here.
virtual void computeJacobian() override
Computes d-_var-residual / d-_var and d-_var-residual / d-jvar, as well as d-_kappa-residual / d-_var...
static InputParameters validParams()
const unsigned int _kappa_var
The unknown scalar variable ID.
const MooseVariableScalar & scalarVariable() const
The scalar variable that this kernel operates on.
virtual void computeResidual() override
Computes _var-residuals as well as _kappa-residual.
const MooseVariableScalar *const _kappa_var_ptr
(Pointer to) Scalar variable this kernel operates on
virtual ADReal computeScalarQpResidual()
Method for computing the scalar part of residual at quadrature points.
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.
unsigned int _h
Used internally to iterate over each scalar component.
const bool _compute_scalar_residuals
Whether to compute scalar contributions for this instance.
const unsigned int _k_order
Order of the scalar variable, used in several places.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
Class for scalar variables (they are different).