https://mooseframework.inl.gov
Loading...
Searching...
No Matches
CoupledForce.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 "GenericKernel.h"
13
18template <bool is_ad>
19class CoupledForceTempl : public GenericKernel<is_ad>
20{
21public:
23
25
26protected:
27 virtual GenericReal<is_ad> computeQpResidual() override;
28
29 virtual Real computeQpOffDiagJacobian(unsigned int jvar) override;
30
32
33private:
35 unsigned int _v_var;
39 Real _coef;
40};
41
CoupledForceTempl< false > CoupledForce
CoupledForceTempl< true > ADCoupledForce
Moose::GenericType< VariableValue, is_ad > GenericVariableValue
Definition MooseTypes.h:712
Moose::GenericType< Real, is_ad > GenericReal
Definition MooseTypes.h:698
Implements a source term proportional to the value of a coupled variable.
unsigned int _v_var
Coupled variable number.
const GenericVariableValue< is_ad > & _v
Coupled variable.
Real _coef
Multiplier for the coupled force term.
virtual GenericReal< is_ad > computeQpResidual() override
Compute this Kernel's contribution to the residual at the current quadrature point.
static InputParameters validParams()
virtual Real computeQpOffDiagJacobian(unsigned int jvar) override
For coupling standard variables.
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