www.mooseframework.org
NodalUserObject.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 "NodalUserObject.h"
11 #include "MooseVariableFE.h"
12 #include "SubProblem.h"
13 #include "MooseTypes.h"
14 #include "Assembly.h"
15 
18 {
20  params.addParam<bool>("unique_node_execute",
21  false,
22  "When false (default), block restricted objects will have the "
23  "execute method called multiple times on a single node if the "
24  "node lies on a interface between two subdomains.");
27  params += RandomInterface::validParams();
28  return params;
29 }
30 
32  : UserObject(parameters),
33  BlockRestrictable(this),
34  BoundaryRestrictable(this, blockIDs(), true), // true for applying to nodesets
35  Coupleable(this, true),
37  TransientInterface(this),
38  RandomInterface(parameters, _fe_problem, _tid, true),
39  _mesh(_subproblem.mesh()),
40  _qp(0),
41  _current_node(_assembly.node()),
42  _unique_node_execute(getParam<bool>("unique_node_execute"))
43 {
44  const std::vector<MooseVariableFEBase *> & coupled_vars = getCoupledMooseVars();
45  for (const auto & var : coupled_vars)
47 }
48 
49 void
51 {
52  mooseError("NodalUserObjects do not execute subdomainSetup method, this function does nothing "
53  "and should not be used.");
54 }
Interface for objects that need parallel consistent random numbers without patterns over the course o...
NodalUserObject(const InputParameters &parameters)
MeshBase & mesh
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
/class BoundaryRestrictable /brief Provides functionality for limiting the object to certain boundary...
static InputParameters validParams()
static InputParameters validParams()
Interface for objects that needs transient capabilities.
static InputParameters validParams()
static InputParameters validParams()
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...
virtual void subdomainSetup() override
Gets called when the subdomain changes (i.e.
An interface that restricts an object to subdomains via the &#39;blocks&#39; input parameter.
void mooseError(Args &&... args) const
Emits an error prefixed with object name and type.
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...
Base class for user-specific data.
Definition: UserObject.h:39
static InputParameters validParams()
Definition: UserObject.C:18