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

Tracks the AuxKernelType of an AuxKernel: its value type (Real/Vector/Array) and its execution category (nodal, mortar nodal or elemental). More...

#include <Attributes.h>

Inheritance diagram for AttribAuxKernelType:
[legend]

Public Types

typedef AuxKernelType Key
 

Public Member Functions

void setFrom (const Key &k)
 
 AttribAuxKernelType (TheWarehouse &w)
 
 AttribAuxKernelType (TheWarehouse &w, AuxKernelType type)
 
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 (static_cast< unsigned int >(_val))
 
 clonefunc (AttribAuxKernelType)
 
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< Attribute > clone () const =0
 clone creates and returns and identical (deep) copy of this attribute - i.e.
 

Private Attributes

AuxKernelType _val = static_cast<AuxKernelType>(0)
 
int _id = -1
 

Detailed Description

Tracks the AuxKernelType of an AuxKernel: its value type (Real/Vector/Array) and its execution category (nodal, mortar nodal or elemental).

AttribSystem intentionally groups every AuxKernel under the same "AuxKernel" system-attribute tag (registerSystemAttributeName groups objects that execute through the same machinery, unlike registerBase which associates input file syntax), so it cannot select the objects that a given AuxiliarySystem compute loop or queryInto type expects. Objects that are not AuxKernels have no bits set and match no query.

Definition at line 335 of file Attributes.h.

Member Typedef Documentation

◆ Key

Definition at line 338 of file Attributes.h.

Constructor & Destructor Documentation

◆ AttribAuxKernelType() [1/2]

AttribAuxKernelType::AttribAuxKernelType ( TheWarehouse &  w)
inline

Definition at line 341 of file Attributes.h.

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

◆ AttribAuxKernelType() [2/2]

AttribAuxKernelType::AttribAuxKernelType ( TheWarehouse &  w,
AuxKernelType  type 
)
inline

Definition at line 342 of file Attributes.h.

343 : Attribute(w, "aux_kernel_type"), _val(type)
344 {
345 }
AuxKernelType _val
Definition Attributes.h:353

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

AttribAuxKernelType::clonefunc ( AttribAuxKernelType  )

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

AttribAuxKernelType::hashfunc ( static_cast< unsigned int >  _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 AttribAuxKernelType::initFrom ( const MooseObject *  obj)
overridevirtual

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

Implements Attribute.

Definition at line 320 of file Attributes.C.

321{
322 _val = static_cast<AuxKernelType>(0);
323 const auto * aux = dynamic_cast<const AuxKernelBase *>(obj);
324 if (!aux)
325 return;
326
327 if (dynamic_cast<const AuxKernel *>(obj))
329 else if (dynamic_cast<const VectorAuxKernel *>(obj))
331 else if (dynamic_cast<const ArrayAuxKernel *>(obj))
333 else
334 return;
335
336 if (dynamic_cast<const MortarNodalAuxKernelTempl<Real> *>(obj) ||
337 dynamic_cast<const MortarNodalAuxKernelTempl<RealVectorValue> *>(obj) ||
338 dynamic_cast<const MortarNodalAuxKernelTempl<RealEigenVector> *>(obj))
340 else if (aux->isNodal())
342 else
344}
AuxKernelType
Classifies AuxKernels by computed value type and by how they are executed.
Definition Attributes.h:57
@ Nodal
Execution categories.
@ Real
Value types.
Base class for auxiliary kernels.
Base class for creating new nodally-based mortar auxiliary kernels.

◆ isEqual()

bool AttribAuxKernelType::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 360 of file Attributes.C.

361{
362 auto a = dynamic_cast<const AttribAuxKernelType *>(&other);
363 return a && (a->_val == _val);
364}
Tracks the AuxKernelType of an AuxKernel: its value type (Real/Vector/Array) and its execution catego...
Definition Attributes.h:336

◆ isMatch()

bool AttribAuxKernelType::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 346 of file Attributes.C.

347{
348 auto a = dynamic_cast<const AttribAuxKernelType *>(&other);
349 if (!a)
350 return false;
351
352 // Each bit group the query requests must share a bit with this object's type
353 const auto query = a->_val;
355 if (static_cast<bool>(query & group) && !static_cast<bool>(query & group & _val))
356 return false;
357 return static_cast<bool>(_val);
358}
@ AllValueTypes
Convenience groups.
query_obj query

◆ 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 AttribAuxKernelType::setFrom ( const Key &  k)
inline

Definition at line 339 of file Attributes.h.

339{ _val = 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

AuxKernelType AttribAuxKernelType::_val = static_cast<AuxKernelType>(0)
private

Definition at line 353 of file Attributes.h.

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


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