www.mooseframework.org
DirichletBC.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 "DirichletBC.h"
16 
17 template <>
20 {
22  p.addRequiredParam<Real>("value", "Value of the BC");
23  p.declareControllable("value");
24  p.addClassDescription("Imposes the essential boundary condition $u=g$, where $g$ "
25  "is a constant, controllable value.");
26  return p;
27 }
28 
30  : NodalBC(parameters), _value(getParam<Real>("value"))
31 {
32 }
33 
34 Real
36 {
37  return _u[_qp] - _value;
38 }
InputParameters validParams< DirichletBC >()
Definition: DirichletBC.C:19
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...
virtual Real computeQpResidual() override
Definition: DirichletBC.C:35
void declareControllable(const std::string &name)
Declare the given parameters as controllable.
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
const Real & _value
The value for this BC.
Definition: DirichletBC.h:39
DirichletBC(const InputParameters &parameters)
Definition: DirichletBC.C:29