www.mooseframework.org
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. More...
 
virtual ~ExecuteMooseObjectWarehouse ()
 
virtual void addObject (std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true)
 Adds an object to the storage structure. More...
 
void addObjectMask (std::shared_ptr< T > object, THREAD_ID tid=0, std::uint16_t flag_mask=std::numeric_limits< std::uint16_t >::max())
 
virtual void updateActive (THREAD_ID tid=0)
 Updates the active objects storage. More...
 
void sort (THREAD_ID tid=0)
 Performs a sort using the DependencyResolver. More...
 
unsigned int size (THREAD_ID tid=0)
 Return how many kernels we store in the current warehouse. More...
 
std::set< SubdomainIDgetActiveBlocks (THREAD_ID tid=0) const
 Return a set of active SubdomainsIDs. More...
 
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. More...
 
THREAD_ID numThreads ()
 Return the number of threads. More...
 
const MooseObjectWarehouse< T > & operator[] (ExecFlagType exec_flag) const
 Retrieve shared pointers for the given thread and execution type for all/active objects. More...
 
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. More...
 
std::map< ExecFlagType, MooseObjectWarehouse< T > >::const_iterator end () const
 
void jacobianSetup (THREAD_ID tid=0) const
 Convenience methods for calling object setup methods. More...
 
void residualSetup (THREAD_ID tid=0) const
 
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. More...
 
virtual void timestepSetup (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. More...
 
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. More...
 
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. More...
 
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. More...
 
bool hasActiveObjects (THREAD_ID tid=0) 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 hasActiveObject (const std::string &name, THREAD_ID tid=0) const
 Convenience functions for checking/getting specific objects. More...
 
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< MooseVariableFEBase *> &needed_moose_vars, THREAD_ID tid=0) const
 Update variable dependency vector. More...
 
void updateBlockVariableDependency (SubdomainID id, std::set< MooseVariableFEBase *> &needed_moose_vars, THREAD_ID tid=0) const
 
void updateBoundaryVariableDependency (std::set< MooseVariableFEBase *> &needed_moose_vars, THREAD_ID tid=0) const
 
void updateBoundaryVariableDependency (BoundaryID id, std::set< MooseVariableFEBase *> &needed_moose_vars, THREAD_ID tid=0) const
 
void updateMatPropDependency (std::set< unsigned int > &needed_mat_props, THREAD_ID tid=0) const
 Update material property dependency vector. More...
 
void updateBlockMatPropDependency (SubdomainID id, std::set< unsigned int > &needed_mat_props, THREAD_ID tid=0) const
 
void updateBoundaryMatPropDependency (std::set< unsigned int > &needed_mat_props, THREAD_ID tid=0) const
 
void updateBoundaryMatPropDependency (BoundaryID id, std::set< unsigned int > &needed_mat_props, THREAD_ID tid=0) 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. More...
 
void checkThreadID (THREAD_ID tid) const
 Calls assert on thread id. More...
 

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. More...
 
static void sortHelper (std::vector< std::shared_ptr< T >> &objects)
 Helper method for sorting vectors of objects. More...
 
static void updateVariableDependencyHelper (std::set< MooseVariableFEBase *> &needed_moose_vars, const std::vector< std::shared_ptr< T >> &objects)
 Helper method for updating variable dependency vector. More...
 
static void updateMatPropDependencyHelper (std::set< unsigned int > &needed_mat_props, const std::vector< std::shared_ptr< T >> &objects)
 Helper method for updating material property dependency vector. More...
 

Protected Attributes

std::map< ExecFlagType, MooseObjectWarehouse< T > > _execute_objects
 
std::map< unsigned int, MooseObjectWarehouse< T > > _variable_objects
 Variable based storage. More...
 
const THREAD_ID _num_threads
 Convenience member storing the number of threads used for storage (1 or libMesh::n_threads) More...
 
std::vector< std::vector< std::shared_ptr< T > > > _all_objects
 Storage container for the ALL pointers (THREAD_ID on outer vector) More...
 
std::vector< std::vector< std::shared_ptr< T > > > _active_objects
 All active objects (THREAD_ID on outer vector) More...
 
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) More...
 
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) More...
 

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 26 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 107 of file ExecuteMooseObjectWarehouse.h.

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

◆ ~ExecuteMooseObjectWarehouse()

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

Definition at line 117 of file ExecuteMooseObjectWarehouse.h.

118 {
119 }

Member Function Documentation

