www.mooseframework.org
ScalarKernel.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 "ScalarKernel.h"
16 #include "Assembly.h"
17 #include "MooseVariableScalar.h"
18 #include "MooseVariable.h"
19 #include "Problem.h"
20 #include "SubProblem.h"
21 #include "NonlinearSystem.h"
22 
23 template <>
26 {
29  params.addRequiredParam<NonlinearVariableName>(
30  "variable", "The name of the variable that this kernel operates on");
31 
32  params.addParam<bool>("use_displaced_mesh",
33  false,
34  "Whether or not this object should use the "
35  "displaced mesh for computation. Note that "
36  "in the case this is true but no "
37  "displacements are provided in the Mesh block "
38  "the undisplaced mesh will still be used.");
39  params.addParamNamesToGroup("use_displaced_mesh", "Advanced");
40 
41  params.registerBase("ScalarKernel");
42 
43  return params;
44 }
45 
47  : MooseObject(parameters),
48  ScalarCoupleable(this),
49  SetupInterface(this),
50  FunctionInterface(this),
51  UserObjectInterface(this),
53  TransientInterface(this),
54  ZeroInterface(parameters),
55  MeshChangedInterface(parameters),
57  _subproblem(*parameters.get<SubProblem *>("_subproblem")),
58  _sys(*parameters.get<SystemBase *>("_sys")),
59 
60  _tid(parameters.get<THREAD_ID>("_tid")),
61  _assembly(_subproblem.assembly(_tid)),
62  _var(_sys.getScalarVariable(_tid, parameters.get<NonlinearVariableName>("variable"))),
63  _mesh(_subproblem.mesh()),
64  _u(_is_implicit ? _var.sln() : _var.slnOld()),
65  _u_old(_var.slnOld()),
66  _u_dot(_var.uDot()),
67  _du_dot_du(_var.duDotDu())
68 {
69 }
70 
71 void
73 {
74 }
75 
76 bool
78 {
79  return true;
80 }
81 
84 {
85  return _var;
86 }
87 
88 SubProblem &
90 {
91  return _subproblem;
92 }
SubProblem & subProblem()
Definition: ScalarKernel.C:89
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
InputParameters validParams< ScalarKernel >()
Definition: ScalarKernel.C:25
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...
Interface for objects that needs transient capabilities.
MooseVariableScalar & _var
Scalar variable.
Definition: ScalarKernel.h:81
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 UserObjects.
ScalarKernel(const InputParameters &parameters)
Definition: ScalarKernel.C:46
SubProblem & _subproblem
Definition: ScalarKernel.h:74
InputParameters validParams< MooseObject >()
Definition: MooseObject.C:22
virtual bool isActive()
Use this to enable/disable the constraint.
Definition: ScalarKernel.C:77
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:53
Interface to bring zero values inside objects.
Definition: ZeroInterface.h:35
virtual void computeOffDiagJacobian(unsigned int jvar)
Definition: ScalarKernel.C:72
Class for scalar variables (they are different).
Interface for objects that needs scalar coupling capabilities.
MooseVariableScalar & variable()
The variable that this kernel operates on.
Definition: ScalarKernel.C:83
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