www.mooseframework.org
ElementIndicator.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 "ElementIndicator.h"
11 
12 #include "Assembly.h"
13 #include "MooseVariableFE.h"
14 #include "SystemBase.h"
15 
16 #include "libmesh/threads.h"
17 
18 template <>
21 {
24  params.addRequiredParam<VariableName>("variable",
25  "The name of the variable that this Indicator operates on");
26 
27  std::vector<SubdomainName> everywhere(1, "ANY_BLOCK_ID");
28  params.addParam<std::vector<SubdomainName>>(
29  "block", everywhere, "block ID or name where the object works");
30 
32  return params;
33 }
34 
36  : Indicator(parameters),
37  TransientInterface(this),
39  Coupleable(this, false),
40  ScalarCoupleable(this),
41  MooseVariableInterface<Real>(this,
42  false,
43  "variable",
46  _field_var(_subproblem.getStandardVariable(_tid, name())),
47 
48  _current_elem(_field_var.currentElem()),
49  _current_elem_volume(_assembly.elemVolume()),
50  _q_point(_assembly.qPoints()),
51  _qrule(_assembly.qRule()),
52  _JxW(_assembly.JxW()),
53  _coord(_assembly.coordTransformation()),
54 
55  _var(_subproblem.getStandardVariable(_tid, parameters.get<VariableName>("variable"))),
56 
57  _u(_var.sln()),
58  _grad_u(_var.gradSln())
59 {
60  const std::vector<MooseVariableFEBase *> & coupled_vars = getCoupledMooseVars();
61  for (const auto & var : coupled_vars)
63 
65 }
InputParameters validParams< MaterialPropertyInterface >()
VarFieldType
Definition: MooseTypes.h:488
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
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...
void addMooseVariableDependency(MooseVariableFEBase *var)
Call this function to add the passed in MooseVariableFEBase as a variable that this object depends on...
MooseVariableFE< Real > * mooseVariable() const
Get the variable that this object is using.
Interface for objects that needs transient capabilities.
VarKindType
Framework-wide stuff.
Definition: MooseTypes.h:481
InputParameters validParams< Indicator >()
Definition: Indicator.C:22
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:62
InputParameters validParams< ElementIndicator >()
const std::vector< MooseVariableFEBase * > & getCoupledMooseVars() const
Get the list of all coupled variables.
Definition: Coupleable.h:90
Interface for objects that need to get values of MooseVariables.
Interface for objects that needs scalar coupling capabilities.
Definition: Moose.h:112
ElementIndicator(const InputParameters &parameters)
InputParameters validParams< TransientInterface >()
Interface class for classes which interact with Postprocessors.