www.mooseframework.org
ADVectorFunctionDirichletBC.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 
11 #include "Function.h"
12 
14 
17 {
19  params.addClassDescription(
20  "Imposes the essential boundary condition $\\vec{u}=\\vec{g}$, where $\\vec{g}$ "
21  "components are calculated with functions.");
22  params.addParam<FunctionName>("function",
23  "The boundary condition vector function. This cannot be supplied "
24  "with the component parameters.");
25  params.addParam<FunctionName>("function_x", 0, "The function for the x component");
26  params.addParam<FunctionName>("function_y", 0, "The function for the y component");
27  params.addParam<FunctionName>("function_z", 0, "The function for the z component");
28  return params;
29 }
30 
33  _function(isParamValid("function") ? &getFunction("function") : nullptr),
34  _function_x(getFunction("function_x")),
35  _function_y(getFunction("function_y")),
36  _function_z(getFunction("function_z"))
37 {
38  if (_function && parameters.isParamSetByUser("function_x"))
39  paramError("function_x", "The 'function' and 'function_x' parameters cannot both be set.");
40  if (_function && parameters.isParamSetByUser("function_y"))
41  paramError("function_y", "The 'function' and 'function_y' parameters cannot both be set.");
42  if (_function && parameters.isParamSetByUser("function_z"))
43  paramError("function_z", "The 'function' and 'function_z' parameters cannot both be set.");
44 }
45 
48 {
49  if (_function)
51  else
55  return _values;
56 }
const Function & _function_x
x component function
Base class for automatic differentiation Dirichlet BCs.
Boundary condition of a Dirichlet type.
const Function & _function_y
y component function
virtual ADRealVectorValue computeQpValue() override
Compute the value of the Dirichlet BC at the current quadrature point.
const Function *const _function
Optional vectorValue function.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
RealVectorValue _values
The value for this BC.
void paramError(const std::string &param, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
bool isParamSetByUser(const std::string &name) const
Method returns true if the parameter was by the user.
const Function & _function_z
z component function
registerMooseObject("MooseApp", ADVectorFunctionDirichletBC)
const Node *const & _current_node
current node being processed
Definition: ADNodalBC.h:42
static InputParameters validParams()
virtual RealVectorValue vectorValue(Real t, const Point &p) const
Override this to evaluate the vector function at a point (t,x,y,z), by default this returns a zero ve...
Definition: Function.C:87
static InputParameters validParams()
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 InputParameters & parameters() const
Get the parameters of the object.
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 Real value(Real t, const Point &p) const
Override this to evaluate the scalar function at point (t,x,y,z), by default this returns zero...
Definition: Function.C:41
ADVectorFunctionDirichletBC(const InputParameters &parameters)