www.mooseframework.org
GuaranteeProvider.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
3 /* */
4 /* All contents are licensed under LGPL V2.1 */
5 /* See LICENSE for full restrictions */
6 /****************************************************************/
7 
8 #include "GuaranteeProvider.h"
9 #include "MooseObject.h"
10 
11 GuaranteeProvider::GuaranteeProvider(const MooseObject * /*moose_object*/) {}
12 
13 bool
14 GuaranteeProvider::hasGuarantee(const MaterialPropertyName & prop_name, Guarantee guarantee)
15 {
16  auto it = _guarantees.find(prop_name);
17  if (it == _guarantees.end())
18  return false;
19 
20  auto it2 = it->second.find(guarantee);
21  return it2 != it->second.end();
22 }
23 
24 void
25 GuaranteeProvider::issueGuarantee(const MaterialPropertyName & prop_name, Guarantee guarantee)
26 {
27  // intentional insertion
28  _guarantees[prop_name].insert(guarantee);
29 }
30 
31 void
32 GuaranteeProvider::revokeGuarantee(const MaterialPropertyName & prop_name, Guarantee guarantee)
33 {
34  auto it = _guarantees.find(prop_name);
35  if (it != _guarantees.end())
36  it->second.erase(guarantee);
37 }
GuaranteeProvider(const MooseObject *moose_object)
void issueGuarantee(const MaterialPropertyName &prop_name, Guarantee guarantee)
std::map< MaterialPropertyName, std::set< Guarantee > > _guarantees
bool hasGuarantee(const MaterialPropertyName &prop_name, Guarantee guarantee)
void revokeGuarantee(const MaterialPropertyName &prop_name, Guarantee guarantee)
Guarantee
Enum values for guarantees that can be demanded for material properties.
Definition: Guarantee.h:15