www.mooseframework.org
GeneralUserObject.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 "GeneralUserObject.h"
11 
12 template <>
15 {
18  params.addParam<bool>(
19  "force_preaux", false, "Forces the GeneralUserObject to be executed in PREAUX");
20  params.addParamNamesToGroup("force_preaux", "Advanced");
21  return params;
22 }
23 
25  : UserObject(parameters),
27  TransientInterface(this),
29  UserObjectInterface(this),
32 {
33  _supplied_vars.insert(name());
34 }
35 
36 const std::set<std::string> &
38 {
39  return _depend_vars;
40 }
41 
42 const std::set<std::string> &
44 {
45  return _supplied_vars;
46 }
47 
48 const PostprocessorValue &
50 {
51  _depend_vars.insert(_pars.get<PostprocessorName>(name));
53 }
54 
55 const PostprocessorValue &
56 GeneralUserObject::getPostprocessorValueByName(const PostprocessorName & name)
57 {
58  _depend_vars.insert(name);
60 }
61 
64  const std::string & vector_name)
65 {
66  _depend_vars.insert(_pars.get<VectorPostprocessorName>(name));
68 }
69 
71 GeneralUserObject::getVectorPostprocessorValueByName(const VectorPostprocessorName & name,
72  const std::string & vector_name)
73 {
74  _depend_vars.insert(name);
76 }
77 
80  const std::string & vector_name,
81  bool use_broadcast)
82 {
83  _depend_vars.insert(_pars.get<VectorPostprocessorName>(name));
85  name, vector_name, use_broadcast);
86 }
87 
89 GeneralUserObject::getVectorPostprocessorValueByName(const VectorPostprocessorName & name,
90  const std::string & vector_name,
91  bool use_broadcast)
92 {
93  _depend_vars.insert(name);
95  name, vector_name, use_broadcast);
96 }
97 
98 void
100 {
101  mooseError("GeneralUserObjects do not execute using threads, this function does nothing and "
102  "should not be used.");
103 }
104 
105 void
107 {
108  mooseError("GeneralUserObjects do not execute subdomainSetup method, this function does nothing "
109  "and should not be used.");
110 }
InputParameters validParams< MaterialPropertyInterface >()
const std::set< std::string > & getRequestedItems() override
Return a set containing the names of items requested by the object.
virtual const PostprocessorValue & getPostprocessorValueByName(const PostprocessorName &name)
const PostprocessorValue & getPostprocessorValueByName(const PostprocessorName &name)
Retrieve the value of the Postprocessor.
virtual const VectorPostprocessorValue & getVectorPostprocessorValueByName(const VectorPostprocessorName &name, const std::string &vector_name)
DEPRECATED: Use the new version where you need to specify whether or not the vector must be broadcast...
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
InputParameters validParams< GeneralUserObject >()
void mooseError(Args &&... args) const
Definition: MooseObject.h:147
virtual const VectorPostprocessorValue & getVectorPostprocessorValueByName(const VectorPostprocessorName &name, const std::string &vector_name) override
DEPRECATED: Use the new version where you need to specify whether or not the vector must be broadcast...
const PostprocessorValue & getPostprocessorValue(const std::string &name)
Retrieve the value of a Postprocessor or one of it&#39;s old or older values.
std::set< std::string > _depend_vars
Interface for objects that needs transient capabilities.
InputParameters validParams< UserObject >()
Definition: UserObject.C:18
virtual void threadJoin(const UserObject &) override
This method is not used and should not be used in a custom GeneralUserObject.
Real PostprocessorValue
MOOSE typedefs.
Definition: MooseTypes.h:154
Interface for objects that need to use UserObjects.
virtual const PostprocessorValue & getPostprocessorValue(const std::string &name)
Store dependency among same object types for proper execution order.
const InputParameters & _pars
Parameters of this object, references the InputParameters stored in the InputParametersWarehouse.
Definition: MooseObject.h:174
std::set< std::string > _supplied_vars
virtual void subdomainSetup() override
Gets called when the subdomain changes (i.e.
std::vector< Real > VectorPostprocessorValue
Definition: MooseTypes.h:155
virtual const VectorPostprocessorValue & getVectorPostprocessorValue(const std::string &name, const std::string &vector_name) override
DEPRECATED: Use the new version where you need to specify whether or not the vector must be broadcast...
const std::set< SubdomainID > EMPTY_BLOCK_IDS
Definition: MooseTypes.h:451
An interface for accessing Materials.
const std::set< BoundaryID > EMPTY_BOUNDARY_IDS
Definition: MooseTypes.h:452
virtual const VectorPostprocessorValue & getVectorPostprocessorValue(const std::string &name, const std::string &vector_name)
DEPRECATED: Use the new version where you need to specify whether or not the vector must be broadcast...
GeneralUserObject(const InputParameters &parameters)
Interface for sorting dependent vectors of objects.
const std::string & name() const
Get the name of the object.
Definition: MooseObject.h:59
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...
Definition: Moose.h:112
const std::set< std::string > & getSuppliedItems() override
Return a set containing the names of items owned by the object.
Base class for user-specific data.
Definition: UserObject.h:37
Interface class for classes which interact with Postprocessors.