https://mooseframework.inl.gov
Loading...
Searching...
No Matches
NeumannBC.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 "NeumannBC.h"
11
14
15template <bool is_ad>
18{
20 params.addParam<Real>("value",
21 0.0,
22 "For a Laplacian problem, the value of the gradient dotted with the "
23 "normals on the boundary.");
24 params.declareControllable("value");
25 params.addClassDescription("Imposes the integrated boundary condition "
26 "$\\frac{\\partial u}{\\partial n}=h$, "
27 "where $h$ is a constant, controllable value.");
28 return params;
29}
30
31template <bool is_ad>
33 : GenericIntegratedBC<is_ad>(parameters), _value(this->template getParam<Real>("value"))
34{
35}
36
37template <bool is_ad>
40{
41 return -_test[_i][_qp] * _value;
42}
43
44template class NeumannBCTempl<false>;
45template class NeumannBCTempl<true>;
Moose::GenericType< Real, is_ad > GenericReal
Definition MooseTypes.h:698
registerMooseObject("MooseApp", NeumannBC)
static InputParameters validParams()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void declareControllable(const std::string &name, std::set< ExecFlagType > execute_flags={})
Declare the given parameters as controllable.
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 constant Neumann BC where grad(u)=value on the boundary.
Definition NeumannBC.h:20
virtual GenericReal< is_ad > computeQpResidual() override
Method for computing the residual at quadrature points.
Definition NeumannBC.C:39
static InputParameters validParams()
Definition NeumannBC.C:17
NeumannBCTempl(const InputParameters &parameters)
Definition NeumannBC.C:32