https://mooseframework.inl.gov
Loading...
Searching...
No Matches
CoefReaction.C
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#include "CoefReaction.h"
11
12registerMooseObjectReplaced("MooseApp", CoefReaction, "01/01/2027 00:00", Reaction);
13registerMooseObjectReplaced("MooseApp", ADCoefReaction, "01/21/2027 00:00", ADReaction);
14
15template <bool is_ad>
18{
20 params.addClassDescription("Implements the residual term (p*u, test)");
21 params.addParam<Real>("coefficient", 1.0, "Coefficient of the term");
22 return params;
23}
24
25template <bool is_ad>
27 : ReactionTempl<is_ad>(parameters), _coef(this->template getParam<Real>("coefficient"))
28{
29}
30
31template <bool is_ad>
37
38template <bool is_ad>
39Real
41{
42 mooseAssert(!is_ad,
43 "In ADCoefReaction, computeQpJacobian should not be called. Check computeJacobian "
44 "implementation.");
46}
47
48template class CoefReactionTempl<false>;
49template class CoefReactionTempl<true>;
registerMooseObjectReplaced("MooseApp", CoefReaction, "01/01/2027 00:00", Reaction)
Moose::GenericType< Real, is_ad > GenericReal
Definition MooseTypes.h:698
static InputParameters validParams()
virtual GenericReal< is_ad > computeQpResidual() override
Compute this Kernel's contribution to the residual at the current quadrature point.
CoefReactionTempl(const InputParameters &parameters)
virtual Real computeQpJacobian() override
Compute this Kernel's contribution to the Jacobian at the current quadrature point.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object.
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump.
Implements a simple consuming reaction term with weak form $(\psi_i, \lambda u_h)$.
Definition Reaction.h:19
virtual GenericReal< is_ad > computeQpResidual() override
Compute this Kernel's contribution to the residual at the current quadrature point.
Definition Reaction.C:36
static InputParameters validParams()
Definition Reaction.C:17
virtual Real computeQpJacobian() override
Compute this Kernel's contribution to the Jacobian at the current quadrature point.
Definition Reaction.C:43