https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ADVectorFunctionDirichletBC.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
11#include "Function.h"
12
14
17{
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
32 : ADDirichletBCBaseTempl<RealVectorValue>(parameters),
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
registerMooseObject("MooseApp", ADVectorFunctionDirichletBC)
Base class for automatic differentiation Dirichlet BCs.
static InputParameters validParams()
const Node *const & _current_node
current node being processed
Definition ADNodalBC.h:42
Boundary condition of a Dirichlet type.
virtual ADRealVectorValue computeQpValue() override
Compute the value of the Dirichlet BC at the current quadrature point.
RealVectorValue _values
The value for this BC.
const Function & _function_x
x component function
const Function & _function_z
z component function
ADVectorFunctionDirichletBC(const InputParameters &parameters)
const Function & _function_y
y component function
const Function *const _function
Optional vectorValue function.
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:30
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:82
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
bool isParamSetByUser(const std::string &name) const
Method returns true if the parameter was set by the user.
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.