◆ addObject()

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

Adds an object to the storage structure.

Parameters
objectA shared pointer to the object being added

Reimplemented from MooseObjectWarehouse< T >.

Definition at line 203 of file ExecuteMooseObjectWarehouse.h.

Referenced by FEProblemBase::addMultiApp(), FEProblemBase::addSampler(), AuxiliarySystem::addScalarKernel(), FEProblemBase::addTransfer(), and FEProblemBase::addUserObject().

206 {
207  addObjectMask(object, tid, 0xFFFF);
208 }
void addObjectMask(std::shared_ptr< T > object, THREAD_ID tid=0, std::uint16_t flag_mask=std::numeric_limits< std::uint16_t >::max())

◆ addObjectMask()

template<typename T>
void ExecuteMooseObjectWarehouse< T >::addObjectMask ( std::shared_ptr< T >  object,
THREAD_ID  tid = 0,
std::uint16_t  flag_mask = std::numeric_limits<std::uint16_t>::max() 
)

Definition at line 212 of file ExecuteMooseObjectWarehouse.h.

215 {
216  // Update list of all objects
218 
219  // Update the execute flag lists of objects
220  std::shared_ptr<SetupInterface> ptr = std::dynamic_pointer_cast<SetupInterface>(object);
221  if (ptr)
222  {
223  MooseEnumIterator iter = ptr->getExecuteOnEnum().begin();
224  for (; iter != ptr->getExecuteOnEnum().end(); ++iter)
225  {
226 
227  auto masked_flag = static_cast<std::uint16_t>(iter->id()) & flag_mask;
228  if (masked_flag != 0)
229  _execute_objects[*iter].addObject(object, tid);
230  }
231  }
232  else
233  mooseError("The object being added (",
234  object->name(),
235  ") must inherit from SetupInterface to be added to the ExecuteMooseObjectWarehouse "
236  "container.");
237 }
MooseEnumIterator begin() const
Returns a begin/end iterator to all of the items in the enum.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
std::unique_ptr< T_DEST, T_DELETER > dynamic_pointer_cast(std::unique_ptr< T_SRC, T_DELETER > &src)
std::map< ExecFlagType, MooseObjectWarehouse< T > > _execute_objects
const ExecFlagEnum & getExecuteOnEnum() const
Return the execute on MultiMooseEnum for this object.
std::vector< MooseEnumItem >::const_iterator MooseEnumIterator
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true) override
Adds an object to the storage structure.

◆ 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 64 of file ExecuteMooseObjectWarehouse.h.

65  {
66  return _execute_objects.begin();
67  }
std::map< ExecFlagType, MooseObjectWarehouse< T > > _execute_objects

◆ checkThreadID()

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

Calls assert on thread id.

Definition at line 694 of file MooseObjectWarehouseBase.h.

695 {
696  mooseAssert(tid < _num_threads,
697  "Attempting to access a thread id ("
698  << tid << ") greater than the number allowed by the storage item ("
699  << _num_threads << ")");
700 }
const THREAD_ID _num_threads
Convenience member storing the number of threads used for storage (1 or libMesh::n_threads) ...

◆ end()

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

Definition at line 68 of file ExecuteMooseObjectWarehouse.h.

69  {
70  return _execute_objects.end();
71  }
std::map< ExecFlagType, MooseObjectWarehouse< T > > _execute_objects

◆ getActiveBlockObjects() [1/2]

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

