https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Attributes | List of all members
AttribInterfaces Class Referenceabstract

#include <Attributes.h>

Inheritance diagram for AttribInterfaces:
[legend]

Public Types

typedef Interfaces Key
 

Public Member Functions

void setFrom (Key k)
 
 AttribInterfaces (TheWarehouse &w)
 
 AttribInterfaces (TheWarehouse &w, Interfaces mask)
 
 AttribInterfaces (TheWarehouse &w, unsigned int mask)
 
virtual void initFrom (const MooseObject *obj) override
 initFrom reads and stores the desired meta-data from obj for later matching comparisons.
 
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.
 
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.
 
 hashfunc (_val)
 
 clonefunc (AttribInterfaces)
 
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.
 
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.
 
virtual std::unique_ptr< Attributeclone () const =0
 clone creates and returns and identical (deep) copy of this attribute - i.e.
 

Private Attributes

uint64_t _val = 0
 
int _id = -1
 

Detailed Description

Definition at line 475 of file Attributes.h.

Member Typedef Documentation

◆ Key

Definition at line 478 of file Attributes.h.

Constructor & Destructor Documentation

◆ AttribInterfaces() [1/3]

AttribInterfaces::AttribInterfaces ( TheWarehouse w)
inline

Definition at line 481 of file Attributes.h.

481: Attribute(w, "interfaces") {}
Attribute is an abstract class that can be implemented in order to track custom metadata about MooseO...

◆ AttribInterfaces() [2/3]

AttribInterfaces::AttribInterfaces ( TheWarehouse w,
Interfaces  mask 
)
inline

Definition at line 482 of file Attributes.h.

483 : Attribute(w, "interfaces"), _val(static_cast<uint64_t>(mask))
484 {
485 }

◆ AttribInterfaces() [3/3]

AttribInterfaces::AttribInterfaces ( TheWarehouse w,
unsigned int  mask 
)
inline

Definition at line 486 of file Attributes.h.

486: Attribute(w, "interfaces"), _val(mask) {}

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()

AttribInterfaces::clonefunc ( AttribInterfaces  )

◆ 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()

AttribInterfaces::hashfunc ( _val  )

◆ 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 68 of file TheWarehouse.h.

68{ return _id; }

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

◆ initFrom()

void AttribInterfaces::initFrom ( const MooseObject obj)
overridevirtual

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

Implements Attribute.

Definition at line 501 of file Attributes.C.

502{
503 _val = 0;
504 // clang-format off
505 _val |= (unsigned int)Interfaces::UserObject * (dynamic_cast<const UserObjectBase *>(obj) != nullptr);
506 _val |= (unsigned int)Interfaces::ElementUserObject * (dynamic_cast<const ElementUserObject *>(obj) != nullptr);
507 _val |= (unsigned int)Interfaces::SideUserObject * (dynamic_cast<const SideUserObject *>(obj) != nullptr);
508 _val |= (unsigned int)Interfaces::InternalSideUserObject * (dynamic_cast<const InternalSideUserObject *>(obj) != nullptr);
509 _val |= (unsigned int)Interfaces::InterfaceUserObject * (dynamic_cast<const InterfaceUserObject *>(obj) != nullptr);
510 _val |= (unsigned int)Interfaces::NodalUserObject * (dynamic_cast<const NodalUserObject *>(obj) != nullptr);
511 _val |= (unsigned int)Interfaces::GeneralUserObject * (dynamic_cast<const GeneralUserObject *>(obj) != nullptr);
512 _val |= (unsigned int)Interfaces::ThreadedGeneralUserObject * (dynamic_cast<const ThreadedGeneralUserObject *>(obj) != nullptr);
513 _val |= (unsigned int)Interfaces::ShapeElementUserObject * (dynamic_cast<const ShapeElementUserObject *>(obj) != nullptr);
514 _val |= (unsigned int)Interfaces::ShapeSideUserObject * (dynamic_cast<const ShapeSideUserObject *>(obj) != nullptr);
515 _val |= (unsigned int)Interfaces::Postprocessor * (dynamic_cast<const Postprocessor *>(obj) != nullptr);
516 _val |= (unsigned int)Interfaces::VectorPostprocessor * (dynamic_cast<const VectorPostprocessor *>(obj) != nullptr);
517 _val |= (unsigned int)Interfaces::BlockRestrictable * (dynamic_cast<const BlockRestrictable *>(obj) != nullptr);
518 _val |= (unsigned int)Interfaces::BoundaryRestrictable * (dynamic_cast<const BoundaryRestrictable *>(obj) != nullptr);
519 _val |= (unsigned int)Interfaces::Reporter * (dynamic_cast<const Reporter *>(obj) != nullptr);
520 _val |= (unsigned int)Interfaces::DomainUserObject * (dynamic_cast<const DomainUserObject *>(obj) != nullptr);
521 _val |= (unsigned int)Interfaces::MortarUserObject * (dynamic_cast<const MortarUserObject *>(obj) != nullptr);
522 _val |= (unsigned int)Interfaces::FVInterpolationMethod * (dynamic_cast<const FVInterpolationMethod *>(obj) != nullptr);
523 // clang-format on
524}
@ InternalSideUserObject
@ ThreadedGeneralUserObject
@ VectorPostprocessor
@ FVInterpolationMethod
@ ShapeSideUserObject
@ InterfaceUserObject
@ BoundaryRestrictable
@ ShapeElementUserObject
void ErrorVector unsigned int
An interface that restricts an object to subdomains via the 'blocks' input parameter.
/class BoundaryRestrictable /brief Provides functionality for limiting the object to certain boundary...
This user object allows related evaluations on elements, boundaries, internal sides,...
Registered base class for linear FV interpolation objects.
Base class for implementing interface user objects.
Base class for user objects executed on all element sides internal to one or more blocks,...
Base class for creating new nodally-based mortar user objects.
A user object that runs over all the nodes and does an aggregation step to compute a single value.
Base class for all Postprocessors.
Reporter objects allow for the declaration of arbitrary data types that are aggregate values for a si...
Definition Reporter.h:48
ElementUserObject class in which the _phi and _grad_phi shape function data is available and correctl...
SideUserObject class in which the _phi and _grad_phi shape function data is available and correctly i...
Base class for user objects executed one or more sidesets, which may be on the outer boundary of the ...
An instance of this object type has one copy per thread that runs on each thread.
Base class for Postprocessors that produce a vector of values.

◆ isEqual()

bool AttribInterfaces::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 534 of file Attributes.C.

535{
536 auto a = dynamic_cast<const AttribInterfaces *>(&other);
537 return a && (a->_val == _val);
538}

◆ isMatch()

bool AttribInterfaces::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 527 of file Attributes.C.

528{
529 auto a = dynamic_cast<const AttribInterfaces *>(&other);
530 return a && (a->_val & _val);
531}

◆ operator!=()

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

Definition at line 63 of file TheWarehouse.h.

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

◆ operator==()

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

Definition at line 59 of file TheWarehouse.h.

60 {
61 return _id == other._id && isEqual(other);
62 }
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 AttribInterfaces::setFrom ( Key  k)
inline

Definition at line 479 of file Attributes.h.

479{ _val = static_cast<uint64_t>(k); }

Member Data Documentation

◆ _id

int Attribute::_id = -1
privateinherited

Definition at line 93 of file TheWarehouse.h.

Referenced by Attribute::id(), and Attribute::operator==().

◆ _val

uint64_t AttribInterfaces::_val = 0
private

Definition at line 494 of file Attributes.h.

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


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