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 
16 template <>
19 {
21  params.addParam<bool>("unique_node_execute",
22  false,
23  "When false (default), block restricted objects will have the "
24  "execute method called multiple times on a single node if the "
25  "node lies on a interface between two subdomains.");
28  params += validParams<RandomInterface>();
29  return params;
30 }
31 
33  : UserObject(parameters),
34  BlockRestrictable(this),
35  BoundaryRestrictable(this, blockIDs(), true), // true for applying to nodesets
36  UserObjectInterface(this),
37  Coupleable(this, true),
39  TransientInterface(this),
41  RandomInterface(parameters, _fe_problem, _tid, true),
42  _mesh(_subproblem.mesh()),
43  _qp(0),
44  _current_node(_assembly.node()),
45  _unique_node_execute(getParam<bool>("unique_node_execute"))
46 {
47  const std::vector<MooseVariableFEBase *> & coupled_vars = getCoupledMooseVars();
48  for (const auto & var : coupled_vars)
50 }
51 
52 void
54 {
55  mooseError("NodalUserObjects do not execute subdomainSetup method, this function does nothing "
56  "and should not be used.");
57 }
Interface for objects that need parallel consistent random numbers without patterns over the course o...
InputParameters validParams< BlockRestrictable >()
NodalUserObject(const InputParameters &parameters)
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...
void mooseError(Args &&... args) const
Definition: MooseObject.h:147
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
virtual void subdomainSetup() override
Gets called when the subdomain changes (i.e.
const std::vector< MooseVariableFEBase * > & getCoupledMooseVars() const
Get the list of all coupled variables.
Definition: Coupleable.h:90
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...
Base class for user-specific data.
Definition: UserObject.h:37
Interface class for classes which interact with Postprocessors.
InputParameters validParams< NodalUserObject >()