www.mooseframework.org
BoundaryCondition.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 "BoundaryCondition.h"
16 #include "Problem.h"
17 #include "SubProblem.h"
18 #include "SystemBase.h"
19 #include "MooseVariable.h"
20 
21 template <>
24 {
28 
29  params.addRequiredParam<NonlinearVariableName>(
30  "variable", "The name of the variable that this boundary condition applies to");
31  params.addParam<bool>("use_displaced_mesh",
32  false,
33  "Whether or not this object should use the "
34  "displaced mesh for computation. Note that "
35  "in the case this is true but no "
36  "displacements are provided in the Mesh block "
37  "the undisplaced mesh will still be used.");
38  params.addParamNamesToGroup("use_displaced_mesh", "Advanced");
39 
40  params.declareControllable("enable");
41  params.registerBase("BoundaryCondition");
42 
43  return params;
44 }
45 
47  : MooseObject(parameters),
48  BoundaryRestrictableRequired(this, nodal),
49  SetupInterface(this),
50  FunctionInterface(this),
52  UserObjectInterface(this),
53  TransientInterface(this),
57  Restartable(parameters, "BCs"),
58  ZeroInterface(parameters),
59  MeshChangedInterface(parameters),
60  _subproblem(*parameters.get<SubProblem *>("_subproblem")),
61  _fe_problem(*parameters.get<FEProblemBase *>("_fe_problem_base")),
62  _sys(*parameters.get<SystemBase *>("_sys")),
63  _tid(parameters.get<THREAD_ID>("_tid")),
64  _assembly(_subproblem.assembly(_tid)),
65  _var(_sys.getVariable(_tid, parameters.get<NonlinearVariableName>("variable"))),
66  _mesh(_subproblem.mesh())
67 {
68 }
69 
72 {
73  return _var;
74 }
75 
76 SubProblem &
78 {
79  return _subproblem;
80 }
81 
82 bool
84 {
85  return true;
86 }
SubProblem & _subproblem
Reference to SubProblem.
A class for requiring an object to be boundary restricted.
SubProblem & subProblem()
Get a reference to the subproblem.
A class for creating restricted objects.
Definition: Restartable.h:31
virtual bool shouldApply()
Hook for turning the boundary condition on and off.
Class for stuff related to variables.
Definition: MooseVariable.h:43
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
MooseVariable & variable()
Gets the variable this BC is active on.
InputParameters validParams< BoundaryCondition >()
Base class for a system (of equations)
Definition: SystemBase.h:91
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
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...
Interface for objects that needs transient capabilities.
MooseVariable & _var
variable this BC works on
Interface for notifications that the mesh has changed.
Every object that can be built by the factory should be derived from this class.
Definition: MooseObject.h:36
Interface for objects that need to use distributions.
Interface for objects that need to use UserObjects.
InputParameters validParams< MooseObject >()
Definition: MooseObject.C:22
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:53
Interface to bring zero values inside objects.
Definition: ZeroInterface.h:35
InputParameters validParams< BoundaryRestrictableRequired >()
Interface for objects that need to use functions.
InputParameters validParams< TransientInterface >()
Interface class for classes which interact with Postprocessors.
unsigned int THREAD_ID
Definition: MooseTypes.h:79
BoundaryCondition(const InputParameters &parameters, bool nodal)
Class constructor.