https://mooseframework.inl.gov
Loading...
Searching...
No Matches
VectorFunctionDirichletBC.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
15 LagrangeVecFunctionDirichletBC,
16 "05/01/2019 00:01",
18
21{
24 "Imposes the essential boundary condition $\\vec{u}=\\vec{g}$, where $\\vec{g}$ "
25 "components are calculated with functions.");
26
27 params.addParam<FunctionName>("function",
28 "The boundary condition vector function. This cannot be supplied "
29 "with the component parameters.");
30
31 params.addParam<FunctionName>("function_x", 0, "The function for the x component");
32 params.addParam<FunctionName>("function_y", 0, "The function for the y component");
33 params.addParam<FunctionName>("function_z", 0, "The function for the z component");
34
35 params.addDeprecatedParam<FunctionName>(
36 "x_exact_soln", "The exact solution for the x component", "Use 'function_x' instead.");
37 params.addDeprecatedParam<FunctionName>(
38 "y_exact_soln", "The exact solution for the y component", "Use 'function_y' instead.");
39 params.addDeprecatedParam<FunctionName>(
40 "z_exact_soln", "The exact solution for the z component", "Use 'function_z' instead.");
41 return params;
42}
43
45 : VectorNodalBC(parameters),
46 _function(isParamValid("function") ? &getFunction("function") : nullptr),
47 _function_x(isParamValid("x_exact_soln") ? getFunction("x_exact_soln")
48 : getFunction("function_x")),
49 _function_y(isParamValid("y_exact_soln") ? getFunction("y_exact_soln")
50 : getFunction("function_y")),
51 _function_z(isParamValid("z_exact_soln") ? getFunction("z_exact_soln")
52 : getFunction("function_z"))
53{
54 if (_function &&
55 (parameters.isParamSetByUser("function_x") || parameters.isParamSetByUser("x_exact_soln")))
56 paramError("function_x", "The 'function' and 'function_x' parameters cannot both be set.");
57 if (_function &&
58 (parameters.isParamSetByUser("function_y") || parameters.isParamSetByUser("y_exact_soln")))
59 paramError("function_y", "The 'function' and 'function_y' parameters cannot both be set.");
60 if (_function &&
61 (parameters.isParamSetByUser("function_z") || parameters.isParamSetByUser("z_exact_soln")))
62 paramError("function_z", "The 'function' and 'function_z' parameters cannot both be set.");
63}
64
65RealVectorValue
registerMooseObjectRenamed("MooseApp", LagrangeVecFunctionDirichletBC, "05/01/2019 00:01", VectorFunctionDirichletBC)
registerMooseObject("MooseApp", VectorFunctionDirichletBC)
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 addDeprecatedParam(const std::string &name, const T &value, const std::string &doc_string, const std::string &deprecation_message)
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.
Definition MooseBase.h:131
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 ...
Definition MooseBase.h:457
Boundary condition of a Dirichlet type.
VectorFunctionDirichletBC(const InputParameters &parameters)
const Function & _function_y
y component function
RealVectorValue _values
The value for this BC.
static InputParameters validParams()
virtual RealVectorValue computeQpResidual() override
const Function & _function_x
x component function
const Function & _function_z
z component function
const Function *const _function
Optional vectorValue function.
Base class for deriving any boundary condition that works at nodes on vector variables.
static InputParameters validParams()
const Node *const & _current_node
current node being processed
const RealVectorValue & _u
Value of the unknown variable this BC is acting on.