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

A class for storing MooseObjects based on execution flag. More...

#include <ExecuteMooseObjectWarehouse.h>

Inheritance diagram for ExecuteMooseObjectWarehouse< T >:
[legend]

Public Member Functions

 ExecuteMooseObjectWarehouse (const ExecFlagEnum &flags, bool threaded=true)
 Constructor.
 
virtual ~ExecuteMooseObjectWarehouse ()
 
void addObject (std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true) override
 Adds an object to the storage structure.
 
void updateActive (THREAD_ID tid=0) override
 Updates the active objects storage.
 
void sort (THREAD_ID tid=0)
 Performs a sort using the DependencyResolver.
 
bool hasExecType (const ExecFlagType &exec_flag)
 
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< SubdomainIDgetActiveBlocks (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 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.
 
const MooseObjectWarehouse< T > & operator[] (ExecFlagType exec_flag) const
 Retrieve shared pointers for the given thread and execution type for all/active objects.
 
MooseObjectWarehouse< T > & operator[] (ExecFlagType exec_flag)
 
std::map< ExecFlagType, MooseObjectWarehouse< T > >::const_iterator begin () const
 Provide access to begin/end iterators of the underlying map of execution flags.
 
std::map< ExecFlagType, MooseObjectWarehouse< T > >::const_iterator end () const
 
void jacobianSetup (THREAD_ID tid=0) const override
 Convenience methods for calling object setup methods.
 
void residualSetup (THREAD_ID tid=0) const override
 
void setup (const ExecFlagType &exec_flag, THREAD_ID tid=0) const
 
virtual void initialSetup (THREAD_ID tid=0) const
 Convenience methods for calling object setup methods.
 
virtual void timestepSetup (THREAD_ID tid=0) const
 
virtual void customSetup (const ExecFlagType &exec_type, THREAD_ID tid=0) const
 
virtual void subdomainSetup (THREAD_ID tid=0) const
 
virtual void subdomainSetup (SubdomainID id, 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< T > > & 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

std::map< ExecFlagType, MooseObjectWarehouse< T > >::iterator getStorageHelper (std::map< ExecFlagType, MooseObjectWarehouse< T > > &objects, ExecFlagType exec_flag) const
 A helper method for extracting objects from the various storage containers.
 
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

std::map< ExecFlagType, MooseObjectWarehouse< T > > _execute_objects
 
std::map< unsigned int, MooseObjectWarehouse< T > > _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

template<typename T>
class ExecuteMooseObjectWarehouse< T >

A class for storing MooseObjects based on execution flag.

Note: The global list of objects, those accessed via the "get" methods of this class, are not sorted when the sort method is called. This is because cyclic errors occur even when the execution flags differ.

Definition at line 25 of file ExecuteMooseObjectWarehouse.h.

Constructor & Destructor Documentation

◆ ExecuteMooseObjectWarehouse()

template<typename T >
ExecuteMooseObjectWarehouse< T >::ExecuteMooseObjectWarehouse ( const ExecFlagEnum flags,
bool  threaded = true 
)

Constructor.

Parameters
threadedTrue enables threaded object storage (default).

Definition at line 105 of file ExecuteMooseObjectWarehouse.h.

107 : MooseObjectWarehouse<T>(threaded)
108{
109 // Initialize the active/all data structures with the correct map entries and empty vectors
110 for (const auto & flag : flags.items())
111 _execute_objects.insert(std::make_pair(flag, MooseObjectWarehouse<T>(threaded)));
112}
std::map< ExecFlagType, MooseObjectWarehouse< T > > _execute_objects
A storage container for MooseObjects that inherit from SetupInterface.

◆ ~ExecuteMooseObjectWarehouse()

template<typename T >
ExecuteMooseObjectWarehouse< T >::~ExecuteMooseObjectWarehouse ( )
virtual

Definition at line 115 of file ExecuteMooseObjectWarehouse.h.

116{
117}

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 898 of file MooseObjectWarehouseBase.h.

900{
901 std::vector<std::string> output;
902 for (const auto & object : _active_objects[tid])
903 output.push_back(object->name());
904 return ConsoleUtils::formatString(MooseUtils::join(output, " "), prefix);
905}
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()

template<typename T >
void ExecuteMooseObjectWarehouse< T >::addObject ( std::shared_ptr< T >  object,
THREAD_ID  tid = 0,
bool  recurse = true 
)
overridevirtual

Adds an object to the storage structure.

Parameters
objectA shared pointer to the object being added

Reimplemented from MooseObjectWarehouse< T >.

Definition at line 202 of file ExecuteMooseObjectWarehouse.h.

205{
206 // Update list of all objects
208
209 // Update the execute flag lists of objects
210 if (const auto ptr = std::dynamic_pointer_cast<SetupInterface>(object))
211 for (const auto & flag : ptr->getExecuteOnEnum())
212 _execute_objects[flag].addObject(object, tid);
213 else
214 mooseError("The object being added (",
215 object->name(),
216 ") must inherit from SetupInterface to be added to the ExecuteMooseObjectWarehouse "
217 "container.");
218}
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
Definition MooseError.h:311
void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true) override
Adds an object to the storage structure.
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::addMultiApp(), AuxiliarySystem::addScalarKernel(), and FEProblemBase::addTransfer().

◆ begin()

template<typename T >
std::map< ExecFlagType, MooseObjectWarehouse< T > >::const_iterator ExecuteMooseObjectWarehouse< T >::begin ( ) const
inline

Provide access to begin/end iterators of the underlying map of execution flags.

Definition at line 60 of file ExecuteMooseObjectWarehouse.h.

61 {
62 return _execute_objects.begin();
63 }

◆ checkThreadID()

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

Calls assert on thread id.

Definition at line 929 of file MooseObjectWarehouseBase.h.

930{
931 mooseAssert(tid < _num_threads,
932 "Attempting to access a thread id ("
933 << tid << ") greater than the number allowed by the storage item ("
934 << _num_threads << ")");
935}
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(), MaterialWarehouse::sort(), and MooseObjectWarehouseBase< T >::updateActive().

◆ customSetup()

template<typename T >
void MooseObjectWarehouse< T >::customSetup ( const ExecFlagType exec_type,
THREAD_ID  tid = 0 
) const
virtualinherited

Definition at line 176 of file MooseObjectWarehouse.h.

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

Referenced by FEProblemBase::customSetup(), AuxiliarySystem::customSetup(), and NonlinearSystemBase::customSetup().

◆ end()

template<typename T >
std::map< ExecFlagType, MooseObjectWarehouse< T > >::const_iterator ExecuteMooseObjectWarehouse< T >::end ( ) const
inline

Definition at line 64 of file ExecuteMooseObjectWarehouse.h.

65 {
66 return _execute_objects.end();
67 }

◆ 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 477 of file MooseObjectWarehouseBase.h.

478{
479 checkThreadID(tid);
480 const auto iter = _active_block_objects[tid].find(id);
481 mooseAssert(iter != _active_block_objects[tid].end(),
482 "Unable to located active block objects for the given id: " << id << ".");
483 return iter->second;
484}
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

◆ 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 649 of file MooseObjectWarehouseBase.h.

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

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 458 of file MooseObjectWarehouseBase.h.

459{
460 checkThreadID(tid);
461 const auto iter = _active_boundary_objects[tid].find(id);
462 mooseAssert(iter != _active_boundary_objects[tid].end(),
463 "Unable to located active boundary objects for the given id: " << id << ".");
464 return iter->second;
465}
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

◆ 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 442 of file MooseObjectWarehouseBase.h.

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

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::execTransfers(), 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::postExecute(), FEProblemBase::projectInitialConditionOnCustomRange(), FEProblemBase::projectSolution(), FEProblemBase::restoreMultiApps(), and AuxiliarySystem::setScalarVariableCoupleableTags().

◆ getActiveVariableBlockObjects()

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

Definition at line 143 of file MooseObjectWarehouse.h.

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

Referenced by ComputeFullJacobianThread::computeOnElement().

◆ 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 431 of file MooseObjectWarehouseBase.h.

432{
433 checkThreadID(tid);
434 const auto iter = _all_block_objects[tid].find(id);
435 mooseAssert(iter != _all_block_objects[tid].end(),
436 "Unable to located active block objects for the given id: " << id << ".");
437 return iter->second;
438}
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 423 of file MooseObjectWarehouseBase.h.

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

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 412 of file MooseObjectWarehouseBase.h.

413{
414 checkThreadID(tid);
415 const auto iter = _all_boundary_objects[tid].find(id);
416 mooseAssert(iter != _all_boundary_objects[tid].end(),
417 "Unable to located active boundary objects for the given id: " << id << ".");
418 return iter->second;
419}
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 619 of file MooseObjectWarehouseBase.h.

620{
621 checkThreadID(tid);
622 for (const auto & object : _all_objects[tid])
623 if (object->name() == name)
624 return object;
625 mooseError("Unable to locate object: ", name, ".");
626}
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 641 of file MooseObjectWarehouseBase.h.

643{
644 return libmesh_map_find(_all_variable_objects[tid], var_name);
645}
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.

◆ getStorageHelper()

template<typename T >
std::map< ExecFlagType, MooseObjectWarehouse< T > >::iterator ExecuteMooseObjectWarehouse< T >::getStorageHelper ( std::map< ExecFlagType, MooseObjectWarehouse< T > > &  objects,
ExecFlagType  exec_flag 
) const
protected

A helper method for extracting objects from the various storage containers.

◆ hasActiveBlockObjects() [1/2]

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

Definition at line 563 of file MooseObjectWarehouseBase.h.

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

◆ hasActiveBlockObjects() [2/2]

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

Definition at line 552 of file MooseObjectWarehouseBase.h.

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

Referenced by AuxiliarySystem::computeElementalVarsHelper(), NonlinearSystemBase::computeJacobianInternal(), AuxiliarySystem::computeMortarNodalVars(), AuxiliarySystem::computeNodalVarsHelper(), NonlinearThread::computeOnElement(), ComputeFullJacobianThread::computeOnInternalFace(), ComputeJacobianThread::computeOnInternalFace(), ComputeResidualAndJacobianThread::computeOnInternalFace(), ComputeResidualThread::computeOnInternalFace(), ComputeFullJacobianThread::computeOnInternalFace(), 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 599 of file MooseObjectWarehouseBase.h.

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

◆ hasActiveBoundaryObjects() [2/2]

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

Definition at line 592 of file MooseObjectWarehouseBase.h.

593{
595}
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::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 608 of file MooseObjectWarehouseBase.h.

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

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

◆ hasActiveObjects()

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

◆ hasActiveVariableBlockObjects()

template<typename T >
bool MooseObjectWarehouse< T >::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 133 of file MooseObjectWarehouse.h.

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

Referenced by ComputeFullJacobianThread::computeOnElement().

◆ hasBoundaryObjects() [1/2]

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

Definition at line 404 of file MooseObjectWarehouseBase.h.

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

◆ hasBoundaryObjects() [2/2]

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

Definition at line 585 of file MooseObjectWarehouseBase.h.

586{
588}

◆ 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 572 of file MooseObjectWarehouseBase.h.

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

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

◆ hasExecType()

template<typename T >
bool ExecuteMooseObjectWarehouse< T >::hasExecType ( const ExecFlagType exec_flag)
inline

Definition at line 92 of file ExecuteMooseObjectWarehouse.h.

92{ return _execute_objects.count(exec_flag) > 0; }

◆ hasObjects()

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

Convenience functions for determining if objects exist.

Definition at line 488 of file MooseObjectWarehouseBase.h.

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

Referenced by NonlinearSystemBase::setInitialSolution().

◆ hasObjectsForVariable()

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

Definition at line 504 of file MooseObjectWarehouseBase.h.

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

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 513 of file MooseObjectWarehouseBase.h.

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

◆ hasVariableObjects()

template<typename T >
bool MooseObjectWarehouse< T >::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 125 of file MooseObjectWarehouse.h.

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

Referenced by ExplicitTimeIntegrator::initialSetup().

◆ initialSetup()

template<typename T >
void MooseObjectWarehouse< T >::initialSetup ( THREAD_ID  tid = 0) const
virtualinherited

Convenience methods for calling object setup methods.

Reimplemented in MaterialWarehouse.

Definition at line 157 of file MooseObjectWarehouse.h.

158{
159 checkThreadID(tid);
160 // Initial Setup should be called on all objects because they may become active later
161 for (const auto & object : _all_objects[tid])
162 object->initialSetup();
163}
virtual void initialSetup(THREAD_ID tid=0) const
Convenience methods for calling object setup methods.

Referenced by AuxiliarySystem::AuxiliarySystem(), DumpObjectsProblem::initialSetup(), NonlinearSystemBase::initialSetup(), and MaterialWarehouse::initialSetup().

◆ jacobianSetup()

template<typename T >
void ExecuteMooseObjectWarehouse< T >::jacobianSetup ( THREAD_ID  tid = 0) const
overridevirtual

Convenience methods for calling object setup methods.

Limits call to these methods only to objects being executed on linear/nonlinear iterations.

Reimplemented from MooseObjectWarehouse< T >.

Definition at line 165 of file ExecuteMooseObjectWarehouse.h.

166{
167 checkThreadID(tid);
168 const auto iter = _execute_objects.find(EXEC_NONLINEAR);
169 if (iter != _execute_objects.end())
170 iter->second.jacobianSetup(tid);
171}
const ExecFlagType EXEC_NONLINEAR
Definition Moose.C:33

Referenced by AuxiliarySystem::jacobianSetup().

◆ numThreads()

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

Return the number of threads.

Definition at line 205 of file MooseObjectWarehouseBase.h.

205{ return _num_threads; }

◆ operator[]() [1/2]

template<typename T >
MooseObjectWarehouse< T > & ExecuteMooseObjectWarehouse< T >::operator[] ( ExecFlagType  exec_flag)

Definition at line 137 of file ExecuteMooseObjectWarehouse.h.

138{
139 // Use find to avoid accidental insertion
140 const auto iter = _execute_objects.find(exec_flag);
141
142 if (iter == _execute_objects.end())
143 mooseError("Unable to locate the desired execute flag (",
144 exec_flag,
145 "), the supplied execution flag was likely "
146 "not registered.");
147
148 return iter->second;
149}

◆ operator[]() [2/2]

template<typename T >
const MooseObjectWarehouse< T > & ExecuteMooseObjectWarehouse< T >::operator[] ( ExecFlagType  exec_flag) const

Retrieve shared pointers for the given thread and execution type for all/active objects.

Parameters
exec_flagThe execution flag to retrieve objects from

Definition at line 121 of file ExecuteMooseObjectWarehouse.h.

122{
123 // Use find to avoid accidental insertion
124 const auto iter = _execute_objects.find(exec_flag);
125
126 if (iter == _execute_objects.end())
127 mooseError("Unable to locate the desired execute flag (",
128 exec_flag,
129 "), the supplied execution flag was likely "
130 "not registered.");
131
132 return iter->second;
133}

◆ residualSetup()

template<typename T >
void ExecuteMooseObjectWarehouse< T >::residualSetup ( THREAD_ID  tid = 0) const
overridevirtual

Reimplemented from MooseObjectWarehouse< T >.

Definition at line 175 of file ExecuteMooseObjectWarehouse.h.

176{
177 checkThreadID(tid);
178 const auto iter = _execute_objects.find(EXEC_LINEAR);
179 if (iter != _execute_objects.end())
180 iter->second.residualSetup(tid);
181}
const ExecFlagType EXEC_LINEAR
Definition Moose.C:31

Referenced by AuxiliarySystem::residualSetup().

◆ setup()

template<typename T >
void ExecuteMooseObjectWarehouse< T >::setup ( const ExecFlagType exec_flag,
THREAD_ID  tid = 0 
) const

Definition at line 185 of file ExecuteMooseObjectWarehouse.h.

186{
187 checkThreadID(tid);
188 if (exec_flag == EXEC_INITIAL)
189 initialSetup(tid);
190 else if (exec_flag == EXEC_TIMESTEP_BEGIN)
191 timestepSetup(tid);
192 else if (exec_flag == EXEC_SUBDOMAIN)
193 subdomainSetup(tid);
194 else if (exec_flag == EXEC_NONLINEAR)
195 jacobianSetup(tid);
196 else if (exec_flag == EXEC_LINEAR)
197 residualSetup(tid);
198}
const ExecFlagType EXEC_SUBDOMAIN
Definition Moose.C:52
const ExecFlagType EXEC_TIMESTEP_BEGIN
Definition Moose.C:37
const ExecFlagType EXEC_INITIAL
Definition Moose.C:30
void jacobianSetup(THREAD_ID tid=0) const override
Convenience methods for calling object setup methods.
void residualSetup(THREAD_ID tid=0) const override
virtual void timestepSetup(THREAD_ID tid=0) const
virtual void subdomainSetup(THREAD_ID tid=0) const

Referenced by FEProblemBase::executeControls().

◆ 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 306 of file MooseObjectWarehouseBase.h.

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

Referenced by NonlinearThread::printBlockExecutionInformation().

◆ sort()

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

Performs a sort using the DependencyResolver.

Parameters
tidThe thread id to access.

Definition at line 222 of file ExecuteMooseObjectWarehouse.h.

223{
224 // Sort execute object storage
225 for (auto & object_pair : _execute_objects)
226 object_pair.second.sort(tid);
227}
void sort(THREAD_ID tid=0)
Performs a sort using the DependencyResolver.

Referenced by AuxiliarySystem::AuxiliarySystem().

◆ 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 909 of file MooseObjectWarehouseBase.h.

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

Referenced by MooseObjectWarehouseBase< T >::sort(), and MaterialWarehouse::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 880 of file MooseObjectWarehouseBase.h.

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

Referenced by NonlinearSystemBase::checkKernelCoverage().

◆ subdomainSetup() [1/2]

template<typename T >
void MooseObjectWarehouse< T >::subdomainSetup ( SubdomainID  id,
THREAD_ID  tid = 0 
) const
virtualinherited

Reimplemented in MaterialWarehouse.

Definition at line 185 of file MooseObjectWarehouse.h.

186{
187 checkThreadID(tid);
188 if (hasActiveBlockObjects(id, tid))
189 {
190 const auto & objects = getActiveBlockObjects(id, tid);
191 for (const auto & object : objects)
192 object->subdomainSetup();
193 }
194}
const std::map< SubdomainID, std::vector< std::shared_ptr< T > > > & getActiveBlockObjects(THREAD_ID tid=0) const
bool hasActiveBlockObjects(THREAD_ID tid=0) const

◆ subdomainSetup() [2/2]

template<typename T >
void MooseObjectWarehouse< T >::subdomainSetup ( THREAD_ID  tid = 0) const
virtualinherited

◆ timestepSetup()

template<typename T >
void MooseObjectWarehouse< T >::timestepSetup ( THREAD_ID  tid = 0) const
virtualinherited

Reimplemented in MaterialWarehouse.

Definition at line 167 of file MooseObjectWarehouse.h.

168{
169 checkThreadID(tid);
170 for (const auto & object : _active_objects[tid])
171 object->timestepSetup();
172}

Referenced by FEProblemBase::timestepSetup(), AuxiliarySystem::timestepSetup(), NonlinearSystemBase::timestepSetup(), and MaterialWarehouse::timestepSetup().

◆ updateActive()

template<typename T >
void ExecuteMooseObjectWarehouse< T >::updateActive ( THREAD_ID  tid = 0)
overridevirtual

Updates the active objects storage.

Reimplemented from MooseObjectWarehouse< T >.

Definition at line 153 of file ExecuteMooseObjectWarehouse.h.

154{
155 // Update all objects active list
157
158 // Update the execute flag lists of objects
159 for (auto & object_pair : _execute_objects)
160 object_pair.second.updateActive(tid);
161}
void updateActive(THREAD_ID tid=0) override
Updates the active objects storage.
virtual void updateActive(THREAD_ID tid=0) override
Update the active status of Kernels.

Referenced by AuxiliarySystem::updateActive(), 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 675 of file MooseObjectWarehouseBase.h.

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

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 778 of file MooseObjectWarehouseBase.h.

780{
781 if (hasActiveBlockObjects(id, tid))
782 updateFEVariableCoupledVectorTagDependencyHelper(needed_fe_var_vector_tags,
783 getActiveBlockObjects(id, tid));
784}
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(), and ComputeUserObjectsThread::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 825 of file MooseObjectWarehouseBase.h.

830{
831 if (hasActiveBlockObjects(id, tid))
832 updateMatPropDependencyHelper(needed_mat_props, getActiveBlockObjects(id, tid), producer_only);
833}
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().

◆ 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 716 of file MooseObjectWarehouseBase.h.

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

◆ 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 788 of file MooseObjectWarehouseBase.h.

790{
791 if (hasActiveBoundaryObjects(id, tid))
792 updateFEVariableCoupledVectorTagDependencyHelper(needed_fe_var_vector_tags,
793 getActiveBoundaryObjects(id, tid));
794}
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 849 of file MooseObjectWarehouseBase.h.

854{
855 if (hasActiveBoundaryObjects(id, tid))
857 needed_mat_props, getActiveBoundaryObjects(id, tid), producer_only);
858}

