forked from idaholab/moose
/
MooseVariableDependencyInterface.h
45 lines (37 loc) · 1.83 KB
/
MooseVariableDependencyInterface.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/****************************************************************/
/* DO NOT MODIFY THIS HEADER */
/* MOOSE - Multiphysics Object Oriented Simulation Environment */
/* */
/* (c) 2010 Battelle Energy Alliance, LLC */
/* ALL RIGHTS RESERVED */
/* */
/* Prepared by Battelle Energy Alliance, LLC */
/* Under Contract No. DE-AC07-05ID14517 */
/* With the U. S. Department of Energy */
/* */
/* See COPYRIGHT for full restrictions */
/****************************************************************/
#ifndef MOOSEVARIABLEDEPENDENCYINTERFACE_H
#define MOOSEVARIABLEDEPENDENCYINTERFACE_H
#include <set>
// Forward declarations
class MooseVariable;
class MooseVariableDependencyInterface
{
public:
MooseVariableDependencyInterface() {}
/**
* Retrieve the set of MooseVariables that _this_ object depends on.
* @return The MooseVariables that MUST be reinited before evaluating this object
*/
const std::set<MooseVariable *> & getMooseVariableDependencies() const { return _moose_variable_dependencies; }
protected:
/**
* Call this function to add the passed in MooseVariable as a variable that _this_ object depends on.
*/
void addMooseVariableDependency(MooseVariable * var) { _moose_variable_dependencies.insert(var); }
void addMooseVariableDependency(std::vector<MooseVariable *> vars) { _moose_variable_dependencies.insert(vars.begin(), vars.end()); }
private:
std::set<MooseVariable *> _moose_variable_dependencies;
};
#endif // MOOSEVARIABLEDEPENDENCYINTERFACE_H