www.mooseframework.org
NeumannBC.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 
12 registerMooseObject("MooseApp", NeumannBC);
13 registerMooseObject("MooseApp", ADNeumannBC);
14 
15 template <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 
31 template <bool is_ad>
33  : GenericIntegratedBC<is_ad>(parameters), _value(this->template getParam<Real>("value"))
34 {
35 }
36 
37 template <bool is_ad>
40 {
41  return -_test[_i][_qp] * _value;
42 }
43 
44 template class NeumannBCTempl<false>;
45 template class NeumannBCTempl<true>;
registerMooseObject("MooseApp", NeumannBC)
static InputParameters validParams()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Implements a simple constant Neumann BC where grad(u)=value on the boundary.
Definition: NeumannBC.h:19
static InputParameters validParams()
Definition: NeumannBC.C:17
NeumannBCTempl(const InputParameters &parameters)
Definition: NeumannBC.C:32
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
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 option parameter and a documentation string to the InputParameters object...
virtual GenericReal< is_ad > computeQpResidual() override
Method for computing the residual at quadrature points.
Definition: NeumannBC.C:39
typename Moose::GenericType< Real, is_ad > GenericReal
Definition: MooseTypes.h:559
void declareControllable(const std::string &name, std::set< ExecFlagType > execute_flags={})
Declare the given parameters as controllable.