https://mooseframework.inl.gov
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
MaterialWarehouse Class Reference

MaterialBase objects are special in that they have additional objects created automatically (see FEProblemBase::addMaterial). More...

#include <MaterialWarehouse.h>

Inheritance diagram for MaterialWarehouse:
[legend]

Public Member Functions

 MaterialWarehouse (THREAD_ID num_threads=libMesh::n_threads())
 
const MooseObjectWarehouse< MaterialBase > & operator[] (Moose::MaterialDataType data_type) const
 
void addObjects (std::shared_ptr< MaterialBase > block, std::shared_ptr< MaterialBase > neighbor, std::shared_ptr< MaterialBase > face, THREAD_ID tid=0)
 A special method unique to this class for adding Block, Neighbor, and Face material objects.
 
virtual void addObject (std::shared_ptr< MaterialBase > object, THREAD_ID tid=0, bool recurse=true) override
 Adds an object to the storage structure.
 
bool hasVariableObjects (unsigned int variable_id, THREAD_ID tid=0) const
 Checks for whether this warehouse has objects for a given variable.
 
unsigned int size (THREAD_ID tid=0) const
 Return how many kernels we store in the current warehouse.
 
bool hasObjectsForVariableAndBlocks (const VariableName &var_name, const std::set< SubdomainID > &blocks, std::set< SubdomainID > &blocks_covered, THREAD_ID tid) const
 Whether there are objects for this variable and the set of blocks passed.
 
std::set< SubdomainID > getActiveBlocks (THREAD_ID tid=0) const
 Return a set of active SubdomainsIDs.
 
const std::vector< std::shared_ptr< T > > & getObjectsForVariable (const VariableName &var_name, THREAD_ID tid) const
 Getter for objects that have the 'variable' set to a particular variable Note that users should check whether there are objects using 'hasObjectsForVariable' before calling this routine, because it will throw if there are no objects for this variable.
 
void sort (THREAD_ID tid=0)
 Sort the objects using the DependencyResolver.
 
void subdomainsCovered (std::set< SubdomainID > &subdomains_covered, std::set< std::string > &unique_variables, THREAD_ID tid=0) const
 Populates a set of covered subdomains and the associated variable names.
 
THREAD_ID numThreads () const
 Return the number of threads.
 
std::string activeObjectsToFormattedString (THREAD_ID tid=0, const std::string &prefix="[DBG]") const
 Output the active content of the warehouse to a string, meant to be output to the console.
 
virtual void initialSetup (THREAD_ID tid=0) const override
 Convenience methods for calling object setup methods that handle the extra neighbor and face objects.
 
virtual void timestepSetup (THREAD_ID tid=0) const override
 
virtual void subdomainSetup (THREAD_ID tid=0) const override
 
virtual void subdomainSetup (SubdomainID id, THREAD_ID tid=0) const override
 
virtual void neighborSubdomainSetup (THREAD_ID tid=0) const
 
virtual void neighborSubdomainSetup (SubdomainID id, THREAD_ID tid=0) const
 
virtual void jacobianSetup (THREAD_ID tid=0) const override
 
virtual void residualSetup (THREAD_ID tid=0) const override
 
virtual void updateActive (THREAD_ID tid=0) override
 Update the active status of Kernels.
 
void sort (THREAD_ID tid=0, bool sort_all_objects=false)
 By default, this method only sorts block and boundary-wise object storages that are used by the MOOSE threaded element loops.
 
virtual void customSetup (const ExecFlagType &exec_type, THREAD_ID tid=0) const
 
bool hasActiveVariableBlockObjects (unsigned int variable_id, SubdomainID block_id, THREAD_ID tid=0) const
 Methods for checking/getting variable kernels for a variable and SubdomainID.
 
const std::vector< std::shared_ptr< MaterialBase > > & getActiveVariableBlockObjects (unsigned int variable_id, SubdomainID block_id, THREAD_ID tid=0) const
 
const std::vector< std::shared_ptr< T > > & getObjects (THREAD_ID tid=0) const
 Retrieve complete vector to the all/block/boundary restricted objects for a given thread.
 
const std::map< SubdomainID, std::vector< std::shared_ptr< T > > > & getBlockObjects (THREAD_ID tid=0) const
 
const std::vector< std::shared_ptr< T > > & getBlockObjects (SubdomainID id, THREAD_ID tid=0) const
 
const std::map< BoundaryID, std::vector< std::shared_ptr< T > > > & getBoundaryObjects (THREAD_ID tid=0) const
 
const std::vector< std::shared_ptr< T > > & getBoundaryObjects (BoundaryID id, THREAD_ID tid=0) const
 
const std::vector< std::shared_ptr< T > > & getActiveObjects (THREAD_ID tid=0) const
 Retrieve complete vector to the active all/block/boundary restricted objects for a given thread.
 
const std::map< SubdomainID, std::vector< std::shared_ptr< T > > > & getActiveBlockObjects (THREAD_ID tid=0) const
 
const std::vector< std::shared_ptr< T > > & getActiveBlockObjects (SubdomainID id, THREAD_ID tid=0) const
 
const std::map< BoundaryID, std::vector< std::shared_ptr< T > > > & getActiveBoundaryObjects (THREAD_ID tid=0) const
 
const std::vector< std::shared_ptr< T > > & getActiveBoundaryObjects (BoundaryID id, THREAD_ID tid=0) const
 
bool hasObjects (THREAD_ID tid=0) const
 Convenience functions for determining if objects exist.
 
bool hasActiveObjects (THREAD_ID tid=0) const
 
bool hasObjectsForVariable (const VariableName &var_name, THREAD_ID tid) const
 
bool hasActiveBlockObjects (THREAD_ID tid=0) const
 
bool hasActiveBlockObjects (SubdomainID id, THREAD_ID tid=0) const
 
bool hasActiveBoundaryObjects (THREAD_ID tid=0) const
 
bool hasActiveBoundaryObjects (BoundaryID id, THREAD_ID tid=0) const
 
bool hasBoundaryObjects (THREAD_ID tid=0) const
 
bool hasBoundaryObjects (BoundaryID id, THREAD_ID tid=0) const
 
bool hasActiveObject (const std::string &name, THREAD_ID tid=0) const
 Convenience functions for checking/getting specific objects.
 
std::shared_ptr< T > getObject (const std::string &name, THREAD_ID tid=0) const
 
std::shared_ptr< T > getActiveObject (const std::string &name, THREAD_ID tid=0) const
 
void updateVariableDependency (std::set< MooseVariableFieldBase * > &needed_moose_vars, THREAD_ID tid=0) const
 Update variable dependency vector.
 
void updateBlockVariableDependency (SubdomainID id, std::set< MooseVariableFieldBase * > &needed_moose_vars, THREAD_ID tid=0) const
 
void updateBoundaryVariableDependency (std::set< MooseVariableFieldBase * > &needed_moose_vars, THREAD_ID tid=0) const
 
void updateBoundaryVariableDependency (BoundaryID id, std::set< MooseVariableFieldBase * > &needed_moose_vars, THREAD_ID tid=0) const
 
void updateFEVariableCoupledVectorTagDependency (std::set< TagID > &needed_fe_var_vector_tags, THREAD_ID tid=0) const
 Update FE variable coupleable vector tag vector for all objects, block-restricted objects, and boundary-restricted objects.
 
void updateBlockFEVariableCoupledVectorTagDependency (SubdomainID id, std::set< TagID > &needed_fe_var_vector_tags, THREAD_ID tid=0) const
 
void updateBoundaryFEVariableCoupledVectorTagDependency (BoundaryID id, std::set< TagID > &needed_fe_var_vector_tags, THREAD_ID tid=0) const
 
void updateMatPropDependency (std::unordered_set< unsigned int > &needed_mat_props, THREAD_ID tid=0, const bool producer_only=false) const
 Update material property dependency vector.
 
void updateBlockMatPropDependency (SubdomainID id, std::unordered_set< unsigned int > &needed_mat_props, THREAD_ID tid=0, const bool producer_only=false) const
 
void updateBoundaryMatPropDependency (std::unordered_set< unsigned int > &needed_mat_props, THREAD_ID tid=0, const bool producer_only=false) const
 
void updateBoundaryMatPropDependency (BoundaryID id, std::unordered_set< unsigned int > &needed_mat_props, THREAD_ID tid=0, const bool producer_only=false) const
 

Protected Member Functions

