www.mooseframework.org
FunctionDirichletBC.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 #include "FunctionDirichletBC.h"
16 #include "Function.h"
17 
18 template <>
21 {
23  params.addRequiredParam<FunctionName>("function", "The forcing function.");
24  params.addClassDescription(
25  "Imposes the essential boundary condition $u=g(t,\\vec{x})$, where $g$ "
26  "is a (possibly) time and space-dependent MOOSE Function.");
27  return params;
28 }
29 
31  : NodalBC(parameters), _func(getFunction("function"))
32 {
33 }
34 
35 Real
37 {
38  return _func.value(_t, *_current_node);
39 }
40 
41 Real
43 {
44  return _u[_qp] - f();
45 }
virtual Real value(Real t, const Point &p)
Override this to evaluate the scalar function at point (t,x,y,z), by default this returns zero...
Definition: Function.C:43
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
Base class for deriving any boundary condition that works at nodes.
Definition: NodalBC.h:38
InputParameters validParams< NodalBC >()
Definition: NodalBC.C:23
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...
Real f()
Evaluate the function at the current quadrature point and timestep.
virtual Real computeQpResidual() override
FunctionDirichletBC(const InputParameters &parameters)
Function & _func
The function being used for evaluation.
InputParameters validParams< FunctionDirichletBC >()
const Node *& _current_node
current node being processed
Definition: NodalBC.h:53
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 VariableValue & _u
Value of the unknown variable this BC is acting on.
Definition: NodalBC.h:58
unsigned int _qp
Quadrature point index.
Definition: NodalBC.h:56