https://mooseframework.inl.gov
Public Types | Public Member Functions | Private Attributes | List of all members
AttribPostAux Class Referenceabstract

TODO: delete this later - it is a temporary hack for dealing with inter-system dependencies. More...

#include <Attributes.h>

Inheritance diagram for AttribPostAux:
[legend]

Public Types

typedef int Key
 

Public Member Functions

void setFrom (Key k)
 
 AttribPostAux (TheWarehouse &w)
 
 AttribPostAux (TheWarehouse &w, Key val)
 
 AttribPostAux (TheWarehouse &w, const std::set< Key > &vals)
 
virtual void initFrom (const MooseObject *obj) override
 initFrom reads and stores the desired meta-data from obj for later matching comparisons. More...
 
virtual bool isMatch (const Attribute &other) const override
 isMatch returns true if the meta-data stored in this attribute is equivalent to that stored in other. More...
 
virtual bool isEqual (const Attribute &other) const override
 isEqual returns true if the meta-data stored in this attribute is identical to that stored in other. More...
 
 hashfunc (_vals)
 
 clonefunc (AttribPostAux)
 
bool operator== (const Attribute &other) const
 
bool operator!= (const Attribute &other) const
 
unsigned int id () const
 returns the unique attribute ID associated with all attributes that have the same (mose derived) class as this object. More...
 
virtual std::size_t hash () const =0
 This function must return a deterministic value that is uniquely determined by the data the attribute holds (i.e. More...
 
virtual std::unique_ptr< Attributeclone () const =0
 clone creates and returns and identical (deep) copy of this attribute - i.e. More...
 

Private Attributes

std::set< Key_vals
 

Detailed Description

TODO: delete this later - it is a temporary hack for dealing with inter-system dependencies.

this attribute was added to ensure that UOs are uniquely assigned a single group to prevent multiple executions when it is queried in FEProblemBase::computeUserObjectsInternal() for a given exec flag time.

Definition at line 344 of file Attributes.h.

Member Typedef Documentation

◆ Key

Definition at line 347 of file Attributes.h.

Constructor & Destructor Documentation

◆ AttribPostAux() [1/3]

AttribPostAux::AttribPostAux ( TheWarehouse w)
inline

Definition at line 354 of file Attributes.h.

354 : Attribute(w, "post_aux") {}
Attribute(TheWarehouse &w, const std::string name)
Constructs/initializes a new attribute with the specified name for use in warehouse w...
Definition: TheWarehouse.C:36

◆ AttribPostAux() [2/3]

AttribPostAux::AttribPostAux ( TheWarehouse w,
Key  val 
)
inline

Definition at line 355 of file Attributes.h.

355 : Attribute(w, "post_aux") { _vals.insert(val); }
Attribute(TheWarehouse &w, const std::string name)
Constructs/initializes a new attribute with the specified name for use in warehouse w...
Definition: TheWarehouse.C:36
std::set< Key > _vals
Definition: Attributes.h:367

◆ AttribPostAux() [3/3]

AttribPostAux::AttribPostAux ( TheWarehouse w,
const std::set< Key > &  vals 
)
inline

Definition at line 356 of file Attributes.h.

357  : Attribute(w, "post_aux"), _vals(vals)
358  {
359  }
Attribute(TheWarehouse &w, const std::string name)
Constructs/initializes a new attribute with the specified name for use in warehouse w...
Definition: TheWarehouse.C:36
std::set< Key > _vals
Definition: Attributes.h:367

Member Function Documentation

◆ clone()

virtual std::unique_ptr<Attribute> Attribute::clone ( ) const
pure virtualinherited

clone creates and returns and identical (deep) copy of this attribute - i.e.

the result of clone should return true if passed into isMatch.

Referenced by TheWarehouse::update().

◆ clonefunc()

AttribPostAux::clonefunc ( AttribPostAux  )

◆ hash()

virtual std::size_t Attribute::hash ( ) const
pure virtualinherited

This function must return a deterministic value that is uniquely determined by the data the attribute holds (i.e.

is initialized with). Ideally, the data should be uniformly and randomly distributed across the domain of size_t values - e.g. 1 and 2 should hash to completely unrelated values. Use of std::hash for POD is encouraged. A convenience hash_combine function is also provided to combine the results an existing hash with one or more other values.

Referenced by std::hash< Attribute >::operator()().

◆ hashfunc()

AttribPostAux::hashfunc ( _vals  )

◆ id()

unsigned int Attribute::id ( ) const
inlineinherited

returns the unique attribute ID associated with all attributes that have the same (mose derived) class as this object.

This ID is determined at construction time this

Definition at line 67 of file TheWarehouse.h.

Referenced by std::hash< Attribute >::operator()().

67 { return _id; }

◆ initFrom()

void AttribPostAux::initFrom ( const MooseObject obj)
overridevirtual

initFrom reads and stores the desired meta-data from obj for later matching comparisons.

Implements Attribute.

Definition at line 392 of file Attributes.C.

393 {
394 }

◆ isEqual()

bool AttribPostAux::isEqual ( const Attribute other) const
overridevirtual

isEqual returns true if the meta-data stored in this attribute is identical to that stored in other.

isEqual does not need to check/compare the values from the instances' id() functions.

Implements Attribute.

Definition at line 385 of file Attributes.C.

386 {
387  const auto a = dynamic_cast<const AttribPostAux *>(&other);
388  return a && a->_vals == _vals;
389 }
TODO: delete this later - it is a temporary hack for dealing with inter-system dependencies.
Definition: Attributes.h:344
std::set< Key > _vals
Definition: Attributes.h:367

◆ isMatch()

bool AttribPostAux::isMatch ( const Attribute other) const
overridevirtual

isMatch returns true if the meta-data stored in this attribute is equivalent to that stored in other.

This is is for query matching - not exact equivalence. isMatch does not need to check/compare the values from the instances' id() functions.

Implements Attribute.

Definition at line 369 of file Attributes.C.

370 {
371  const auto a = dynamic_cast<const AttribPostAux *>(&other);
372 
373  bool is_match = false;
374 
375  if (a && !_vals.empty() && !a->_vals.empty())
376  {
377  is_match = std::includes(_vals.begin(), _vals.end(), a->_vals.begin(), a->_vals.end()) ||
378  std::includes(a->_vals.begin(), a->_vals.end(), _vals.begin(), _vals.end());
379  }
380 
381  return is_match;
382 }
TODO: delete this later - it is a temporary hack for dealing with inter-system dependencies.
Definition: Attributes.h:344
std::set< Key > _vals
Definition: Attributes.h:367

◆ operator!=()

bool Attribute::operator!= ( const Attribute other) const
inlineinherited

Definition at line 62 of file TheWarehouse.h.

62 { return !(*this == other); }

◆ operator==()

bool Attribute::operator== ( const Attribute other) const
inlineinherited

Definition at line 58 of file TheWarehouse.h.

59  {
60  return _id == other._id && isEqual(other);
61  }
virtual bool isEqual(const Attribute &other) const =0
isEqual returns true if the meta-data stored in this attribute is identical to that stored in other...

◆ setFrom()

void AttribPostAux::setFrom ( Key  k)
inline

Definition at line 348 of file Attributes.h.

349  {
350  _vals.clear();
351  _vals.insert(k);
352  }
std::set< Key > _vals
Definition: Attributes.h:367

Member Data Documentation

◆ _vals

std::set<Key> AttribPostAux::_vals
private

Definition at line 367 of file Attributes.h.

Referenced by AttribPostAux(), isEqual(), isMatch(), and setFrom().


The documentation for this class was generated from the following files: