https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ScalarKernelBase.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
3//*
4//* All rights reserved, see COPYRIGHT for full restrictions
5//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6//*
7//* Licensed under LGPL 2.1, please see LICENSE for details
8//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10#include "ScalarKernelBase.h"
11#include "Assembly.h"
12#include "MooseVariableScalar.h"
13#include "MooseVariableFE.h"
14#include "Problem.h"
15#include "SubProblem.h"
16#include "NonlinearSystem.h"
17
20{
22 params.addParam<bool>("use_displaced_mesh",
23 false,
24 "Whether or not this object should use the "
25 "displaced mesh for computation. Note that "
26 "in the case this is true but no "
27 "displacements are provided in the Mesh block "
28 "the undisplaced mesh will still be used.");
29 params.addParamNamesToGroup("use_displaced_mesh", "Advanced");
30
31 params.registerBase("ScalarKernel");
32 params.registerSystemAttributeName("ScalarKernel");
33
34 return params;
35}
36
38 : ResidualObject(parameters),
39 ScalarCoupleable(this),
40 _var(_sys.getScalarVariable(_tid, parameters.get<NonlinearVariableName>("variable")))
41{
42}
43
44const VariableValue &
46{
48 mooseError("The solution states have already been initialized when calling ",
49 type(),
50 "::uOld().\n\n",
51 "Make sure to call uOld() within the object constructor.");
52
53 return _var.slnOld();
54}
OutputTools< Real >::VariableValue VariableValue
Definition MooseTypes.h:348
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void registerSystemAttributeName(const std::string &value)
This method is used to define the MOOSE system name that is used by the TheWarehouse object for stori...
void addParamNamesToGroup(const std::string &space_delim_names, const std::string group_name)
This method takes a space delimited list of parameter names and adds them to the specified group name...
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an optional parameter and a documentation string to the InputParameters object.
void registerBase(const std::string &value)
This method must be called from every base "Moose System" to create linkage with the Action System.
const std::string & type() const
Get the type of this class.
Definition MooseBase.h:93
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type and optionally a file path to the top-level block p...
Definition MooseBase.h:271
const VariableValue & slnOld() const
This is the common base class for objects that give residual contributions.
static InputParameters validParams()
SystemBase & _sys
Reference to the EquationSystem object.
Interface for objects that needs scalar coupling capabilities.
const VariableValue & uOld() const
Retrieves the old value of the variable that this ScalarKernelBase operates on.
MooseVariableScalar & _var
Scalar variable.
ScalarKernelBase(const InputParameters &parameters)
static InputParameters validParams()
bool solutionStatesInitialized() const
Whether or not the solution states have been initialized via initSolutionState()
Definition SystemBase.h:917