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 "MooseVariableField.h"
14 #include "SystemBase.h"
15 
16 #include "libmesh/threads.h"
17 
20 {
24  params.addRequiredParam<VariableName>("variable",
25  "The name of the variable that this Indicator operates on");
26  std::vector<SubdomainName> everywhere(1, "ANY_BLOCK_ID");
27  params.addParam<std::vector<SubdomainName>>(
28  "block", everywhere, "block ID or name where the object works");
29  return params;
30 }
31 
33  : Indicator(parameters),
34  TransientInterface(this),
36  Coupleable(this, false),
37  ScalarCoupleable(this),
39  false,
40  "variable",
43  _field_var(_subproblem.getStandardVariable(_tid, name())),
44 
45  _current_elem(_field_var.currentElem()),
46  _current_elem_volume(_assembly.elemVolume()),
47  _q_point(_assembly.qPoints()),
48  _qrule(_assembly.qRule()),
49  _JxW(_assembly.JxW()),
50  _coord(_assembly.coordTransformation()),
51  _var(mooseVariableField()),
52  _u(_var.sln()),
53  _grad_u(_var.gradSln())
54 {
55  const std::vector<MooseVariableFieldBase *> & coupled_vars = getCoupledMooseVars();
56  for (const auto & var : coupled_vars)
58 
60 }
std::string name(const ElemQuality q)
VarFieldType
Definition: MooseTypes.h:634
static InputParameters validParams()
Definition: Indicator.C:21
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
static InputParameters validParams()
static InputParameters validParams()
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.
VarKindType
Framework-wide stuff.
Definition: MooseTypes.h:627
const std::vector< MooseVariableFieldBase * > & getCoupledMooseVars() const
Get the list of all coupled variables.
Definition: Coupleable.h:69
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:44
void addMooseVariableDependency(MooseVariableFieldBase *var)
Call this function to add the passed in MooseVariableFieldBase as a variable that this object depends...
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
Interface for objects that need to get values of MooseVariables.
MooseVariableField< Real > & mooseVariableField()
Return the MooseVariableField<T> object that this interface acts on.
Interface for objects that needs scalar coupling capabilities.
void addParam(const std::string &name, const S &value, const std::string &doc_string)
These methods add an option parameter and a documentation string to the InputParameters object...
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...
ElementIndicator(const InputParameters &parameters)
Interface class for classes which interact with Postprocessors.