virtual void updateMatPropDependencyHelper (std::unordered_set< unsigned int > &needed_mat_props, const std::vector< std::shared_ptr< MaterialBase > > &objects, const bool producer_only) const override
 Helper method for updating material property dependency vector.
 
virtual void updateMatPropDependencyHelper (std::unordered_set< unsigned int > &needed_mat_props, const std::vector< std::shared_ptr< T > > &objects, const bool producer_only) const
 Helper method for updating material property dependency vector.
 
void checkThreadID (THREAD_ID tid) const
 Calls assert on thread id.
 
bool hasBoundaryObjectsHelper (const std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< T > > > > &boundary_objects, const THREAD_ID tid=0) const
 Helper for determining whether we have boundary objects.
 

Static Protected Member Functions

static void updateActiveHelper (std::vector< std::shared_ptr< T > > &active, const std::vector< std::shared_ptr< T > > &all)
 Helper method for updating active vectors.
 
static void sortHelper (std::vector< std::shared_ptr< T > > &objects)
 Helper method for sorting vectors of objects.
 
static void updateVariableDependencyHelper (std::set< MooseVariableFieldBase * > &needed_moose_vars, const std::vector< std::shared_ptr< T > > &objects)
 Helper method for updating variable dependency vector.
 
static void updateFEVariableCoupledVectorTagDependencyHelper (std::set< TagID > &needed_fe_var_vector_tags, const std::vector< std::shared_ptr< T > > &objects)
 Helper method for updating FE variable coupleable vector tag vector.
 

Protected Attributes

MooseObjectWarehouse< MaterialBase > _neighbor_materials
 Storage for neighbor material objects (Block are stored in the base class)
 
MooseObjectWarehouse< MaterialBase > _face_materials
 Storage for face material objects (Block are stored in the base class)
 
std::map< unsigned int, MooseObjectWarehouse< MaterialBase > > _variable_objects
 Variable based storage.
 
const THREAD_ID _num_threads
 Convenience member storing the number of threads used for storage (1 or libMesh::n_threads)
 
std::vector< std::vector< std::shared_ptr< T > > > _all_objects
 Storage container for the ALL pointers (THREAD_ID on outer vector)
 
std::vector< std::vector< std::shared_ptr< T > > > _active_objects
 All active objects (THREAD_ID on outer vector)
 
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< T > > > > _all_block_objects
 
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< T > > > > _active_block_objects
 Active block restricted objects (THREAD_ID on outer vector)
 
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< T > > > > _all_boundary_objects
 
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< T > > > > _active_boundary_objects
 Active boundary restricted objects (THREAD_ID on outer vector)
 
std::vector< std::map< VariableName, std::vector< std::shared_ptr< T > > > > _all_variable_objects
 All objects with a certain variable selected, as the 'variable' parameter.
 

Detailed Description

MaterialBase objects are special in that they have additional objects created automatically (see FEProblemBase::addMaterial).

This class specializes the base class to acount for the additional Neightbor and face objects that may exist.

Definition at line 26 of file MaterialWarehouse.h.

Constructor & Destructor Documentation

◆ MaterialWarehouse()

MaterialWarehouse::MaterialWarehouse ( THREAD_ID  num_threads = libMesh::n_threads())

Definition at line 16 of file MaterialWarehouse.C.

18{
19}
A storage container for MooseObjects that inherit from SetupInterface.

Member Function Documentation

◆ activeObjectsToFormattedString()

template<typename T >
std::string MooseObjectWarehouseBase< T >::activeObjectsToFormattedString ( THREAD_ID  tid = 0,
const std::string &  prefix = "[DBG]" 
) const
inherited

Output the active content of the warehouse to a string, meant to be output to the console.

Parameters
tidthe thread id
prefixa string to prepend to the string

Definition at line 897 of file MooseObjectWarehouseBase.h.

899{
900 std::vector<std::string> output;
901 for (const auto & object : _active_objects[tid])
902 output.push_back(object->name());
903 return ConsoleUtils::formatString(MooseUtils::join(output, " "), prefix);
904}
std::vector< std::vector< std::shared_ptr< T > > > _active_objects
All active objects (THREAD_ID on outer vector)
std::string formatString(std::string message, const std::string &prefix)
Add new lines and prefixes to a string for pretty display in output NOTE: This makes a copy of the st...
std::string name(const ElemQuality q)

Referenced by NonlinearThread::printBlockExecutionInformation(), NonlinearThread::printBoundaryExecutionInformation(), ComputeNodalKernelBCJacobiansThread::printGeneralExecutionInformation(), ComputeNodalKernelBcsThread::printGeneralExecutionInformation(), ComputeNodalKernelJacobiansThread::printGeneralExecutionInformation(), and ComputeNodalKernelsThread::printGeneralExecutionInformation().

◆ addObject()

void MooseObjectWarehouse< MaterialBase >::addObject ( std::shared_ptr< MaterialBase >  object,
THREAD_ID  tid = 0,
bool  recurse = true 
)
overridevirtualinherited

Adds an object to the storage structure.

Parameters
objectA shared pointer to the object being added
tidThe thread ID (default is 0)
recurseWhether or not to build recusive warehouses (typically for Kernels)

Reimplemented from MooseObjectWarehouseBase< T >.

Definition at line 48 of file MooseObjectWarehouse.h.

101{
102 MooseObjectWarehouseBase<T>::addObject(object, tid, recurse);
103
104 if (recurse)
105 {
106 if (auto mvir = std::dynamic_pointer_cast<MooseVariableInterface<Real>>(object); mvir)
107 _variable_objects[mvir->mooseVariableBase()->number()].addObject(object, tid, false);
108 else if (auto mviv = std::dynamic_pointer_cast<MooseVariableInterface<RealVectorValue>>(object);
109 mviv)
110 _variable_objects[mviv->mooseVariableBase()->number()].addObject(object, tid, false);
111 else if (auto mvie = std::dynamic_pointer_cast<MooseVariableInterface<RealEigenVector>>(object);
112 mvie)
113 _variable_objects[mvie->mooseVariableBase()->number()].addObject(object, tid, false);
114 // Some objects, such as ScalarKernels, do not inherit from the MooseVariableInterface (which is
115 // for field variables). These objects *do* inherit from ResidualObject which has this more
116 // generic variable() API
117 else if (auto ro = std::dynamic_pointer_cast<ResidualObject>(object); ro)
118 _variable_objects[ro->variable().number()].addObject(object, tid, false);
119 }
120}
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true)
Adds an object to the storage structure.
std::map< unsigned int, MooseObjectWarehouse< MaterialBase > > _variable_objects
Variable based storage.
Interface for objects that need to get values of MooseVariables.

◆ addObjects()

void MaterialWarehouse::addObjects ( std::shared_ptr< MaterialBase >  block,
std::shared_ptr< MaterialBase >  neighbor,
std::shared_ptr< MaterialBase >  face,
THREAD_ID  tid = 0 
)

A special method unique to this class for adding Block, Neighbor, and Face material objects.

Definition at line 22 of file MaterialWarehouse.C.

26{
28 _neighbor_materials.addObject(neighbor, tid);
29 _face_materials.addObject(face, tid);
30}
MooseObjectWarehouse< MaterialBase > _neighbor_materials
Storage for neighbor material objects (Block are stored in the base class)
MooseObjectWarehouse< MaterialBase > _face_materials
Storage for face material objects (Block are stored in the base class)
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true) override
Adds an object to the storage structure.

Referenced by FEProblemBase::addMaterialHelper().

◆ checkThreadID()

template<typename T >
void MooseObjectWarehouseBase< T >::checkThreadID ( THREAD_ID  tid) const
inlineprotectedinherited

Calls assert on thread id.

Definition at line 928 of file MooseObjectWarehouseBase.h.

929{
930 mooseAssert(tid < _num_threads,
931 "Attempting to access a thread id ("
932 << tid << ") greater than the number allowed by the storage item ("
933 << _num_threads << ")");
934}
const THREAD_ID _num_threads
Convenience member storing the number of threads used for storage (1 or libMesh::n_threads)

