https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ElementIndicator.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 "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),
36 Coupleable(this, false),
37 ScalarCoupleable(this),
38 MooseVariableInterface<Real>(this,
39 false,
40 "variable",
41 Moose::VarKindType::VAR_ANY,
42 Moose::VarFieldType::VAR_FIELD_STANDARD),
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}
Interface for objects that needs coupling capabilities.
Definition Coupleable.h:53
const std::vector< MooseVariableFieldBase * > & getCoupledMooseVars() const
Get the list of all coupled variables.
Definition Coupleable.h:84
static InputParameters validParams()
ElementIndicator(const InputParameters &parameters)
static InputParameters validParams()
Definition Indicator.C:21
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
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 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...
static InputParameters validParams()
void addMooseVariableDependency(MooseVariableFieldBase *var)
Call this function to add the passed in MooseVariableFieldBase as a variable that this object depends...
Interface for objects that need to get values of MooseVariables.
MooseVariableField< Real > & mooseVariableField()
Return the MooseVariableField object that this interface acts on.
Interface class for classes which interact with Postprocessors.
Interface for objects that needs scalar coupling capabilities.
Interface for objects that needs transient capabilities.
static InputParameters validParams()
MOOSE now contains C++17 code, so give a reasonable error message stating what the user can do to add...