www.mooseframework.org
ElementUserObject.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 "ElementUserObject.h"
11 #include "MooseVariableFE.h"
12 #include "SubProblem.h"
13 #include "Assembly.h"
14 
15 #include "libmesh/elem.h"
16 
17 template <>
20 {
25  params += validParams<RandomInterface>();
26  return params;
27 }
28 
30  : UserObject(parameters),
31  BlockRestrictable(this),
33  UserObjectInterface(this),
34  Coupleable(this, false),
36  TransientInterface(this),
38  RandomInterface(parameters, _fe_problem, _tid, false),
39  _mesh(_subproblem.mesh()),
40  _current_elem(_assembly.elem()),
41  _current_elem_volume(_assembly.elemVolume()),
42  _q_point(_assembly.qPoints()),
43  _qrule(_assembly.qRule()),
44  _JxW(_assembly.JxW()),
45  _coord(_assembly.coordTransformation())
46 {
47  // Keep track of which variables are coupled so we know what we depend on
48  const std::vector<MooseVariableFEBase *> & coupled_vars = getCoupledMooseVars();
49  for (const auto & var : coupled_vars)
51 }
InputParameters validParams< MaterialPropertyInterface >()
Interface for objects that need parallel consistent random numbers without patterns over the course o...
InputParameters validParams< BlockRestrictable >()
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
InputParameters validParams< ElementUserObject >()
void addMooseVariableDependency(MooseVariableFEBase *var)
Call this function to add the passed in MooseVariableFEBase as a variable that this object depends on...
Interface for objects that needs transient capabilities.
InputParameters validParams< RandomInterface >()
InputParameters validParams< UserObject >()
Definition: UserObject.C:18
Interface for objects that need to use UserObjects.
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:62
An interface for accessing Materials.
const std::vector< MooseVariableFEBase * > & getCoupledMooseVars() const
Get the list of all coupled variables.
Definition: Coupleable.h:90
const std::set< BoundaryID > EMPTY_BOUNDARY_IDS
Definition: MooseTypes.h:452
An interface that restricts an object to subdomains via the &#39;blocks&#39; input parameter.
ElementUserObject(const InputParameters &parameters)
Definition: Moose.h:112
InputParameters validParams< TransientInterface >()
Base class for user-specific data.
Definition: UserObject.h:37
Interface class for classes which interact with Postprocessors.