www.mooseframework.org
NodalUserObject.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 "NodalUserObject.h"
16 #include "MooseVariable.h"
17 #include "SubProblem.h"
18 #include "MooseTypes.h"
19 #include "Assembly.h"
20 
21 template <>
24 {
26  params.addParam<bool>("unique_node_execute",
27  false,
28  "When false (default), block restricted objects will have the "
29  "execute method called multiple times on a single node if the "
30  "node lies on a interface between two subdomains.");
33  params += validParams<RandomInterface>();
34  return params;
35 }
36 
38  : UserObject(parameters),
39  BlockRestrictable(this),
40  BoundaryRestrictable(this, blockIDs(), true), // true for applying to nodesets
41  UserObjectInterface(this),
42  Coupleable(this, true),
44  TransientInterface(this),
46  RandomInterface(parameters, _fe_problem, _tid, true),
47  ZeroInterface(parameters),
48  _mesh(_subproblem.mesh()),
49  _qp(0),
50  _current_node(_assembly.node()),
51  _unique_node_execute(getParam<bool>("unique_node_execute"))
52 {
53  const std::vector<MooseVariable *> & coupled_vars = getCoupledMooseVars();
54  for (const auto & var : coupled_vars)
56 }
57 
58 void
60 {
61  mooseError("NodalUserObjects do not execute subdomainSetup method, this function does nothing "
62  "and should not be used.");
63 }
Interface for objects that need parallel consistent random numbers without patterns over the course o...
InputParameters validParams< BlockRestrictable >()
NodalUserObject(const InputParameters &parameters)
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...
/class BoundaryRestrictable /brief Provides functionality for limiting the object to certain boundary...
Interface for objects that needs transient capabilities.
InputParameters validParams< RandomInterface >()
InputParameters validParams< UserObject >()
Definition: UserObject.C:23
Interface for objects that need to use UserObjects.
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:35
Interface to bring zero values inside objects.
Definition: ZeroInterface.h:35
virtual void subdomainSetup() override
Gets called when the subdomain changes (i.e.
InputParameters validParams< BoundaryRestrictable >()
An interface that restricts an object to subdomains via the &#39;blocks&#39; input parameter.
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...
void mooseError(Args &&...args) const
Definition: MooseObject.h:80
Base class for user-specific data.
Definition: UserObject.h:42
Interface class for classes which interact with Postprocessors.
InputParameters validParams< NodalUserObject >()