Referenced by MooseObjectWarehouseBase< T >::addObject(), MooseObjectWarehouseBase< T >::getActiveBlockObjects(), MooseObjectWarehouseBase< T >::getActiveBlockObjects(), MooseObjectWarehouseBase< T >::getActiveBlocks(), MooseObjectWarehouseBase< T >::getActiveBoundaryObjects(), MooseObjectWarehouseBase< T >::getActiveBoundaryObjects(), MooseObjectWarehouseBase< T >::getActiveObject(), MooseObjectWarehouseBase< T >::getActiveObjects(), MooseObjectWarehouseBase< T >::getBlockObjects(), MooseObjectWarehouseBase< T >::getBlockObjects(), MooseObjectWarehouseBase< T >::getBoundaryObjects(), MooseObjectWarehouseBase< T >::getBoundaryObjects(), MooseObjectWarehouseBase< T >::getObject(), MooseObjectWarehouseBase< T >::getObjects(), MooseObjectWarehouseBase< T >::hasActiveBlockObjects(), MooseObjectWarehouseBase< T >::hasActiveBlockObjects(), MooseObjectWarehouseBase< T >::hasActiveBoundaryObjects(), MooseObjectWarehouseBase< T >::hasActiveObject(), MooseObjectWarehouseBase< T >::hasActiveObjects(), MooseObjectWarehouseBase< T >::hasBoundaryObjects(), MooseObjectWarehouseBase< T >::hasBoundaryObjectsHelper(), MooseObjectWarehouseBase< T >::hasObjects(), MooseObjectWarehouseBase< T >::hasObjectsForVariable(), MooseObjectWarehouseBase< T >::hasObjectsForVariableAndBlocks(), ConstraintWarehouse::residualEnd(), MooseObjectWarehouseBase< T >::size(), MooseObjectWarehouseBase< T >::sort(), sort(), and MooseObjectWarehouseBase< T >::updateActive().

◆ customSetup()

void MooseObjectWarehouse< MaterialBase >::customSetup ( const ExecFlagType &  exec_type,
THREAD_ID  tid = 0 
) const
virtualinherited

Definition at line 56 of file MooseObjectWarehouse.h.

176{
177 checkThreadID(tid);
178 for (const auto & object : _active_objects[tid])
179 object->customSetup(exec_type);
180}
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
virtual void customSetup(const ExecFlagType &exec_type, THREAD_ID tid=0) const

◆ getActiveBlockObjects() [1/2]

