www.mooseframework.org
Constraint.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 #include "Constraint.h"
15 
16 #include "SystemBase.h"
17 
18 template <>
21 {
23  // Add the SetupInterface parameter, 'execute_on', default is 'linear'
24  params += validParams<SetupInterface>();
25 
26  params.addRequiredParam<NonlinearVariableName>(
27  "variable", "The name of the variable that this constraint is applied to.");
28  params.addParam<bool>("use_displaced_mesh",
29  false,
30  "Whether or not this object should use the "
31  "displaced mesh for computation. Note that "
32  "in the case this is true but no "
33  "displacements are provided in the Mesh block "
34  "the undisplaced mesh will still be used.");
35  params.addParamNamesToGroup("use_displaced_mesh", "Advanced");
36 
37  params.declareControllable("enable");
38  params.registerBase("Constraint");
39 
40  return params;
41 }
42 
44  : MooseObject(parameters),
45  SetupInterface(this),
46  FunctionInterface(this),
47  UserObjectInterface(this),
48  TransientInterface(this),
50  Restartable(parameters, "Constraints"),
51  ZeroInterface(parameters),
52  MeshChangedInterface(parameters),
53  _subproblem(*parameters.get<SubProblem *>("_subproblem")),
54  _sys(*parameters.get<SystemBase *>("_sys")),
55  _tid(parameters.get<THREAD_ID>("_tid")),
56  _assembly(_subproblem.assembly(_tid)),
57  _var(_sys.getVariable(_tid, parameters.get<NonlinearVariableName>("variable"))),
58  _mesh(_subproblem.mesh())
59 {
60 }
61 
A class for creating restricted objects.
Definition: Restartable.h:31
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
InputParameters validParams< SetupInterface >()
Base class for a system (of equations)
Definition: SystemBase.h:91
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...
Constraint(const InputParameters &parameters)
Definition: Constraint.C:43
Interface for objects that needs transient capabilities.
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
InputParameters validParams< Constraint >()
Definition: Constraint.C:20
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
virtual ~Constraint()
Definition: Constraint.C:62
Interface for objects that need to use functions.
unsigned int THREAD_ID
Definition: MooseTypes.h:79