◆ 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 837 of file MooseObjectWarehouseBase.h.

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

Referenced by FEProblemBase::prepareMaterials().

◆ 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 740 of file MooseObjectWarehouseBase.h.

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

◆ 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 727 of file MooseObjectWarehouseBase.h.

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

Referenced by FEProblemBase::prepareMaterials().

◆ 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 768 of file MooseObjectWarehouseBase.h.

770{
771 if (hasActiveObjects(tid))
772 updateFEVariableCoupledVectorTagDependencyHelper(needed_fe_var_vector_tags,
773 _active_objects[tid]);
774}
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 798 of file MooseObjectWarehouseBase.h.

800{
801 for (const auto & object : objects)
802 {
803 auto c = dynamic_cast<const Coupleable *>(object.get());
804 if (c)
805 {
806 const auto & tag_deps = c->getFEVariableCoupleableVectorTags();
807 needed_fe_var_vector_tags.insert(tag_deps.begin(), tag_deps.end());
808 }
809 }
810}
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 814 of file MooseObjectWarehouseBase.h.

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

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

◆ updateMatPropDependencyHelper()

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 862 of file MooseObjectWarehouseBase.h.

866{
867 for (auto & object : objects)
868 {
869 auto c = dynamic_cast<const MaterialPropertyInterface *>(object.get());
870 if (c)
871 {
872 auto & mp_deps = c->getMatPropDependencies();
873 needed_mat_props.insert(mp_deps.begin(), mp_deps.end());
874 }
875 }
876}
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 MaterialWarehouse::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 751 of file MooseObjectWarehouseBase.h.

754{
755 for (const auto & object : objects)
756 {
757 auto c = dynamic_cast<const MooseVariableDependencyInterface *>(object.get());
758 if (c)
759 {
760 const auto & mv_deps = c->getMooseVariableDependencies();
761 needed_moose_vars.insert(mv_deps.begin(), mv_deps.end());
762 }
763 }
764}
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

◆ _execute_objects

template<typename T >
std::map<ExecFlagType, MooseObjectWarehouse<T> > ExecuteMooseObjectWarehouse< T >::_execute_objects
protected

◆ _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 217 of file MooseObjectWarehouseBase.h.

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

◆ _variable_objects

template<typename T >
std::map<unsigned int, MooseObjectWarehouse<T> > MooseObjectWarehouse< T >::_variable_objects
protectedinherited

Variable based storage.

Definition at line 88 of file MooseObjectWarehouse.h.


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