template<typename T >
const std::vector< std::shared_ptr< T > > & MooseObjectWarehouseBase< T >::getActiveBlockObjects ( SubdomainID  id,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 476 of file MooseObjectWarehouseBase.h.

477{
478 checkThreadID(tid);
479 const auto iter = _active_block_objects[tid].find(id);
480 mooseAssert(iter != _active_block_objects[tid].end(),
481 "Unable to located active block objects for the given id: " << id << ".");
482 return iter->second;
483}
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< T > > > > _active_block_objects
Active block restricted objects (THREAD_ID on outer vector)

◆ getActiveBlockObjects() [2/2]

template<typename T >
const std::map< SubdomainID, std::vector< std::shared_ptr< T > > > & MooseObjectWarehouseBase< T >::getActiveBlockObjects ( THREAD_ID  tid = 0) const
inlineinherited

Definition at line 468 of file MooseObjectWarehouseBase.h.

469{
470 checkThreadID(tid);
471 return _active_block_objects[tid];
472}

Referenced by MaterialPropertyInterface::buildRequiredMaterials(), Moose::checkArrayMaterialPropertySize(), FEProblemBase::checkProblemIntegrity(), NonlinearThread::computeOnElement(), ComputeFullJacobianThread::computeOnInternalFace(), ComputeResidualAndJacobianThread::computeOnInternalFace(), ComputeResidualThread::computeOnInternalFace(), NonlinearThread::computeOnInternalFace(), ComputeFullJacobianThread::computeOnInternalFace(), FEProblemBase::getFVMatsAndDependencies(), BlockRestrictable::hasBlockMaterialPropertyHelper(), NonlinearSystemBase::needInternalNeighborSideMaterial(), ComputeIndicatorThread::onElement(), ComputeMarkerThread::onElement(), ComputeMaterialsObjectThread::onElement(), ComputeIndicatorThread::onInternalSide(), ComputeNodalKernelJacobiansThread::onNode(), ComputeNodalKernelsThread::onNode(), ComputeFVInitialConditionThread::operator()(), ComputeInitialConditionThread::operator()(), ComputeDiracThread::printBlockExecutionInformation(), ComputeIndicatorThread::printBlockExecutionInformation(), ComputeMarkerThread::printBlockExecutionInformation(), FEProblemBase::reinitMaterials(), Moose::Mortar::setupMortarMaterials(), MooseObjectWarehouseBase< T >::updateBlockFEVariableCoupledVectorTagDependency(), MooseObjectWarehouseBase< T >::updateBlockMatPropDependency(), and MooseObjectWarehouseBase< T >::updateBlockVariableDependency().

◆ getActiveBlocks()

template<typename T >
std::set< SubdomainID > MooseObjectWarehouseBase< T >::getActiveBlocks ( THREAD_ID  tid = 0) const
inherited

Return a set of active SubdomainsIDs.

Definition at line 648 of file MooseObjectWarehouseBase.h.

649{
650 checkThreadID(tid);
651 std::set<SubdomainID> ids;
652 for (const auto & object_pair : _active_block_objects[tid])
653 ids.insert(object_pair.first);
654 return ids;
655}

Referenced by FEProblemBase::checkProblemIntegrity().

◆ getActiveBoundaryObjects() [1/2]

template<typename T >
const std::vector< std::shared_ptr< T > > & MooseObjectWarehouseBase< T >::getActiveBoundaryObjects ( BoundaryID  id,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 457 of file MooseObjectWarehouseBase.h.

458{
459 checkThreadID(tid);
460 const auto iter = _active_boundary_objects[tid].find(id);
461 mooseAssert(iter != _active_boundary_objects[tid].end(),
462 "Unable to located active boundary objects for the given id: " << id << ".");
463 return iter->second;
464}
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< T > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)

◆ getActiveBoundaryObjects() [2/2]

template<typename T >
const std::map< BoundaryID, std::vector< std::shared_ptr< T > > > & MooseObjectWarehouseBase< T >::getActiveBoundaryObjects ( THREAD_ID  tid = 0) const
inlineinherited

◆ getActiveObject()

template<typename T >
std::shared_ptr< T > MooseObjectWarehouseBase< T >::getActiveObject ( const std::string &  name,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 629 of file MooseObjectWarehouseBase.h.

630{
631 checkThreadID(tid);
632 for (const auto & object : _active_objects[tid])
633 if (object->name() == name)
634 return object;
635 mooseError("Unable to locate active object: ", name, ".");
636}
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
if(!dmm->_nl) SETERRQ(PETSC_COMM_WORLD

Referenced by DerivativeParsedMaterialHelperTempl< is_ad >::assembleDerivatives(), FEProblemBase::getConvergence(), FEProblemBase::getFunction(), FEProblemBase::getKokkosFunction(), FEProblemBase::getMaterial(), FEProblemBase::getMeshDivision(), NonlinearSystemBase::getSplit(), LibtorchControlValuePostprocessor::initialSetup(), and LibtorchArtificialNeuralNetParameters::initialSetup().

◆ getActiveObjects()

template<typename T >
const std::vector< std::shared_ptr< T > > & MooseObjectWarehouseBase< T >::getActiveObjects ( THREAD_ID  tid = 0) const
inlineinherited

Retrieve complete vector to the active all/block/boundary restricted objects for a given thread.

Parameters
tidThe thread id to retrieve objects from

Definition at line 441 of file MooseObjectWarehouseBase.h.

442{
443 checkThreadID(tid);
444 return _active_objects[tid];
445}

Referenced by FEProblemBase::backupMultiApps(), NonlinearEigenSystem::checkIntegrity(), NonlinearSystemBase::checkKernelCoverage(), FEProblemBase::checkProblemIntegrity(), NonlinearSystemBase::computeDamping(), NonlinearSystemBase::computeDiracContributions(), FEProblemBase::computeIndicators(), FEProblemBase::computeMarkers(), FEProblemBase::computeMultiAppsDT(), NonlinearSystemBase::computeResidualInternal(), NonlinearSystemBase::computeScalarKernelsJacobians(), AuxiliarySystem::computeScalarVars(), FEProblemBase::execMultiApps(), FEProblemBase::execMultiAppTransfers(), FEProblemBase::finalizeMultiApps(), FEProblemBase::finishMultiAppStep(), ConstraintWarehouse::getActiveNodalConstraints(), FEProblemBase::getConvergenceObjects(), AuxiliarySystem::getDependObjects(), AuxiliarySystem::getDependObjects(), FEProblemBase::getTransfers(), FEProblemBase::getTransfers(), FEProblemBase::incrementMultiAppTStep(), NonlinearSystemBase::needBoundaryMaterialOnSide(), ComputeDiracThread::onElement(), ComputeElemDampingThread::onElement(), ComputeNodalDampingThread::onNode(), FEProblemBase::partitionConcurrentMultiApps(), FEProblemBase::postExecute(), FEProblemBase::projectInitialConditionOnCustomRange(), FEProblemBase::projectSolution(), FEProblemBase::restoreMultiApps(), and AuxiliarySystem::setScalarVariableCoupleableTags().

◆ getActiveVariableBlockObjects()

const std::vector< std::shared_ptr< MaterialBase > > & MooseObjectWarehouse< MaterialBase >::getActiveVariableBlockObjects ( unsigned int  variable_id,
SubdomainID  block_id,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 75 of file MooseObjectWarehouse.h.

145{
146 checkThreadID(tid);
147 const auto iter = _variable_objects.find(variable_id);
148 mooseAssert(iter != _variable_objects.end(),
149 "Unable to locate variable kernels for the given variable id: " << variable_id
150 << ".");
151 return iter->second.getActiveBlockObjects(block_id, tid);
152}

◆ getBlockObjects() [1/2]

template<typename T >
const std::vector< std::shared_ptr< T > > & MooseObjectWarehouseBase< T >::getBlockObjects ( SubdomainID  id,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 430 of file MooseObjectWarehouseBase.h.

431{
432 checkThreadID(tid);
433 const auto iter = _all_block_objects[tid].find(id);
434 mooseAssert(iter != _all_block_objects[tid].end(),
435 "Unable to located active block objects for the given id: " << id << ".");
436 return iter->second;
437}
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< T > > > > _all_block_objects

◆ getBlockObjects() [2/2]

template<typename T >
const std::map< SubdomainID, std::vector< std::shared_ptr< T > > > & MooseObjectWarehouseBase< T >::getBlockObjects ( THREAD_ID  tid = 0) const
inlineinherited

Definition at line 422 of file MooseObjectWarehouseBase.h.

423{
424 checkThreadID(tid);
425 return _all_block_objects[tid];
426}

Referenced by MaterialPropertyDebugOutput::printMaterialMap().

◆ getBoundaryObjects() [1/2]

template<typename T >
const std::vector< std::shared_ptr< T > > & MooseObjectWarehouseBase< T >::getBoundaryObjects ( BoundaryID  id,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 411 of file MooseObjectWarehouseBase.h.

412{
413 checkThreadID(tid);
414 const auto iter = _all_boundary_objects[tid].find(id);
415 mooseAssert(iter != _all_boundary_objects[tid].end(),
416 "Unable to located active boundary objects for the given id: " << id << ".");
417 return iter->second;
418}
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< T > > > > _all_boundary_objects

◆ getBoundaryObjects() [2/2]

template<typename T >
const std::map< BoundaryID, std::vector< std::shared_ptr< T > > > & MooseObjectWarehouseBase< T >::getBoundaryObjects ( THREAD_ID  tid = 0) const
inlineinherited

◆ getObject()

template<typename T >
std::shared_ptr< T > MooseObjectWarehouseBase< T >::getObject ( const std::string &  name,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 618 of file MooseObjectWarehouseBase.h.

619{
620 checkThreadID(tid);
621 for (const auto & object : _all_objects[tid])
622 if (object->name() == name)
623 return object;
624 mooseError("Unable to locate object: ", name, ".");
625}
std::vector< std::vector< std::shared_ptr< T > > > _all_objects
Storage container for the ALL pointers (THREAD_ID on outer vector)

Referenced by FEProblemBase::getMultiApp().

◆ getObjects()

template<typename T >
const std::vector< std::shared_ptr< T > > & MooseObjectWarehouseBase< T >::getObjects ( THREAD_ID  tid = 0) const
inlineinherited

◆ getObjectsForVariable()

template<typename T >
const std::vector< std::shared_ptr< T > > & MooseObjectWarehouseBase< T >::getObjectsForVariable ( const VariableName &  var_name,
THREAD_ID  tid 
) const
inherited

Getter for objects that have the 'variable' set to a particular variable Note that users should check whether there are objects using 'hasObjectsForVariable' before calling this routine, because it will throw if there are no objects for this variable.

Definition at line 640 of file MooseObjectWarehouseBase.h.

642{
643 return libmesh_map_find(_all_variable_objects[tid], var_name);
644}
std::vector< std::map< VariableName, std::vector< std::shared_ptr< T > > > > _all_variable_objects
All objects with a certain variable selected, as the 'variable' parameter.

◆ hasActiveBlockObjects() [1/2]

template<typename T >
bool MooseObjectWarehouseBase< T >::hasActiveBlockObjects ( SubdomainID  id,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 562 of file MooseObjectWarehouseBase.h.

563{
564 checkThreadID(tid);
565 const auto iter = _active_block_objects[tid].find(id);
566 return iter != _active_block_objects[tid].end();
567}

◆ hasActiveBlockObjects() [2/2]

template<typename T >
bool MooseObjectWarehouseBase< T >::hasActiveBlockObjects ( THREAD_ID  tid = 0) const
inherited

Definition at line 551 of file MooseObjectWarehouseBase.h.

552{
553 checkThreadID(tid);
554 bool has_active_block_objects = false;
555 for (const auto & object_pair : _active_block_objects[tid])
556 has_active_block_objects |= !(object_pair.second.empty());
557 return has_active_block_objects;
558}

Referenced by Moose::checkArrayMaterialPropertySize(), AuxiliarySystem::computeElementalVarsHelper(), NonlinearSystemBase::computeJacobianInternal(), AuxiliarySystem::computeMortarNodalVars(), AuxiliarySystem::computeNodalVarsHelper(), NonlinearThread::computeOnElement(), ComputeFullJacobianThread::computeOnInternalFace(), ComputeJacobianThread::computeOnInternalFace(), ComputeResidualAndJacobianThread::computeOnInternalFace(), ComputeResidualThread::computeOnInternalFace(), ComputeFullJacobianThread::computeOnInternalFace(), NonlinearSystemBase::computeResidualAndJacobianInternal(), NonlinearSystemBase::computeResidualInternal(), BlockRestrictable::hasBlockMaterialPropertyHelper(), NonlinearSystemBase::needInternalNeighborSideMaterial(), ComputeIndicatorThread::onElement(), ComputeMarkerThread::onElement(), ComputeMaterialsObjectThread::onElement(), ProjectMaterialProperties::onElement(), ComputeIndicatorThread::onInternalSide(), ComputeNodalKernelJacobiansThread::onNode(), ComputeNodalKernelsThread::onNode(), ComputeFVInitialConditionThread::operator()(), ComputeInitialConditionThread::operator()(), ComputeJacobianBlocksThread::postInternalSide(), FEProblemBase::prepareMaterials(), ComputeDiracThread::printBlockExecutionInformation(), ComputeIndicatorThread::printBlockExecutionInformation(), ComputeMarkerThread::printBlockExecutionInformation(), NonlinearThread::printBlockExecutionInformation(), FEProblemBase::reinitMaterials(), MooseObjectWarehouseBase< T >::updateBlockFEVariableCoupledVectorTagDependency(), MooseObjectWarehouseBase< T >::updateBlockMatPropDependency(), and MooseObjectWarehouseBase< T >::updateBlockVariableDependency().

◆ hasActiveBoundaryObjects() [1/2]

template<typename T >
bool MooseObjectWarehouseBase< T >::hasActiveBoundaryObjects ( BoundaryID  id,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 598 of file MooseObjectWarehouseBase.h.

599{
600 checkThreadID(tid);
601 const auto iter = _active_boundary_objects[tid].find(id);
602 return iter != _active_boundary_objects[tid].end();
603}

◆ hasActiveBoundaryObjects() [2/2]

template<typename T >
bool MooseObjectWarehouseBase< T >::hasActiveBoundaryObjects ( THREAD_ID  tid = 0) const
inherited

Definition at line 591 of file MooseObjectWarehouseBase.h.

592{
594}
bool hasBoundaryObjectsHelper(const std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< T > > > > &boundary_objects, const THREAD_ID tid=0) const
Helper for determining whether we have boundary objects.

Referenced by AuxiliarySystem::computeElementalVarsHelper(), NonlinearSystemBase::computeJacobianBlocks(), NonlinearSystemBase::computeJacobianInternal(), AuxiliarySystem::computeMortarNodalVars(), NonlinearSystemBase::computeNodalBCsJacobian(), NonlinearSystemBase::computeNodalBCsResidual(), NonlinearSystemBase::computeNodalBCsResidualAndJacobian(), AuxiliarySystem::computeNodalVarsHelper(), ComputeFullJacobianThread::computeOnBoundary(), ComputeFullJacobianThread::computeOnInterface(), NonlinearSystemBase::computeResidualAndJacobianInternal(), NonlinearSystemBase::computeResidualInternal(), BoundaryRestrictable::hasBoundaryMaterialPropertyHelper(), NonlinearSystemBase::needBoundaryMaterialOnSide(), FEProblemBase::needInterfaceMaterialOnSide(), NonlinearSystemBase::needInterfaceMaterialOnSide(), ComputeMaterialsObjectThread::onBoundary(), NonlinearThread::onBoundary(), NonlinearThread::onExternalSide(), ComputeMaterialsObjectThread::onInterface(), NonlinearThread::onInterface(), ComputeBoundaryInitialConditionThread::onNode(), ComputeNodalKernelBCJacobiansThread::onNode(), ComputeNodalKernelBcsThread::onNode(), NonlinearThread::printBoundaryExecutionInformation(), ComputeNodalKernelBCJacobiansThread::printGeneralExecutionInformation(), FEProblemBase::reinitMaterialsBoundary(), FEProblemBase::reinitMaterialsInterface(), NonlinearSystemBase::setInitialSolution(), MooseObjectWarehouseBase< T >::updateBoundaryFEVariableCoupledVectorTagDependency(), MooseObjectWarehouseBase< T >::updateBoundaryMatPropDependency(), MooseObjectWarehouseBase< T >::updateBoundaryMatPropDependency(), MooseObjectWarehouseBase< T >::updateBoundaryVariableDependency(), and MooseObjectWarehouseBase< T >::updateBoundaryVariableDependency().

◆ hasActiveObject()

template<typename T >
bool MooseObjectWarehouseBase< T >::hasActiveObject ( const std::string &  name,
THREAD_ID  tid = 0 
) const
inherited

Convenience functions for checking/getting specific objects.

Definition at line 607 of file MooseObjectWarehouseBase.h.

608{
609 checkThreadID(tid);
610 for (const auto & object : _active_objects[tid])
611 if (object->name() == name)
612 return true;
613 return false;
614}

Referenced by FEProblemBase::hasConvergence(), FEProblemBase::hasFunction(), and FEProblemBase::hasMultiApp().

◆ hasActiveObjects()

template<typename T >
bool MooseObjectWarehouseBase< T >::hasActiveObjects ( THREAD_ID  tid = 0) const
inherited

Definition at line 495 of file MooseObjectWarehouseBase.h.

496{
497 checkThreadID(tid);
498 return !_active_objects[tid].empty();
499}

Referenced by NonlinearEigenSystem::checkIntegrity(), NonlinearSystemBase::checkKernelCoverage(), NonlinearSystemBase::computeDamping(), NonlinearSystemBase::computeDiracContributions(), FEProblemBase::computeIndicators(), FEProblemBase::computeMarkers(), NonlinearSystemBase::computeNodalBCsJacobian(), NonlinearSystemBase::computeNodalBCsResidual(), NonlinearSystemBase::computeNodalBCsResidualAndJacobian(), NonlinearSystemBase::computeResidualAndJacobianInternal(), NonlinearSystemBase::computeResidualInternal(), NonlinearSystemBase::computeScalarKernelsJacobians(), AuxiliarySystem::computeScalarVars(), NonlinearSystemBase::containsTimeKernel(), FEProblemBase::execMultiAppTransfers(), ConstraintWarehouse::hasActiveNodalConstraints(), FEProblemBase::hasMultiApps(), FEProblemBase::hasMultiApps(), ElementSubdomainModifierBase::modify(), NonlinearSystemBase::needBoundaryMaterialOnSide(), ComputeNodalKernelBcsThread::printGeneralExecutionInformation(), ComputeNodalKernelJacobiansThread::printGeneralExecutionInformation(), ComputeNodalKernelsThread::printGeneralExecutionInformation(), FEProblemBase::projectInitialConditionOnCustomRange(), FEProblemBase::projectSolution(), FEProblemBase::timestepSetup(), MooseObjectWarehouseBase< T >::updateFEVariableCoupledVectorTagDependency(), MooseObjectWarehouseBase< T >::updateMatPropDependency(), and MooseObjectWarehouseBase< T >::updateVariableDependency().

◆ hasActiveVariableBlockObjects()

bool MooseObjectWarehouse< MaterialBase >::hasActiveVariableBlockObjects ( unsigned int  variable_id,
SubdomainID  block_id,
THREAD_ID  tid = 0 
) const
inherited

Methods for checking/getting variable kernels for a variable and SubdomainID.

Definition at line 72 of file MooseObjectWarehouse.h.

135{
136 auto iter = _variable_objects.find(variable_id);
137 return (iter != _variable_objects.end() && iter->second.hasActiveBlockObjects(block_id, tid));
138}

◆ hasBoundaryObjects() [1/2]

template<typename T >
bool MooseObjectWarehouseBase< T >::hasBoundaryObjects ( BoundaryID  id,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 403 of file MooseObjectWarehouseBase.h.

404{
405 checkThreadID(tid);
406 return _all_boundary_objects[tid].find(id) != _all_boundary_objects[tid].end();
407}

◆ hasBoundaryObjects() [2/2]

template<typename T >
bool MooseObjectWarehouseBase< T >::hasBoundaryObjects ( THREAD_ID  tid = 0) const
inherited

Definition at line 584 of file MooseObjectWarehouseBase.h.

585{
587}

◆ hasBoundaryObjectsHelper()

template<typename T >
bool MooseObjectWarehouseBase< T >::hasBoundaryObjectsHelper ( const std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< T > > > > &  boundary_objects,
const THREAD_ID  tid = 0 
) const
protectedinherited

Helper for determining whether we have boundary objects.

Definition at line 571 of file MooseObjectWarehouseBase.h.

574{
575 checkThreadID(tid);
576 bool has_boundary_objects = false;
577 for (const auto & object_pair : boundary_objects[tid])
578 has_boundary_objects |= !(object_pair.second.empty());
579 return has_boundary_objects;
580}

Referenced by MooseObjectWarehouseBase< T >::hasActiveBoundaryObjects(), and MooseObjectWarehouseBase< T >::hasBoundaryObjects().

◆ hasObjects()

template<typename T >
bool MooseObjectWarehouseBase< T >::hasObjects ( THREAD_ID  tid = 0) const
inherited

Convenience functions for determining if objects exist.

Definition at line 487 of file MooseObjectWarehouseBase.h.

488{
489 checkThreadID(tid);
490 return !_all_objects[tid].empty();
491}

Referenced by NonlinearSystemBase::setInitialSolution().

◆ hasObjectsForVariable()

template<typename T >
bool MooseObjectWarehouseBase< T >::hasObjectsForVariable ( const VariableName &  var_name,
THREAD_ID  tid 
) const
inherited

Definition at line 503 of file MooseObjectWarehouseBase.h.

505{
506 checkThreadID(tid);
507 return _all_variable_objects[tid].count(var_name);
508}

Referenced by MooseObjectWarehouseBase< T >::hasObjectsForVariableAndBlocks().

◆ hasObjectsForVariableAndBlocks()

template<typename T >
bool MooseObjectWarehouseBase< T >::hasObjectsForVariableAndBlocks ( const VariableName &  var_name,
const std::set< SubdomainID > &  blocks,
std::set< SubdomainID > &  blocks_covered,
THREAD_ID  tid 
) const
inherited

Whether there are objects for this variable and the set of blocks passed.

Parameters
var_namename of the variable
blocksblocks to consider
blocks_coveredsubset of blocks for which there is an object

Definition at line 512 of file MooseObjectWarehouseBase.h.

516{
517 checkThreadID(tid);
518 blocks_covered.clear();
519 if (!hasObjectsForVariable(var_name, tid))
520 return false;
521
522 // Check block restriction as a whole
523 for (const auto & object : libmesh_map_find(_all_variable_objects[tid], var_name))
524 {
525 std::shared_ptr<BlockRestrictable> blk = std::dynamic_pointer_cast<BlockRestrictable>(object);
526 if (blk && blk->hasBlocks(blocks))
527 {
528 blocks_covered = blocks;
529 return true;
530 }
531 }
532 // No object has all the blocks, but one might overlap, which could be troublesome.
533 // We'll keep track of which blocks are covered in case several overlap
534 for (const auto & object : libmesh_map_find(_all_variable_objects[tid], var_name))
535 {
536 std::shared_ptr<BlockRestrictable> blk = std::dynamic_pointer_cast<BlockRestrictable>(object);
537 if (blk)
538 for (const auto & block : blocks)
539 if (blk->hasBlocks(block))
540 blocks_covered.insert(block);
541 }
542 // No overlap at all
543 if (blocks_covered.empty())
544 return false;
545
546 return (blocks == blocks_covered);
547}
char ** blocks
bool hasObjectsForVariable(const VariableName &var_name, THREAD_ID tid) const

◆ hasVariableObjects()

bool MooseObjectWarehouse< MaterialBase >::hasVariableObjects ( unsigned int  variable_id,
THREAD_ID  tid = 0 
) const
inherited

Checks for whether this warehouse has objects for a given variable.

Definition at line 66 of file MooseObjectWarehouse.h.

125{
126 auto iter = _variable_objects.find(variable_id);
127 return (iter != _variable_objects.end() && iter->second.hasObjects(tid));
128}

◆ initialSetup()

void MaterialWarehouse::initialSetup ( THREAD_ID  tid = 0) const
overridevirtual

Convenience methods for calling object setup methods that handle the extra neighbor and face objects.

Reimplemented from MooseObjectWarehouse< MaterialBase >.

Definition at line 49 of file MaterialWarehouse.C.

50{
54}
virtual void initialSetup(THREAD_ID tid=0) const
Convenience methods for calling object setup methods.

◆ jacobianSetup()

void MaterialWarehouse::jacobianSetup ( THREAD_ID  tid = 0) const
overridevirtual

◆ neighborSubdomainSetup() [1/2]

void MaterialWarehouse::neighborSubdomainSetup ( SubdomainID  id,
THREAD_ID  tid = 0 
) const
virtual

Definition at line 85 of file MaterialWarehouse.C.

86{
88}
virtual void subdomainSetup(THREAD_ID tid=0) const

◆ neighborSubdomainSetup() [2/2]

void MaterialWarehouse::neighborSubdomainSetup ( THREAD_ID  tid = 0) const
virtual

Definition at line 72 of file MaterialWarehouse.C.

Referenced by FEProblemBase::neighborSubdomainSetup().

◆ numThreads()

template<typename T >
THREAD_ID MooseObjectWarehouseBase< T >::numThreads ( ) const
inlineinherited

Return the number of threads.

Definition at line 204 of file MooseObjectWarehouseBase.h.

204{ return _num_threads; }

◆ operator[]()

const MooseObjectWarehouse< MaterialBase > & MaterialWarehouse::operator[] ( Moose::MaterialDataType  data_type) const

Definition at line 33 of file MaterialWarehouse.C.

34{
35 switch (data_type)
36 {
39
41 return _face_materials;
42
43 default:
44 return *this;
45 }
46}
@ NEIGHBOR_MATERIAL_DATA
Definition MooseTypes.h:750
@ FACE_MATERIAL_DATA
Definition MooseTypes.h:749

◆ residualSetup()

void MaterialWarehouse::residualSetup ( THREAD_ID  tid = 0) const
overridevirtual

◆ size()

template<typename T >
unsigned int MooseObjectWarehouseBase< T >::size ( THREAD_ID  tid = 0) const
inherited

Return how many kernels we store in the current warehouse.

Definition at line 305 of file MooseObjectWarehouseBase.h.

306{
307 checkThreadID(tid);
308 return _all_objects[tid].size();
309}

Referenced by NonlinearThread::printBlockExecutionInformation().

◆ sort() [1/2]

template<typename T >
void MooseObjectWarehouseBase< T >::sort ( THREAD_ID  tid = 0)
inherited

Sort the objects using the DependencyResolver.

Definition at line 688 of file MooseObjectWarehouseBase.h.

689{
690 checkThreadID(tid);
691
692 for (auto & object_pair : _all_block_objects[tid])
693 sortHelper(object_pair.second);
694
695 for (auto & object_pair : _all_boundary_objects[tid])
696 sortHelper(object_pair.second);
697
699
700 // The active lists now must be update to reflect the order changes
701 updateActive(tid);
702}
static void sortHelper(std::vector< std::shared_ptr< T > > &objects)
Helper method for sorting vectors of objects.
virtual void updateActive(THREAD_ID tid=0)
Updates the active objects storage.

Referenced by ScalarInitialConditionWarehouse::initialSetup(), FVInitialConditionWarehouse::initialSetup(), and InitialConditionWarehouse::initialSetup().

◆ sort() [2/2]

void MaterialWarehouse::sort ( THREAD_ID  tid = 0,
bool  sort_all_objects = false 
)

By default, this method only sorts block and boundary-wise object storages that are used by the MOOSE threaded element loops.

Kokkos, however, computes all elements and faces at once regardless of block and boundary and uses all-object storages. Therefore, the Kokkos material warehouse sets sort_all_objects to true to sort the all-object storages.

Definition at line 115 of file MaterialWarehouse.C.

116{
117 checkThreadID(tid);
118
119 for (auto & object_pair : _all_block_objects[tid])
120 sortHelper(object_pair.second);
121 for (auto & object_pair : _all_boundary_objects[tid])
122 sortHelper(object_pair.second);
123
124 for (auto & object_pair : _neighbor_materials._all_block_objects[tid])
125 sortHelper(object_pair.second);
126 for (auto & object_pair : _neighbor_materials._all_boundary_objects[tid])
127 sortHelper(object_pair.second);
128
129 for (auto & object_pair : _face_materials._all_block_objects[tid])
130 sortHelper(object_pair.second);
131 for (auto & object_pair : _face_materials._all_boundary_objects[tid])
132 sortHelper(object_pair.second);
133
134 if (sort_all_objects)
135 {
139 }
140
141 updateActive(tid);
142}
virtual void updateActive(THREAD_ID tid=0) override
Update the active status of Kernels.

◆ sortHelper()

template<typename T >
void MooseObjectWarehouseBase< T >::sortHelper ( std::vector< std::shared_ptr< T > > &  objects)
staticprotectedinherited

Helper method for sorting vectors of objects.

Definition at line 908 of file MooseObjectWarehouseBase.h.

909{
910 // Do nothing if the vector is empty
911 if (objects.empty())
912 return;
913
914 try
915 {
916 // Sort based on dependencies
917 DependencyResolverInterface::sort<std::shared_ptr<T>>(objects);
918 }
919 catch (CyclicDependencyException<std::shared_ptr<T>> & e)
920 {
921 DependencyResolverInterface::cyclicDependencyError<std::shared_ptr<T>>(
922 e, "Cyclic dependency detected in object ordering");
923 }
924}

Referenced by MooseObjectWarehouseBase< T >::sort(), and sort().

◆ subdomainsCovered()

template<typename T >
void MooseObjectWarehouseBase< T >::subdomainsCovered ( std::set< SubdomainID > &  subdomains_covered,
std::set< std::string > &  unique_variables,
THREAD_ID  tid = 0 
) const
inherited

Populates a set of covered subdomains and the associated variable names.

Definition at line 879 of file MooseObjectWarehouseBase.h.

882{
883 for (const auto & object : _active_objects[tid])
884 {
885 unique_variables.insert(object->variable().name());
886 const auto additional_variables_covered = object->additionalROVariables();
887 unique_variables.insert(additional_variables_covered.begin(),
888 additional_variables_covered.end());
889 }
890
891 for (const auto & object_pair : _active_block_objects[tid])
892 subdomains_covered.insert(object_pair.first);
893}

Referenced by NonlinearSystemBase::checkKernelCoverage().

◆ subdomainSetup() [1/2]

void MaterialWarehouse::subdomainSetup ( SubdomainID  id,
THREAD_ID  tid = 0 
) const
overridevirtual

◆ subdomainSetup() [2/2]

void MaterialWarehouse::subdomainSetup ( THREAD_ID  tid = 0) const
overridevirtual

◆ timestepSetup()

void MaterialWarehouse::timestepSetup ( THREAD_ID  tid = 0) const
overridevirtual

◆ updateActive()

void MaterialWarehouse::updateActive ( THREAD_ID  tid = 0)
overridevirtual

Update the active status of Kernels.

Reimplemented from MooseObjectWarehouse< MaterialBase >.

Definition at line 107 of file MaterialWarehouse.C.

108{
112}
virtual void updateActive(THREAD_ID tid=0) override
Update the active status of Kernels.

Referenced by MooseObjectWarehouseBase< T >::sort(), sort(), and FEProblemBase::updateActiveObjects().

◆ updateActiveHelper()

template<typename T >
void MooseObjectWarehouseBase< T >::updateActiveHelper ( std::vector< std::shared_ptr< T > > &  active,
const std::vector< std::shared_ptr< T > > &  all 
)
staticprotectedinherited

Helper method for updating active vectors.

Definition at line 674 of file MooseObjectWarehouseBase.h.

676{
677 // Clear the active list
678 active.clear();
679
680 std::copy_if(all.begin(),
681 all.end(),
682 std::back_inserter(active),
683 [](const std::shared_ptr<T> & object) { return object->enabled(); });
684}

Referenced by MooseObjectWarehouseBase< T >::updateActive().

◆ updateBlockFEVariableCoupledVectorTagDependency()

template<typename T >
void MooseObjectWarehouseBase< T >::updateBlockFEVariableCoupledVectorTagDependency ( SubdomainID  id,
std::set< TagID > &  needed_fe_var_vector_tags,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 777 of file MooseObjectWarehouseBase.h.

779{
780 if (hasActiveBlockObjects(id, tid))
781 updateFEVariableCoupledVectorTagDependencyHelper(needed_fe_var_vector_tags,
782 getActiveBlockObjects(id, tid));
783}
const std::map< SubdomainID, std::vector< std::shared_ptr< T > > > & getActiveBlockObjects(THREAD_ID tid=0) const
bool hasActiveBlockObjects(THREAD_ID tid=0) const
static void updateFEVariableCoupledVectorTagDependencyHelper(std::set< TagID > &needed_fe_var_vector_tags, const std::vector< std::shared_ptr< T > > &objects)
Helper method for updating FE variable coupleable vector tag vector.

Referenced by ComputeNodalKernelsThread::onNode(), ComputeIndicatorThread::subdomainChanged(), ComputeMaterialsObjectThread::subdomainChanged(), ComputeUserObjectsThread::subdomainChanged(), and NonlinearThread::subdomainChanged().

◆ updateBlockMatPropDependency()

template<typename T >
void MooseObjectWarehouseBase< T >::updateBlockMatPropDependency ( SubdomainID  id,
std::unordered_set< unsigned int > &  needed_mat_props,
THREAD_ID  tid = 0,
const bool  producer_only = false 
) const
inherited

Definition at line 824 of file MooseObjectWarehouseBase.h.

829{
830 if (hasActiveBlockObjects(id, tid))
831 updateMatPropDependencyHelper(needed_mat_props, getActiveBlockObjects(id, tid), producer_only);
832}
virtual void updateMatPropDependencyHelper(std::unordered_set< unsigned int > &needed_mat_props, const std::vector< std::shared_ptr< T > > &objects, const bool producer_only) const
Helper method for updating material property dependency vector.

Referenced by FEProblemBase::prepareMaterials(), and NonlinearThread::subdomainChanged().

◆ updateBlockVariableDependency()

template<typename T >
void MooseObjectWarehouseBase< T >::updateBlockVariableDependency ( SubdomainID  id,
std::set< MooseVariableFieldBase * > &  needed_moose_vars,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 715 of file MooseObjectWarehouseBase.h.

719{
720 if (hasActiveBlockObjects(id, tid))
721 updateVariableDependencyHelper(needed_moose_vars, getActiveBlockObjects(id, tid));
722}
static void updateVariableDependencyHelper(std::set< MooseVariableFieldBase * > &needed_moose_vars, const std::vector< std::shared_ptr< T > > &objects)
Helper method for updating variable dependency vector.

Referenced by NonlinearThread::subdomainChanged().

◆ updateBoundaryFEVariableCoupledVectorTagDependency()

template<typename T >
void MooseObjectWarehouseBase< T >::updateBoundaryFEVariableCoupledVectorTagDependency ( BoundaryID  id,
std::set< TagID > &  needed_fe_var_vector_tags,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 787 of file MooseObjectWarehouseBase.h.

789{
790 if (hasActiveBoundaryObjects(id, tid))
791 updateFEVariableCoupledVectorTagDependencyHelper(needed_fe_var_vector_tags,
792 getActiveBoundaryObjects(id, tid));
793}
const std::map< BoundaryID, std::vector< std::shared_ptr< T > > > & getActiveBoundaryObjects(THREAD_ID tid=0) const
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const

Referenced by ComputeNodalKernelBcsThread::onNode().

◆ updateBoundaryMatPropDependency() [1/2]

template<typename T >
void MooseObjectWarehouseBase< T >::updateBoundaryMatPropDependency ( BoundaryID  id,
std::unordered_set< unsigned int > &  needed_mat_props,
THREAD_ID  tid = 0,
const bool  producer_only = false 
) const
inherited

Definition at line 848 of file MooseObjectWarehouseBase.h.

853{
854 if (hasActiveBoundaryObjects(id, tid))
856 needed_mat_props, getActiveBoundaryObjects(id, tid), producer_only);
857}

◆ updateBoundaryMatPropDependency() [2/2]

template<typename T >
void MooseObjectWarehouseBase< T >::updateBoundaryMatPropDependency ( std::unordered_set< unsigned int > &  needed_mat_props,
THREAD_ID  tid = 0,
const bool  producer_only = false 
) const
inherited

Definition at line 836 of file MooseObjectWarehouseBase.h.

840{
842 for (auto & active_bnd_object : _active_boundary_objects[tid])
843 updateMatPropDependencyHelper(needed_mat_props, active_bnd_object.second, producer_only);
844}

Referenced by FEProblemBase::prepareMaterials(), and NonlinearThread::subdomainChanged().

◆ updateBoundaryVariableDependency() [1/2]

template<typename T >
void MooseObjectWarehouseBase< T >::updateBoundaryVariableDependency ( BoundaryID  id,
std::set< MooseVariableFieldBase * > &  needed_moose_vars,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 739 of file MooseObjectWarehouseBase.h.

743{
744 if (hasActiveBoundaryObjects(id, tid))
745 updateVariableDependencyHelper(needed_moose_vars, getActiveBoundaryObjects(id, tid));
746}

◆ updateBoundaryVariableDependency() [2/2]

template<typename T >
void MooseObjectWarehouseBase< T >::updateBoundaryVariableDependency ( std::set< MooseVariableFieldBase * > &  needed_moose_vars,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 726 of file MooseObjectWarehouseBase.h.

728{
730 {
731 typename std::map<BoundaryID, std::vector<std::shared_ptr<T>>>::const_iterator it;
732 for (const auto & object_pair : _active_boundary_objects[tid])
733 updateVariableDependencyHelper(needed_moose_vars, object_pair.second);
734 }
735}

Referenced by FEProblemBase::prepareMaterials(), and NonlinearThread::subdomainChanged().

◆ updateFEVariableCoupledVectorTagDependency()

template<typename T >
void MooseObjectWarehouseBase< T >::updateFEVariableCoupledVectorTagDependency ( std::set< TagID > &  needed_fe_var_vector_tags,
THREAD_ID  tid = 0 
) const
inherited

Update FE variable coupleable vector tag vector for all objects, block-restricted objects, and boundary-restricted objects.

Definition at line 767 of file MooseObjectWarehouseBase.h.

769{
770 if (hasActiveObjects(tid))
771 updateFEVariableCoupledVectorTagDependencyHelper(needed_fe_var_vector_tags,
772 _active_objects[tid]);
773}
bool hasActiveObjects(THREAD_ID tid=0) const

◆ updateFEVariableCoupledVectorTagDependencyHelper()

template<typename T >
void MooseObjectWarehouseBase< T >::updateFEVariableCoupledVectorTagDependencyHelper ( std::set< TagID > &  needed_fe_var_vector_tags,
const std::vector< std::shared_ptr< T > > &  objects 
)
staticprotectedinherited

Helper method for updating FE variable coupleable vector tag vector.

Definition at line 797 of file MooseObjectWarehouseBase.h.

799{
800 for (const auto & object : objects)
801 {
802 auto c = dynamic_cast<const Coupleable *>(object.get());
803 if (c)
804 {
805 const auto & tag_deps = c->getFEVariableCoupleableVectorTags();
806 needed_fe_var_vector_tags.insert(tag_deps.begin(), tag_deps.end());
807 }
808 }
809}
Interface for objects that needs coupling capabilities.
Definition Coupleable.h:53
std::set< TagID > & getFEVariableCoupleableVectorTags()
Definition Coupleable.h:120

Referenced by MooseObjectWarehouseBase< T >::updateBlockFEVariableCoupledVectorTagDependency(), MooseObjectWarehouseBase< T >::updateBoundaryFEVariableCoupledVectorTagDependency(), and MooseObjectWarehouseBase< T >::updateFEVariableCoupledVectorTagDependency().

◆ updateMatPropDependency()

template<typename T >
void MooseObjectWarehouseBase< T >::updateMatPropDependency ( std::unordered_set< unsigned int > &  needed_mat_props,
THREAD_ID  tid = 0,
const bool  producer_only = false 
) const
inherited

Update material property dependency vector.

Parameters
producer_onlyOnly append dependencies of materials producing the needed_mat_props

Definition at line 813 of file MooseObjectWarehouseBase.h.

817{
818 if (hasActiveObjects(tid))
819 updateMatPropDependencyHelper(needed_mat_props, _active_objects[tid], producer_only);
820}

Referenced by ComputeDiracThread::subdomainChanged(), ComputeIndicatorThread::subdomainChanged(), and ComputeMarkerThread::subdomainChanged().

◆ updateMatPropDependencyHelper() [1/2]

void MaterialWarehouse::updateMatPropDependencyHelper ( std::unordered_set< unsigned int > &  needed_mat_props,
const std::vector< std::shared_ptr< MaterialBase > > &  objects,
const bool  producer_only 
) const
overrideprotectedvirtual

Helper method for updating material property dependency vector.

Definition at line 145 of file MaterialWarehouse.C.

149{
150 if (producer_only)
151 {
152 std::unordered_set<unsigned int> consumer_needed_mat_props;
153
154 do
155 {
156 consumer_needed_mat_props = needed_mat_props;
157
158 for (auto & material : materials)
159 for (const auto prop : consumer_needed_mat_props)
160 if (material->getSuppliedPropIDs().count(prop))
161 {
162 auto & mp_deps = material->getMatPropDependencies();
163 needed_mat_props.insert(mp_deps.begin(), mp_deps.end());
164 }
165
166 } while (consumer_needed_mat_props.size() != needed_mat_props.size());
167 }
168 else
170 needed_mat_props, materials, producer_only);
171}
unsigned int count
Definition MortarUtils.C:53
for(PetscInt i=0;i< nvars;++i)

Referenced by MooseObjectWarehouseBase< T >::updateBlockMatPropDependency(), MooseObjectWarehouseBase< T >::updateBoundaryMatPropDependency(), MooseObjectWarehouseBase< T >::updateBoundaryMatPropDependency(), and MooseObjectWarehouseBase< T >::updateMatPropDependency().

◆ updateMatPropDependencyHelper() [2/2]

template<typename T >
void MooseObjectWarehouseBase< T >::updateMatPropDependencyHelper ( std::unordered_set< unsigned int > &  needed_mat_props,
const std::vector< std::shared_ptr< T > > &  objects,
const bool  producer_only 
) const
protectedvirtualinherited

Helper method for updating material property dependency vector.

Definition at line 861 of file MooseObjectWarehouseBase.h.

865{
866 for (auto & object : objects)
867 {
868 auto c = dynamic_cast<const MaterialPropertyInterface *>(object.get());
869 if (c)
870 {
871 auto & mp_deps = c->getMatPropDependencies();
872 needed_mat_props.insert(mp_deps.begin(), mp_deps.end());
873 }
874 }
875}
An interface for accessing Materials.
virtual const std::unordered_set< unsigned int > & getMatPropDependencies() const
Retrieve the set of material properties that this object depends on.

Referenced by updateMatPropDependencyHelper().

◆ updateVariableDependency()

template<typename T >
void MooseObjectWarehouseBase< T >::updateVariableDependency ( std::set< MooseVariableFieldBase * > &  needed_moose_vars,
THREAD_ID  tid = 0 
) const
inherited

◆ updateVariableDependencyHelper()

template<typename T >
void MooseObjectWarehouseBase< T >::updateVariableDependencyHelper ( std::set< MooseVariableFieldBase * > &  needed_moose_vars,
const std::vector< std::shared_ptr< T > > &  objects 
)
staticprotectedinherited

Helper method for updating variable dependency vector.

Definition at line 750 of file MooseObjectWarehouseBase.h.

753{
754 for (const auto & object : objects)
755 {
756 auto c = dynamic_cast<const MooseVariableDependencyInterface *>(object.get());
757 if (c)
758 {
759 const auto & mv_deps = c->getMooseVariableDependencies();
760 needed_moose_vars.insert(mv_deps.begin(), mv_deps.end());
761 }
762 }
763}
const std::set< MooseVariableFieldBase * > & getMooseVariableDependencies() const
Retrieve the set of MooseVariableFieldBase that this object depends on.

Referenced by MooseObjectWarehouseBase< T >::updateBlockVariableDependency(), MooseObjectWarehouseBase< T >::updateBoundaryVariableDependency(), MooseObjectWarehouseBase< T >::updateBoundaryVariableDependency(), and MooseObjectWarehouseBase< T >::updateVariableDependency().

Member Data Documentation

◆ _active_block_objects

template<typename T >
std::vector<std::map<SubdomainID, std::vector<std::shared_ptr<T> > > > MooseObjectWarehouseBase< T >::_active_block_objects
protectedinherited

◆ _active_boundary_objects

template<typename T >
std::vector<std::map<BoundaryID, std::vector<std::shared_ptr<T> > > > MooseObjectWarehouseBase< T >::_active_boundary_objects
protectedinherited

◆ _active_objects

template<typename T >
std::vector<std::vector<std::shared_ptr<T> > > MooseObjectWarehouseBase< T >::_active_objects
protectedinherited

◆ _all_block_objects

template<typename T >
std::vector<std::map<SubdomainID, std::vector<std::shared_ptr<T> > > > MooseObjectWarehouseBase< T >::_all_block_objects
protectedinherited

◆ _all_boundary_objects

template<typename T >
std::vector<std::map<BoundaryID, std::vector<std::shared_ptr<T> > > > MooseObjectWarehouseBase< T >::_all_boundary_objects
protectedinherited

◆ _all_objects

template<typename T >
std::vector<std::vector<std::shared_ptr<T> > > MooseObjectWarehouseBase< T >::_all_objects
protectedinherited

◆ _all_variable_objects

template<typename T >
std::vector<std::map<VariableName, std::vector<std::shared_ptr<T> > > > MooseObjectWarehouseBase< T >::_all_variable_objects
protectedinherited

◆ _face_materials

MooseObjectWarehouse<MaterialBase> MaterialWarehouse::_face_materials
protected

Storage for face material objects (Block are stored in the base class)

Definition at line 69 of file MaterialWarehouse.h.

Referenced by addObjects(), initialSetup(), jacobianSetup(), operator[](), residualSetup(), sort(), subdomainSetup(), subdomainSetup(), timestepSetup(), and updateActive().

◆ _neighbor_materials

MooseObjectWarehouse<MaterialBase> MaterialWarehouse::_neighbor_materials
protected

Storage for neighbor material objects (Block are stored in the base class)

Definition at line 66 of file MaterialWarehouse.h.

Referenced by addObjects(), initialSetup(), jacobianSetup(), neighborSubdomainSetup(), neighborSubdomainSetup(), operator[](), residualSetup(), sort(), timestepSetup(), and updateActive().

◆ _num_threads

template<typename T >
const THREAD_ID MooseObjectWarehouseBase< T >::_num_threads
protectedinherited

Convenience member storing the number of threads used for storage (1 or libMesh::n_threads)

Definition at line 216 of file MooseObjectWarehouseBase.h.

Referenced by MooseObjectWarehouseBase< T >::checkThreadID(), and MooseObjectWarehouseBase< T >::numThreads().

◆ _variable_objects

std::map<unsigned int, MooseObjectWarehouse<MaterialBase > > MooseObjectWarehouse< MaterialBase >::_variable_objects
protectedinherited

Variable based storage.

Definition at line 87 of file MooseObjectWarehouse.h.


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