https://mooseframework.inl.gov
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 
14 
15 template <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 
25 template <bool is_ad>
27  : ReactionTempl<is_ad>(parameters), _coef(this->template getParam<Real>("coefficient"))
28 {
29 }
30 
31 template <bool is_ad>
34 {
36 }
37 
38 template <bool is_ad>
39 Real
41 {
42  // This function will never be called for the AD version. But because C++ does
43  // not support an optional function declaration based on a template parameter,
44  // we must keep this template for all cases.
45  mooseAssert(!is_ad,
46  "In ADCoefReaction, computeQpJacobian should not be called. Check computeJacobian "
47  "implementation.");
49 }
50 
51 template class CoefReactionTempl<false>;
52 template class CoefReactionTempl<true>;
Moose::GenericType< Real, is_ad > GenericReal
Definition: MooseTypes.h:648
Implements a simple consuming reaction term with weak form $(\psi_i, \lambda u_h)$.
Definition: Reaction.h:18
virtual Real computeQpJacobian() override
Compute this Kernel&#39;s contribution to the Jacobian at the current quadrature point.
Definition: CoefReaction.C:40
registerMooseObject("MooseApp", CoefReaction)
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
static InputParameters validParams()
Definition: CoefReaction.C:17
static InputParameters validParams()
Definition: Reaction.C:17
virtual Real computeQpJacobian() override
Compute this Kernel&#39;s contribution to the Jacobian at the current quadrature point.
Definition: Reaction.C:43
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
CoefReactionTempl(const InputParameters &parameters)
Definition: CoefReaction.C:26
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...
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...
virtual GenericReal< is_ad > computeQpResidual() override
Compute this Kernel&#39;s contribution to the residual at the current quadrature point.
Definition: CoefReaction.C:33
virtual GenericReal< is_ad > computeQpResidual() override
Compute this Kernel&#39;s contribution to the residual at the current quadrature point.
Definition: Reaction.C:36