https://mooseframework.inl.gov
Loading...
Searching...
No Matches
FunctorNeumannBC.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 "FunctorNeumannBC.h"
11
13
16{
18
19 params.addClassDescription("Imposes the integrated boundary condition "
20 "$\\frac{\\partial u}{\\partial n}=h(t,\\vec{x})$, "
21 "where $h$ is a functor.");
22
23 params.addRequiredParam<MooseFunctorName>("functor", "The functor to impose");
24 params.addParam<MooseFunctorName>(
25 "coefficient", 1.0, "An optional functor coefficient to multiply the imposed functor");
26 params.addParam<bool>("flux_is_inward",
27 true,
28 "Set to true if a positive evaluation of the provided functor corresponds "
29 "to a flux in the inward direction; else the outward direction");
30
31 return params;
32}
33
35 : ADIntegratedBC(parameters),
36 _functor(getFunctor<ADReal>("functor")),
37 _coef(getFunctor<ADReal>("coefficient")),
38 _sign(getParam<bool>("flux_is_inward") ? -1.0 : 1.0)
39{
40}
41
DualNumber< Real, DNDerivativeType, true > ADReal
registerMooseObject("MooseApp", FunctorNeumannBC)
Base class for deriving any boundary condition of a integrated type.
static InputParameters validParams()
const ADTemplateVariableTestValue< T > & _test
test function values (in QPs)
Neumann boundary condition with functor inputs.
FunctorNeumannBC(const InputParameters &parameters)
const Moose::Functor< ADReal > & _coef
Coefficient.
const Moose::Functor< ADReal > & _functor
The functor to impose.
static InputParameters validParams()
const Real _sign
Sign to apply to flux.
virtual ADReal computeQpResidual() override
Compute this IntegratedBC's contribution to the residual 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 addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
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.
const unsigned int & _current_side
current side of the current element
const QBase *const & _qrule
active quadrature rule
unsigned int _qp
quadrature point index
unsigned int _i
i-th, j-th index for enumerating test and shape functions
const Elem *const & _current_elem
current element
const MooseArray< Point > & _q_point
active quadrature points
StateArg currentState()
Argument for requesting functor evaluation at quadrature point locations on an element side.