◆ getActiveBlockObjects() [2/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 396 of file MooseObjectWarehouseBase.h.

397 {
398  checkThreadID(tid);
399  const auto iter = _active_block_objects[tid].find(id);
400  mooseAssert(iter != _active_block_objects[tid].end(),
401  "Unable to located active block objects for the given id: " << id << ".");
402  return iter->second;
403 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< T > > > > _active_block_objects
Active block restricted objects (THREAD_ID on outer vector)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

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

Referenced by FEProblemBase::checkProblemIntegrity().

497 {
498  checkThreadID(tid);
499  std::set<SubdomainID> ids;
500  for (const auto & object_pair : _active_block_objects[tid])
501  ids.insert(object_pair.first);
502  return ids;
503 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< T > > > > _active_block_objects
Active block restricted objects (THREAD_ID on outer vector)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ getActiveBoundaryObjects() [1/2]

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

◆ getActiveBoundaryObjects() [2/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 377 of file MooseObjectWarehouseBase.h.

378 {
379  checkThreadID(tid);
380  const auto iter = _active_boundary_objects[tid].find(id);
381  mooseAssert(iter != _active_boundary_objects[tid].end(),
382  "Unable to located active boundary objects for the given id: " << id << ".");
383  return iter->second;
384 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< T > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)

◆ getActiveObject()

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

Definition at line 485 of file MooseObjectWarehouseBase.h.

Referenced by DerivativeParsedMaterialHelper::assembleDerivatives(), FEProblemBase::getDistribution(), FEProblemBase::getFunction(), FEProblemBase::getMaterial(), FEProblemBase::getSampler(), and NonlinearSystemBase::getSplit().

486 {
487  checkThreadID(tid);
488  for (const auto & object : _active_objects[tid])
489  if (object->name() == name)
490  return object;
491  mooseError("Unable to locate active object: ", name, ".");
492 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::vector< std::shared_ptr< T > > > _active_objects
All active objects (THREAD_ID on outer vector)

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

Referenced by FEProblemBase::backupMultiApps(), NonlinearEigenSystem::checkIntegrity(), 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::executeSamplers(), FEProblemBase::finalizeMultiApps(), FEProblemBase::finishMultiAppStep(), ConstraintWarehouse::getActiveNodalConstraints(), MooseObjectTagWarehouse< InterfaceKernel >::getMatrixTagObjectWarehouse(), MooseObjectTagWarehouse< InterfaceKernel >::getMatrixTagsObjectWarehouse(), FEProblemBase::getTransfers(), MooseObjectTagWarehouse< InterfaceKernel >::getVectorTagObjectWarehouse(), MooseObjectTagWarehouse< InterfaceKernel >::getVectorTagsObjectWarehouse(), FEProblemBase::incrementMultiAppTStep(), ComputeElemDampingThread::onElement(), ComputeDiracThread::onElement(), ComputeNodalDampingThread::onNode(), FEProblemBase::postExecute(), FEProblemBase::projectSolution(), FEProblemBase::restoreMultiApps(), and AuxiliarySystem::setScalarVariableCoupleableTags().

362 {
363  checkThreadID(tid);
364  return _active_objects[tid];
365 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::vector< std::shared_ptr< T > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ 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 129 of file MooseObjectWarehouse.h.

Referenced by ComputeFullJacobianThread::computeJacobian().

132 {
133  checkThreadID(tid);
134  const auto iter = _variable_objects.find(variable_id);
135  mooseAssert(iter != _variable_objects.end(),
136  "Unable to locate variable kernels for the given variable id: " << variable_id
137  << ".");
138  return iter->second.getActiveBlockObjects(block_id, tid);
139 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::map< unsigned int, MooseObjectWarehouse< T > > _variable_objects
Variable based storage.

◆ getBlockObjects() [1/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 342 of file MooseObjectWarehouseBase.h.

Referenced by MaterialPropertyDebugOutput::printMaterialMap().

343 {
344  checkThreadID(tid);
345  return _all_block_objects[tid];
346 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< T > > > > _all_block_objects
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ getBlockObjects() [2/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 350 of file MooseObjectWarehouseBase.h.

351 {
352  checkThreadID(tid);
353  const auto iter = _all_block_objects[tid].find(id);
354  mooseAssert(iter != _all_block_objects[tid].end(),
355  "Unable to located active block objects for the given id: " << id << ".");
356  return iter->second;
357 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< T > > > > _all_block_objects
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ getBoundaryObjects() [1/2]

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

Definition at line 323 of file MooseObjectWarehouseBase.h.

Referenced by ComputeFullJacobianThread::computeFaceJacobian(), and MaterialPropertyDebugOutput::printMaterialMap().

324 {
325  checkThreadID(tid);
326  return _all_boundary_objects[tid];
327 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< T > > > > _all_boundary_objects

◆ getBoundaryObjects() [2/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 331 of file MooseObjectWarehouseBase.h.

332 {
333  checkThreadID(tid);
334  const auto iter = _all_boundary_objects[tid].find(id);
335  mooseAssert(iter != _all_boundary_objects[tid].end(),
336  "Unable to located active boundary objects for the given id: " << id << ".");
337  return iter->second;
338 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< T > > > > _all_boundary_objects

◆ getObject()

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

Definition at line 474 of file MooseObjectWarehouseBase.h.

Referenced by FEProblemBase::getMultiApp().

475 {
476  checkThreadID(tid);
477  for (const auto & object : _all_objects[tid])
478  if (object->name() == name)
479  return object;
480  mooseError("Unable to locate object: ", name, ".");
481 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
std::vector< std::vector< std::shared_ptr< T > > > _all_objects
Storage container for the ALL pointers (THREAD_ID on outer vector)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ getObjects()

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

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

Parameters
tidThe thread id to retrieve objects from

Definition at line 315 of file MooseObjectWarehouseBase.h.

Referenced by NonlinearEigenSystem::addEigenTagToMooseObjects(), FEProblemBase::checkNonlocalCoupling(), and FEProblemBase::setNonlocalCouplingMatrix().

316 {
317  checkThreadID(tid);
318  return _all_objects[tid];
319 }
std::vector< std::vector< std::shared_ptr< T > > > _all_objects
Storage container for the ALL pointers (THREAD_ID on outer vector)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ 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 ( THREAD_ID  tid = 0) const
inherited

Definition at line 423 of file MooseObjectWarehouseBase.h.

Referenced by NonlinearSystemBase::checkKernelCoverage(), AuxiliarySystem::computeElementalVarsHelper(), ComputeFullJacobianThread::computeInternalFaceJacobian(), ComputeFullJacobianThread::computeJacobian(), ComputeJacobianThread::computeJacobian(), NonlinearSystemBase::computeJacobianInternal(), AuxiliarySystem::computeNodalVarsHelper(), NonlinearSystemBase::computeResidualInternal(), BlockRestrictable::hasBlockMaterialPropertyHelper(), ComputeMarkerThread::onElement(), ComputeIndicatorThread::onElement(), ComputeResidualThread::onElement(), ComputeMaterialsObjectThread::onElement(), ComputeJacobianThread::onInternalSide(), ComputeIndicatorThread::onInternalSide(), ComputeResidualThread::onInternalSide(), ComputeNodalKernelsThread::onNode(), ComputeNodalKernelJacobiansThread::onNode(), ComputeInitialConditionThread::operator()(), FEProblemBase::prepareMaterials(), and FEProblemBase::reinitMaterials().

424 {
425  checkThreadID(tid);
426  bool has_active_block_objects = false;
427  for (const auto & object_pair : _active_block_objects[tid])
428  has_active_block_objects |= !(object_pair.second.empty());
429  return has_active_block_objects;
430 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< T > > > > _active_block_objects
Active block restricted objects (THREAD_ID on outer vector)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ hasActiveBlockObjects() [2/2]

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

Definition at line 434 of file MooseObjectWarehouseBase.h.

435 {
436  checkThreadID(tid);
437  const auto iter = _active_block_objects[tid].find(id);
438  return iter != _active_block_objects[tid].end();
439 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< T > > > > _active_block_objects
Active block restricted objects (THREAD_ID on outer vector)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ hasActiveBoundaryObjects() [1/2]

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

Definition at line 443 of file MooseObjectWarehouseBase.h.

Referenced by AuxiliarySystem::computeElementalVarsHelper(), ComputeFullJacobianThread::computeFaceJacobian(), ComputeFullJacobianThread::computeInternalInterFaceJacobian(), NonlinearSystemBase::computeJacobianBlocks(), NonlinearSystemBase::computeJacobianInternal(), NonlinearSystemBase::computeNodalBCs(), AuxiliarySystem::computeNodalVarsHelper(), NonlinearSystemBase::computeResidualInternal(), BoundaryRestrictable::hasBoundaryMaterialPropertyHelper(), NonlinearSystemBase::needBoundaryMaterialOnSide(), ComputeJacobianThread::onBoundary(), ComputeResidualThread::onBoundary(), ComputeMaterialsObjectThread::onBoundary(), ComputeJacobianThread::onInterface(), ComputeResidualThread::onInterface(), ComputeBoundaryInitialConditionThread::onNode(), ComputeNodalKernelBcsThread::onNode(), ComputeNodalKernelBCJacobiansThread::onNode(), FEProblemBase::reinitMaterialsBoundary(), and NonlinearSystemBase::setInitialSolution().

444 {
445  checkThreadID(tid);
446  bool has_active_boundary_objects = false;
447  for (const auto & object_pair : _active_boundary_objects[tid])
448  has_active_boundary_objects |= !(object_pair.second.empty());
449  return has_active_boundary_objects;
450 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< T > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)

◆ hasActiveBoundaryObjects() [2/2]

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

Definition at line 454 of file MooseObjectWarehouseBase.h.

455 {
456  checkThreadID(tid);
457  const auto iter = _active_boundary_objects[tid].find(id);
458  return iter != _active_boundary_objects[tid].end();
459 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< T > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)

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

Referenced by FEProblemBase::getDistribution(), FEProblemBase::getSampler(), FEProblemBase::hasFunction(), and FEProblemBase::hasMultiApp().

464 {
465  checkThreadID(tid);
466  for (const auto & object : _active_objects[tid])
467  if (object->name() == name)
468  return true;
469  return false;
470 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::vector< std::shared_ptr< T > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ 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 119 of file MooseObjectWarehouse.h.

Referenced by ComputeFullJacobianThread::computeJacobian().

122 {
123  auto iter = _variable_objects.find(variable_id);
124  return (iter != _variable_objects.end() && iter->second.hasActiveBlockObjects(block_id, tid));
125 }
std::map< unsigned int, MooseObjectWarehouse< T > > _variable_objects
Variable based storage.

◆ hasObjects()

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

Convenience functions for determining if objects exist.

Definition at line 407 of file MooseObjectWarehouseBase.h.

Referenced by FEProblemBase::initialSetup().

408 {
409  checkThreadID(tid);
410  return !_all_objects[tid].empty();
411 }
std::vector< std::vector< std::shared_ptr< T > > > _all_objects
Storage container for the ALL pointers (THREAD_ID on outer vector)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ 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 143 of file MooseObjectWarehouse.h.

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

144 {
145  checkThreadID(tid);
146  // Initial Setup should be called on all objects because they may become active later
147  for (const auto & object : _all_objects[tid])
148  object->initialSetup();
149 }
std::vector< std::vector< std::shared_ptr< T > > > _all_objects
Storage container for the ALL pointers (THREAD_ID on outer vector)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ jacobianSetup()

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

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 166 of file ExecuteMooseObjectWarehouse.h.

Referenced by AuxiliarySystem::jacobianSetup().

167 {
168  checkThreadID(tid);
169  const auto iter = _execute_objects.find(EXEC_NONLINEAR);
170  if (iter != _execute_objects.end())
171  iter->second.jacobianSetup(tid);
172 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::map< ExecFlagType, MooseObjectWarehouse< T > > _execute_objects
const ExecFlagType EXEC_NONLINEAR

◆ numThreads()

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

Return the number of threads.

Definition at line 163 of file MooseObjectWarehouseBase.h.

Referenced by NonlinearEigenSystem::addEigenTagToMooseObjects().

163 { return _num_threads; }
const THREAD_ID _num_threads
Convenience member storing the number of threads used for storage (1 or libMesh::n_threads) ...

◆ operator[]() [1/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 123 of file ExecuteMooseObjectWarehouse.h.

124 {
125  // Use find to avoid accidental insertion
126  const auto iter = _execute_objects.find(exec_flag);
127 
128  if (iter == _execute_objects.end())
129  mooseError("Unable to locate the desired execute flag (",
130  exec_flag,
131  "), the supplied execution flag was likely "
132  "not registered.");
133 
134  return iter->second;
135 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
std::map< ExecFlagType, MooseObjectWarehouse< T > > _execute_objects

◆ operator[]() [2/2]

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

Definition at line 138 of file ExecuteMooseObjectWarehouse.h.

139 {
140  // Use find to avoid accidental insertion
141  const auto iter = _execute_objects.find(exec_flag);
142 
143  if (iter == _execute_objects.end())
144  mooseError("Unable to locate the desired execute flag (",
145  exec_flag,
146  "), the supplied execution flag was likely "
147  "not registered.");
148 
149  return iter->second;
150 }
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:208
std::map< ExecFlagType, MooseObjectWarehouse< T > > _execute_objects

◆ residualSetup()

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

Reimplemented from MooseObjectWarehouse< T >.

Definition at line 176 of file ExecuteMooseObjectWarehouse.h.

Referenced by AuxiliarySystem::residualSetup().

177 {
178  checkThreadID(tid);
179  const auto iter = _execute_objects.find(EXEC_LINEAR);
180  if (iter != _execute_objects.end())
181  iter->second.residualSetup(tid);
182 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::map< ExecFlagType, MooseObjectWarehouse< T > > _execute_objects
const ExecFlagType EXEC_LINEAR

◆ setup()

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

Definition at line 186 of file ExecuteMooseObjectWarehouse.h.

Referenced by FEProblemBase::executeControls(), and FEProblemBase::executeSamplers().

187 {
188  checkThreadID(tid);
189  if (exec_flag == EXEC_INITIAL)
190  initialSetup(tid);
191  else if (exec_flag == EXEC_TIMESTEP_BEGIN)
192  timestepSetup(tid);
193  else if (exec_flag == EXEC_SUBDOMAIN)
194  subdomainSetup(tid);
195  else if (exec_flag == EXEC_NONLINEAR)
196  jacobianSetup(tid);
197  else if (exec_flag == EXEC_LINEAR)
198  residualSetup(tid);
199 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
void residualSetup(THREAD_ID tid=0) const
void jacobianSetup(THREAD_ID tid=0) const
Convenience methods for calling object setup methods.
const ExecFlagType EXEC_TIMESTEP_BEGIN
virtual void timestepSetup(THREAD_ID tid=0) const
const ExecFlagType EXEC_LINEAR
virtual void initialSetup(THREAD_ID tid=0) const
Convenience methods for calling object setup methods.
const ExecFlagType EXEC_NONLINEAR
const ExecFlagType EXEC_SUBDOMAIN
virtual void subdomainSetup(THREAD_ID tid=0) const
const ExecFlagType EXEC_INITIAL

◆ size()

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

Return how many kernels we store in the current warehouse.

Definition at line 235 of file MooseObjectWarehouseBase.h.

236 {
237  checkThreadID(tid);
238  return _all_objects[tid].size();
239 }
std::vector< std::vector< std::shared_ptr< T > > > _all_objects
Storage container for the ALL pointers (THREAD_ID on outer vector)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ 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 241 of file ExecuteMooseObjectWarehouse.h.

Referenced by AuxiliarySystem::initialSetup().

242 {
243  // Sort execute object storage
244  for (auto & object_pair : _execute_objects)
245  object_pair.second.sort(tid);
246 }
std::map< ExecFlagType, MooseObjectWarehouse< T > > _execute_objects

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

675 {
676  // Do nothing if the vector is empty
677  if (objects.empty())
678  return;
679 
680  try
681  {
682  // Sort based on dependencies
683  DependencyResolverInterface::sort<std::shared_ptr<T>>(objects);
684  }
685  catch (CyclicDependencyException<std::shared_ptr<T>> & e)
686  {
687  DependencyResolverInterface::cyclicDependencyError<std::shared_ptr<T>>(
688  e, "Cyclic dependency detected in object ordering");
689  }
690 }

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

Referenced by NonlinearSystemBase::checkKernelCoverage().

664 {
665  for (const auto & object : _active_objects[tid])
666  unique_variables.insert(object->variable().name());
667 
668  for (const auto & object_pair : _active_block_objects[tid])
669  subdomains_covered.insert(object_pair.first);
670 }
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::vector< std::shared_ptr< T > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ subdomainSetup() [1/2]

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

Reimplemented in MaterialWarehouse.

Definition at line 175 of file MooseObjectWarehouse.h.

Referenced by MaterialWarehouse::neighborSubdomainSetup(), ComputeMarkerThread::subdomainChanged(), ComputeIndicatorThread::subdomainChanged(), MaterialWarehouse::subdomainSetup(), AuxiliarySystem::subdomainSetup(), and NonlinearSystemBase::subdomainSetup().

176 {
177  checkThreadID(tid);
178  for (const auto & object : _active_objects[tid])
179  object->subdomainSetup();
180 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::vector< std::shared_ptr< T > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ subdomainSetup() [2/2]

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

Reimplemented in MaterialWarehouse.

Definition at line 162 of file MooseObjectWarehouse.h.

163 {
164  checkThreadID(tid);
165  if (hasActiveBlockObjects(id, tid))
166  {
167  const auto & objects = getActiveBlockObjects(id, tid);
168  for (const auto & object : objects)
169  object->subdomainSetup();
170  }
171 }
bool hasActiveBlockObjects(THREAD_ID tid=0) const
const std::map< SubdomainID, std::vector< std::shared_ptr< T > > > & getActiveBlockObjects(THREAD_ID tid=0) const
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ timestepSetup()

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

Reimplemented in MaterialWarehouse.

Definition at line 153 of file MooseObjectWarehouse.h.

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

154 {
155  checkThreadID(tid);
156  for (const auto & object : _active_objects[tid])
157  object->timestepSetup();
158 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::vector< std::shared_ptr< T > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ updateActive()

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

Updates the active objects storage.

Reimplemented from MooseObjectWarehouse< T >.

Definition at line 154 of file ExecuteMooseObjectWarehouse.h.

Referenced by AuxiliarySystem::updateActive(), and FEProblemBase::updateActiveObjects().

155 {
156  // Update all objects active list
158 
159  // Update the execute flag lists of objects
160  for (auto & object_pair : _execute_objects)
161  object_pair.second.updateActive(tid);
162 }
std::map< ExecFlagType, MooseObjectWarehouse< T > > _execute_objects
virtual void updateActive(THREAD_ID tid=0) override
Update the active status of Kernels.

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

524 {
525  // Clear the active list
526  active.clear();
527 
528  std::copy_if(all.begin(),
529  all.end(),
530  std::back_inserter(active),
531  [](const std::shared_ptr<T> & object) { return object->enabled(); });
532 }

◆ updateBlockMatPropDependency()

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

Definition at line 620 of file MooseObjectWarehouseBase.h.

Referenced by FEProblemBase::prepareMaterials(), ComputeJacobianThread::subdomainChanged(), and ComputeResidualThread::subdomainChanged().

623 {
624  if (hasActiveBlockObjects(id, tid))
625  updateMatPropDependencyHelper(needed_mat_props, getActiveBlockObjects(id, tid));
626 }
bool hasActiveBlockObjects(THREAD_ID tid=0) const
const std::map< SubdomainID, std::vector< std::shared_ptr< T > > > & getActiveBlockObjects(THREAD_ID tid=0) const
static void updateMatPropDependencyHelper(std::set< unsigned int > &needed_mat_props, const std::vector< std::shared_ptr< T >> &objects)
Helper method for updating material property dependency vector.

◆ updateBlockVariableDependency()

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

Definition at line 563 of file MooseObjectWarehouseBase.h.

Referenced by ComputeJacobianThread::subdomainChanged(), and ComputeResidualThread::subdomainChanged().

567 {
568  if (hasActiveBlockObjects(id, tid))
569  updateVariableDependencyHelper(needed_moose_vars, getActiveBlockObjects(id, tid));
570 }
bool hasActiveBlockObjects(THREAD_ID tid=0) const
const std::map< SubdomainID, std::vector< std::shared_ptr< T > > > & getActiveBlockObjects(THREAD_ID tid=0) const
static void updateVariableDependencyHelper(std::set< MooseVariableFEBase *> &needed_moose_vars, const std::vector< std::shared_ptr< T >> &objects)
Helper method for updating variable dependency vector.

◆ updateBoundaryMatPropDependency() [1/2]

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

Definition at line 630 of file MooseObjectWarehouseBase.h.

Referenced by FEProblemBase::prepareMaterials(), ComputeJacobianThread::subdomainChanged(), and ComputeResidualThread::subdomainChanged().

632 {
633  if (hasActiveBoundaryObjects(tid))
634  for (auto & active_bnd_object : _active_boundary_objects[tid])
635  updateMatPropDependencyHelper(needed_mat_props, active_bnd_object.second);
636 }
static void updateMatPropDependencyHelper(std::set< unsigned int > &needed_mat_props, const std::vector< std::shared_ptr< T >> &objects)
Helper method for updating material property dependency vector.
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< T > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)

◆ updateBoundaryMatPropDependency() [2/2]

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

Definition at line 640 of file MooseObjectWarehouseBase.h.

642 {
643  if (hasActiveBoundaryObjects(id, tid))
644  updateMatPropDependencyHelper(needed_mat_props, getActiveBoundaryObjects(id, tid));
645 }
static void updateMatPropDependencyHelper(std::set< unsigned int > &needed_mat_props, const std::vector< std::shared_ptr< T >> &objects)
Helper method for updating material property dependency vector.
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
const std::map< BoundaryID, std::vector< std::shared_ptr< T > > > & getActiveBoundaryObjects(THREAD_ID tid=0) const

◆ updateBoundaryVariableDependency() [1/2]

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

Definition at line 574 of file MooseObjectWarehouseBase.h.

Referenced by FEProblemBase::prepareMaterials(), ComputeJacobianThread::subdomainChanged(), and ComputeResidualThread::subdomainChanged().

576 {
577  if (hasActiveBoundaryObjects(tid))
578  {
579  typename std::map<BoundaryID, std::vector<std::shared_ptr<T>>>::const_iterator it;
580  for (const auto & object_pair : _active_boundary_objects[tid])
581  updateVariableDependencyHelper(needed_moose_vars, object_pair.second);
582  }
583 }
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< T > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)
static void updateVariableDependencyHelper(std::set< MooseVariableFEBase *> &needed_moose_vars, const std::vector< std::shared_ptr< T >> &objects)
Helper method for updating variable dependency vector.

◆ updateBoundaryVariableDependency() [2/2]

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

Definition at line 587 of file MooseObjectWarehouseBase.h.

591 {
592  if (hasActiveBoundaryObjects(id, tid))
593  updateVariableDependencyHelper(needed_moose_vars, getActiveBoundaryObjects(id, tid));
594 }
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
const std::map< BoundaryID, std::vector< std::shared_ptr< T > > > & getActiveBoundaryObjects(THREAD_ID tid=0) const
static void updateVariableDependencyHelper(std::set< MooseVariableFEBase *> &needed_moose_vars, const std::vector< std::shared_ptr< T >> &objects)
Helper method for updating variable dependency vector.

◆ updateMatPropDependency()

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

Update material property dependency vector.

Definition at line 611 of file MooseObjectWarehouseBase.h.

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

613 {
614  if (hasActiveObjects(tid))
615  updateMatPropDependencyHelper(needed_mat_props, _all_objects[tid]);
616 }
std::vector< std::vector< std::shared_ptr< T > > > _all_objects
Storage container for the ALL pointers (THREAD_ID on outer vector)
static void updateMatPropDependencyHelper(std::set< unsigned int > &needed_mat_props, const std::vector< std::shared_ptr< T >> &objects)
Helper method for updating material property dependency vector.
bool hasActiveObjects(THREAD_ID tid=0) const

◆ updateMatPropDependencyHelper()

template<typename T>
void MooseObjectWarehouseBase< T >::updateMatPropDependencyHelper ( std::set< unsigned int > &  needed_mat_props,
const std::vector< std::shared_ptr< T >> &  objects 
)
staticprotectedinherited

Helper method for updating material property dependency vector.

Definition at line 649 of file MooseObjectWarehouseBase.h.

651 {
652  for (auto & object : objects)
653  {
654  auto & mp_deps = object->getMatPropDependencies();
655  needed_mat_props.insert(mp_deps.begin(), mp_deps.end());
656  }
657 }

◆ updateVariableDependency()

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

Update variable dependency vector.

Definition at line 554 of file MooseObjectWarehouseBase.h.

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

556 {
557  if (hasActiveObjects(tid))
558  updateVariableDependencyHelper(needed_moose_vars, _all_objects[tid]);
559 }
std::vector< std::vector< std::shared_ptr< T > > > _all_objects
Storage container for the ALL pointers (THREAD_ID on outer vector)
bool hasActiveObjects(THREAD_ID tid=0) const
static void updateVariableDependencyHelper(std::set< MooseVariableFEBase *> &needed_moose_vars, const std::vector< std::shared_ptr< T >> &objects)
Helper method for updating variable dependency vector.

◆ updateVariableDependencyHelper()

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

Helper method for updating variable dependency vector.

Definition at line 598 of file MooseObjectWarehouseBase.h.

601 {
602  for (const auto & object : objects)
603  {
604  const auto & mv_deps = object->getMooseVariableDependencies();
605  needed_moose_vars.insert(mv_deps.begin(), mv_deps.end());
606  }
607 }

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 block restricted objects (THREAD_ID on outer vector)

Definition at line 179 of file MooseObjectWarehouseBase.h.

◆ _active_boundary_objects

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

Active boundary restricted objects (THREAD_ID on outer vector)

Definition at line 185 of file MooseObjectWarehouseBase.h.

◆ _active_objects

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

All active objects (THREAD_ID on outer vector)

Definition at line 173 of file MooseObjectWarehouseBase.h.

◆ _all_block_objects

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

Definition at line 176 of file MooseObjectWarehouseBase.h.

◆ _all_boundary_objects

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

Definition at line 182 of file MooseObjectWarehouseBase.h.

◆ _all_objects

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

Storage container for the ALL pointers (THREAD_ID on outer vector)

Definition at line 170 of file MooseObjectWarehouseBase.h.

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

Referenced by MooseObjectWarehouseBase< Indicator >::numThreads().

◆ _variable_objects

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

Variable based storage.

Definition at line 82 of file MooseObjectWarehouse.h.


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