www.mooseframework.org
ElementIndicator.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 "ElementIndicator.h"
16 
17 #include "Assembly.h"
18 #include "MooseVariable.h"
19 #include "SystemBase.h"
20 
21 #include "libmesh/threads.h"
22 
23 template <>
26 {
29  params.addRequiredParam<VariableName>("variable",
30  "The name of the variable that this Indicator operates on");
31 
32  std::vector<SubdomainName> everywhere(1, "ANY_BLOCK_ID");
33  params.addParam<std::vector<SubdomainName>>(
34  "block", everywhere, "block ID or name where the object works");
35 
37  return params;
38 }
39 
41  : Indicator(parameters),
42  TransientInterface(this),
44  Coupleable(this, false),
45  ScalarCoupleable(this),
46  MooseVariableInterface(this, false),
47  ZeroInterface(parameters),
48 
49  _field_var(_sys.getVariable(_tid, name())),
50 
51  _current_elem(_field_var.currentElem()),
52  _current_elem_volume(_assembly.elemVolume()),
53  _q_point(_assembly.qPoints()),
54  _qrule(_assembly.qRule()),
55  _JxW(_assembly.JxW()),
56  _coord(_assembly.coordTransformation()),
57 
58  _var(_subproblem.getVariable(_tid, parameters.get<VariableName>("variable"))),
59 
60  _u(_var.sln()),
61  _grad_u(_var.gradSln()),
62  _u_dot(_var.uDot()),
63  _du_dot_du(_var.duDotDu())
64 {
65  const std::vector<MooseVariable *> & coupled_vars = getCoupledMooseVars();
66  for (const auto & var : coupled_vars)
68 
70 }
InputParameters validParams< MaterialPropertyInterface >()
const std::vector< MooseVariable * > & getCoupledMooseVars() const
Get the list of coupled variables.
Definition: Coupleable.h:63
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
void addMooseVariableDependency(MooseVariable *var)
Call this function to add the passed in MooseVariable as a variable that this object depends on...
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 * mooseVariable()
Get the variable that this object is using.
InputParameters validParams< Indicator >()
Definition: Indicator.C:27
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:35
InputParameters validParams< ElementIndicator >()
Interface to bring zero values inside objects.
Definition: ZeroInterface.h:35
Interface for objects that need to get values of MooseVariables.
Interface for objects that needs scalar coupling capabilities.
ElementIndicator(const InputParameters &parameters)
InputParameters validParams< TransientInterface >()
Interface class for classes which interact with Postprocessors.