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 (bool threaded=true)
 Constructor. More...
 
virtual ~ExecuteMooseObjectWarehouse ()
 
virtual void addObject (std::shared_ptr< T > object, THREAD_ID tid=0)
 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...
 
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...
 
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 (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
 
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 hasActiveObjects (THREAD_ID tid=0) const
 Convenience functions for determining if objects exist. More...
 
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 > getActiveObject (const std::string &name, THREAD_ID tid=0) const
 
void updateVariableDependency (std::set< MooseVariable * > &needed_moose_vars, THREAD_ID tid=0) const
 Update variable dependency vector. More...
 
void updateBlockVariableDependency (SubdomainID id, std::set< MooseVariable * > &needed_moose_vars, THREAD_ID tid=0) const
 
void updateBoundaryVariableDependency (std::set< MooseVariable * > &needed_moose_vars, THREAD_ID tid=0) const
 
void updateBoundaryVariableDependency (BoundaryID id, std::set< MooseVariable * > &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< MooseVariable * > &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
 
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 31 of file ExecuteMooseObjectWarehouse.h.

Constructor & Destructor Documentation

template<typename T >
ExecuteMooseObjectWarehouse< T >::ExecuteMooseObjectWarehouse ( bool  threaded = true)

Constructor.

Parameters
threadedTrue enables threaded object storage (default).

Definition at line 112 of file ExecuteMooseObjectWarehouse.h.

113  : MooseObjectWarehouse<T>(threaded)
114 {
115  // Initialize the active/all data structures with the correct map entries and empty vectors
116  for (const auto & exec_type : Moose::exec_types)
117  _execute_objects.insert(std::make_pair(exec_type, MooseObjectWarehouse<T>(threaded)));
118 }
A storage container for MooseObjects that inherit from SetupInterface.
std::map< ExecFlagType, MooseObjectWarehouse< T > > _execute_objects
const std::vector< ExecFlagType > exec_types
A static list of all the exec types.
Definition: MooseTypes.C:40
template<typename T >
ExecuteMooseObjectWarehouse< T >::~ExecuteMooseObjectWarehouse ( )
virtual

Definition at line 121 of file ExecuteMooseObjectWarehouse.h.

122 {
123 }

Member Function Documentation

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

Adds an object to the storage structure.

Parameters
objectA shared pointer to the object being added

Reimplemented from MooseObjectWarehouseBase< T >.

Definition at line 213 of file ExecuteMooseObjectWarehouse.h.

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

215 {
216  addObjectMask(object, tid, 0xFFFF);
217 }
void addObjectMask(std::shared_ptr< T > object, THREAD_ID tid=0, std::uint16_t flag_mask=std::numeric_limits< std::uint16_t >::max())
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 221 of file ExecuteMooseObjectWarehouse.h.

Referenced by ExecuteMooseObjectWarehouse< T >::addObject(), and AuxGroupExecuteMooseObjectWarehouse< T >::updateDependObjects().

224 {
225  // Update list of all objects
227 
228  // Update the execute flag lists of objects
229  std::shared_ptr<SetupInterface> ptr = std::dynamic_pointer_cast<SetupInterface>(object);
230  if (ptr)
231  {
232  const std::vector<ExecFlagType> flags = ptr->execFlags();
233  for (auto flag : flags)
234  {
235  auto masked_flag = static_cast<std::uint16_t>(flag) & flag_mask;
236  if (masked_flag != 0)
237  _execute_objects[flag].addObject(object, tid);
238  }
239  }
240  else
241  mooseError("The object being added (",
242  object->name(),
243  ") must inherit from SetupInterface to "
244  "be added to the "
245  "ExecuteMooseObjectWarehouse "
246  "container.");
247 }
virtual const std::vector< ExecFlagType > & execFlags() const
Get the execution flag for the object.
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0)
Adds an object to the storage structure.
std::map< ExecFlagType, MooseObjectWarehouse< T > > _execute_objects
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 69 of file ExecuteMooseObjectWarehouse.h.

70  {
71  return _execute_objects.begin();
72  }
std::map< ExecFlagType, MooseObjectWarehouse< T > > _execute_objects
template<typename T>
void MooseObjectWarehouseBase< T >::checkThreadID ( THREAD_ID  tid) const
inlineprotectedinherited

Calls assert on thread id.

Definition at line 642 of file MooseObjectWarehouseBase.h.

Referenced by MooseObjectWarehouseBase< T >::addObject(), MooseObjectWarehouseBase< T >::getActiveBlockObjects(), MooseObjectWarehouseBase< T >::getActiveBlocks(), MooseObjectWarehouseBase< T >::getActiveBoundaryObjects(), MooseObjectWarehouseBase< T >::getActiveObject(), MooseObjectWarehouseBase< T >::getActiveObjects(), MooseObjectWarehouseBase< T >::getBlockObjects(), MooseObjectWarehouseBase< T >::getBoundaryObjects(), MooseObjectWarehouseBase< T >::getObjects(), MooseObjectWarehouseBase< T >::hasActiveBlockObjects(), MooseObjectWarehouseBase< T >::hasActiveBoundaryObjects(), MooseObjectWarehouseBase< T >::hasActiveObject(), MooseObjectWarehouseBase< T >::hasActiveObjects(), MooseObjectWarehouse< T >::initialSetup(), MooseObjectWarehouse< T >::jacobianSetup(), ExecuteMooseObjectWarehouse< T >::jacobianSetup(), MooseObjectWarehouse< T >::residualSetup(), ExecuteMooseObjectWarehouse< T >::residualSetup(), ExecuteMooseObjectWarehouse< T >::setup(), MooseObjectWarehouseBase< T >::sort(), MooseObjectWarehouse< T >::subdomainSetup(), MooseObjectWarehouse< T >::timestepSetup(), MooseObjectWarehouseBase< T >::updateActive(), and AuxGroupExecuteMooseObjectWarehouse< T >::updateDependObjects().

643 {
644  mooseAssert(tid < _num_threads,
645  "Attempting to access a thread id ("
646  << tid
647  << ") greater than the number allowed by the storage item ("
648  << _num_threads
649  << ")");
650 }
const THREAD_ID _num_threads
Convenience member storing the number of threads used for storage (1 or libMesh::n_threads) ...
template<typename T>
std::map<ExecFlagType, MooseObjectWarehouse<T> >::const_iterator ExecuteMooseObjectWarehouse< T >::end ( ) const
inline

Definition at line 73 of file ExecuteMooseObjectWarehouse.h.

74  {
75  return _execute_objects.end();
76  }
std::map< ExecFlagType, MooseObjectWarehouse< T > > _execute_objects
template<typename T >
const std::map< SubdomainID, std::vector< std::shared_ptr< T > > > & MooseObjectWarehouseBase< T >::getActiveBlockObjects ( THREAD_ID  tid = 0) const
inlineinherited

Definition at line 356 of file MooseObjectWarehouseBase.h.

Referenced by FEProblemBase::checkProblemIntegrity(), ComputeFullJacobianThread::computeInternalFaceJacobian(), ComputeJacobianThread::computeInternalFaceJacobian(), ComputeJacobianThread::computeJacobian(), BlockRestrictable::hasBlockMaterialPropertyHelper(), ComputeMarkerThread::onElement(), ComputeElemAuxVarsThread::onElement(), ComputeResidualThread::onElement(), ComputeIndicatorThread::onElement(), ComputeUserObjectsThread::onElement(), ComputeMaterialsObjectThread::onElement(), ComputeIndicatorThread::onInternalSide(), ComputeResidualThread::onInternalSide(), ComputeUserObjectsThread::onInternalSide(), ComputeNodalUserObjectsThread::onNode(), ComputeNodalKernelsThread::onNode(), ComputeNodalAuxVarsThread::onNode(), ComputeNodalKernelJacobiansThread::onNode(), ComputeInitialConditionThread::operator()(), FEProblemBase::reinitMaterials(), ComputeElemAuxVarsThread::subdomainChanged(), MooseObjectWarehouse< T >::subdomainSetup(), MooseObjectWarehouseBase< T >::updateBlockMatPropDependency(), and MooseObjectWarehouseBase< T >::updateBlockVariableDependency().

357 {
358  checkThreadID(tid);
359  return _active_block_objects[tid];
360 }
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.
template<typename T >
const std::vector< std::shared_ptr< T > > & MooseObjectWarehouseBase< T >::getActiveBlockObjects ( SubdomainID  id,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 364 of file MooseObjectWarehouseBase.h.

365 {
366  checkThreadID(tid);
367  const auto iter = _active_block_objects[tid].find(id);
368  mooseAssert(iter != _active_block_objects[tid].end(),
369  "Unable to located active block objects for the given id: " << id << ".");
370  return iter->second;
371 }
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.
template<typename T >
std::set< SubdomainID > MooseObjectWarehouseBase< T >::getActiveBlocks ( THREAD_ID  tid = 0) const
inherited

Return a set of active SubdomainsIDs.

Definition at line 445 of file MooseObjectWarehouseBase.h.

Referenced by FEProblemBase::checkProblemIntegrity().

446 {
447  checkThreadID(tid);
448  std::set<SubdomainID> ids;
449  for (const auto & object_pair : _active_block_objects[tid])
450  ids.insert(object_pair.first);
451  return ids;
452 }
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.
template<typename T >
const std::map< BoundaryID, std::vector< std::shared_ptr< T > > > & MooseObjectWarehouseBase< T >::getActiveBoundaryObjects ( THREAD_ID  tid = 0) const
inlineinherited

Definition at line 337 of file MooseObjectWarehouseBase.h.

Referenced by ComputeFullJacobianThread::computeFaceJacobian(), ComputeJacobianThread::computeFaceJacobian(), ComputeFullJacobianThread::computeInternalInterFaceJacobian(), ComputeJacobianThread::computeInternalInterFaceJacobian(), NonlinearSystemBase::computeJacobianBlocks(), NonlinearSystemBase::computeJacobianInternal(), NonlinearSystemBase::computeNodalBCs(), BoundaryRestrictable::hasBoundaryMaterialPropertyHelper(), ComputeResidualThread::onBoundary(), ComputeUserObjectsThread::onBoundary(), ComputeMaterialsObjectThread::onBoundary(), ComputeResidualThread::onInterface(), ComputeNodalKernelBcsThread::onNode(), ComputeNodalUserObjectsThread::onNode(), ComputeBoundaryInitialConditionThread::onNode(), ComputeNodalAuxBcsThread::onNode(), ComputeNodalKernelBCJacobiansThread::onNode(), ComputeElemAuxBcsThread::operator()(), FEProblemBase::reinitMaterialsBoundary(), NonlinearSystemBase::setInitialSolution(), MooseObjectWarehouseBase< T >::updateBoundaryMatPropDependency(), and MooseObjectWarehouseBase< T >::updateBoundaryVariableDependency().

338 {
339  checkThreadID(tid);
340  return _active_boundary_objects[tid];
341 }
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)
template<typename T >
const std::vector< std::shared_ptr< T > > & MooseObjectWarehouseBase< T >::getActiveBoundaryObjects ( BoundaryID  id,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 345 of file MooseObjectWarehouseBase.h.

346 {
347  checkThreadID(tid);
348  const auto iter = _active_boundary_objects[tid].find(id);
349  mooseAssert(iter != _active_boundary_objects[tid].end(),
350  "Unable to located active boundary objects for the given id: " << id << ".");
351  return iter->second;
352 }
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)
template<typename T >
std::shared_ptr< T > MooseObjectWarehouseBase< T >::getActiveObject ( const std::string &  name,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 434 of file MooseObjectWarehouseBase.h.

Referenced by FEProblemBase::getDistribution(), FEProblemBase::getFunction(), FEProblemBase::getMaterial(), FEProblemBase::getMultiApp(), FEProblemBase::getSampler(), NonlinearSystemBase::getSplit(), and FEProblemBase::getUserObjectBase().

435 {
436  checkThreadID(tid);
437  for (const auto & object : _active_objects[tid])
438  if (object->name() == name)
439  return object;
440  mooseError("Unable to locate active object: ", name, ".");
441 }
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
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)
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 329 of file MooseObjectWarehouseBase.h.

Referenced by FEProblemBase::advanceMultiApps(), FEProblemBase::backupMultiApps(), NonlinearEigenSystem::checkIntegrity(), FEProblemBase::checkProblemIntegrity(), FEProblemBase::checkUserObjectJacobianRequirement(), FEProblemBase::checkUserObjects(), NonlinearSystemBase::computeDamping(), NonlinearSystemBase::computeDiracContributions(), FEProblemBase::computeIndicators(), FEProblemBase::computeMarkers(), FEProblemBase::computeMultiAppsDT(), NonlinearSystemBase::computeResidualInternal(), NonlinearSystemBase::computeScalarKernelsJacobians(), AuxiliarySystem::computeScalarVars(), FEProblemBase::computeUserObjects(), FEProblemBase::execMultiApps(), FEProblemBase::execMultiAppTransfers(), FEProblemBase::execTransfers(), FEProblemBase::executeSamplers(), FEProblemBase::finalizeUserObjects(), ConstraintWarehouse::getActiveNodalConstraints(), AuxiliarySystem::getDependObjects(), FEProblemBase::getTransfers(), FEProblemBase::initializeUserObjects(), AdvancedOutput::initPostprocessorOrVectorPostprocessorLists(), ComputeElemDampingThread::onElement(), ComputeDiracThread::onElement(), ComputeNodalDampingThread::onNode(), FEProblemBase::postExecute(), FEProblemBase::projectSolution(), and FEProblemBase::restoreMultiApps().

330 {
331  checkThreadID(tid);
332  return _active_objects[tid];
333 }
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)
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 310 of file MooseObjectWarehouseBase.h.

Referenced by MaterialPropertyDebugOutput::printMaterialMap().

311 {
312  checkThreadID(tid);
313  return _all_block_objects[tid];
314 }
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.
template<typename T >
const std::vector< std::shared_ptr< T > > & MooseObjectWarehouseBase< T >::getBlockObjects ( SubdomainID  id,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 318 of file MooseObjectWarehouseBase.h.

319 {
320  checkThreadID(tid);
321  const auto iter = _all_block_objects[tid].find(id);
322  mooseAssert(iter != _all_block_objects[tid].end(),
323  "Unable to located active block objects for the given id: " << id << ".");
324  return iter->second;
325 }
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.
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 291 of file MooseObjectWarehouseBase.h.

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

292 {
293  checkThreadID(tid);
294  return _all_boundary_objects[tid];
295 }
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
template<typename T >
const std::vector< std::shared_ptr< T > > & MooseObjectWarehouseBase< T >::getBoundaryObjects ( BoundaryID  id,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 299 of file MooseObjectWarehouseBase.h.

300 {
301  checkThreadID(tid);
302  const auto iter = _all_boundary_objects[tid].find(id);
303  mooseAssert(iter != _all_boundary_objects[tid].end(),
304  "Unable to located active boundary objects for the given id: " << id << ".");
305  return iter->second;
306 }
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
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 283 of file MooseObjectWarehouseBase.h.

Referenced by MaterialOutputAction::buildMaterialOutputObjects(), FEProblemBase::checkNonlocalCoupling(), and FEProblemBase::setNonlocalCouplingMatrix().

284 {
285  checkThreadID(tid);
286  return _all_objects[tid];
287 }
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.
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.

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

Definition at line 383 of file MooseObjectWarehouseBase.h.

Referenced by NonlinearSystemBase::checkKernelCoverage(), AuxiliarySystem::computeElementalVars(), ComputeFullJacobianThread::computeInternalFaceJacobian(), ComputeJacobianThread::computeJacobian(), NonlinearSystemBase::computeJacobianInternal(), AuxiliarySystem::computeNodalVars(), NonlinearSystemBase::computeResidualInternal(), BlockRestrictable::hasBlockMaterialPropertyHelper(), FEProblemBase::needMaterialOnSide(), ComputeMarkerThread::onElement(), ComputeElemAuxVarsThread::onElement(), ComputeResidualThread::onElement(), ComputeIndicatorThread::onElement(), ComputeMaterialsObjectThread::onElement(), ComputeUserObjectsThread::onElement(), ComputeJacobianThread::onInternalSide(), ComputeResidualThread::onInternalSide(), ComputeIndicatorThread::onInternalSide(), ComputeUserObjectsThread::onInternalSide(), ComputeNodalUserObjectsThread::onNode(), ComputeNodalKernelsThread::onNode(), ComputeNodalKernelJacobiansThread::onNode(), ComputeInitialConditionThread::operator()(), FEProblemBase::prepareMaterials(), FEProblemBase::reinitMaterials(), ComputeElemAuxVarsThread::subdomainChanged(), MooseObjectWarehouse< T >::subdomainSetup(), MooseObjectWarehouseBase< T >::updateBlockMatPropDependency(), and MooseObjectWarehouseBase< T >::updateBlockVariableDependency().

384 {
385  checkThreadID(tid);
386  bool has_active_block_objects = false;
387  for (const auto & object_pair : _active_block_objects[tid])
388  has_active_block_objects |= !(object_pair.second.empty());
389  return has_active_block_objects;
390 }
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.
template<typename T >
bool MooseObjectWarehouseBase< T >::hasActiveBlockObjects ( SubdomainID  id,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 394 of file MooseObjectWarehouseBase.h.

395 {
396  checkThreadID(tid);
397  const auto iter = _active_block_objects[tid].find(id);
398  return iter != _active_block_objects[tid].end();
399 }
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.
template<typename T >
bool MooseObjectWarehouseBase< T >::hasActiveBoundaryObjects ( THREAD_ID  tid = 0) const
inherited

Definition at line 403 of file MooseObjectWarehouseBase.h.

Referenced by AuxiliarySystem::computeElementalVars(), ComputeFullJacobianThread::computeFaceJacobian(), ComputeFullJacobianThread::computeInternalInterFaceJacobian(), NonlinearSystemBase::computeJacobianBlocks(), NonlinearSystemBase::computeJacobianInternal(), NonlinearSystemBase::computeNodalBCs(), AuxiliarySystem::computeNodalVars(), NonlinearSystemBase::computeResidualInternal(), BoundaryRestrictable::hasBoundaryMaterialPropertyHelper(), AuxiliarySystem::needMaterialOnSide(), NonlinearSystemBase::needMaterialOnSide(), FEProblemBase::needMaterialOnSide(), ComputeResidualThread::onBoundary(), ComputeJacobianThread::onBoundary(), ComputeMaterialsObjectThread::onBoundary(), ComputeUserObjectsThread::onBoundary(), ComputeResidualThread::onInterface(), ComputeJacobianThread::onInterface(), ComputeNodalKernelBcsThread::onNode(), ComputeBoundaryInitialConditionThread::onNode(), ComputeNodalUserObjectsThread::onNode(), ComputeNodalKernelBCJacobiansThread::onNode(), FEProblemBase::reinitMaterialsBoundary(), NonlinearSystemBase::setInitialSolution(), MooseObjectWarehouseBase< T >::updateBoundaryMatPropDependency(), and MooseObjectWarehouseBase< T >::updateBoundaryVariableDependency().

404 {
405  checkThreadID(tid);
406  bool has_active_boundary_objects = false;
407  for (const auto & object_pair : _active_boundary_objects[tid])
408  has_active_boundary_objects |= !(object_pair.second.empty());
409  return has_active_boundary_objects;
410 }
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)
template<typename T >
bool MooseObjectWarehouseBase< T >::hasActiveBoundaryObjects ( BoundaryID  id,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 414 of file MooseObjectWarehouseBase.h.

415 {
416  checkThreadID(tid);
417  const auto iter = _active_boundary_objects[tid].find(id);
418  return iter != _active_boundary_objects[tid].end();
419 }
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)
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 423 of file MooseObjectWarehouseBase.h.

Referenced by FEProblemBase::addPostprocessor(), FEProblemBase::addVectorPostprocessor(), FEProblemBase::getDistribution(), FEProblemBase::getSampler(), FEProblemBase::getUserObjectBase(), FEProblemBase::hasFunction(), FEProblemBase::hasMultiApp(), and FEProblemBase::hasUserObject().

424 {
425  checkThreadID(tid);
426  for (const auto & object : _active_objects[tid])
427  if (object->name() == name)
428  return true;
429  return false;
430 }
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)
template<typename T >
bool MooseObjectWarehouseBase< T >::hasActiveObjects ( THREAD_ID  tid = 0) const
inherited
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 65 of file MooseObjectWarehouse.h.

Referenced by MaterialWarehouse::initialSetup(), AuxiliarySystem::initialSetup(), NonlinearSystemBase::initialSetup(), FEProblemBase::initialSetup(), ExecuteMooseObjectWarehouse< T >::setup(), and NonlinearSystemBase::timestepSetup().

66 {
67  checkThreadID(tid);
68  for (const auto & object : _active_objects[tid])
69  object->initialSetup();
70 }
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)
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 ExecuteMooseObjectWarehouse< Transfer >::end(), AuxiliarySystem::jacobianSetup(), and ExecuteMooseObjectWarehouse< T >::setup().

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
Object is evaluated in every jacobian computation.
Definition: MooseTypes.h:98
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 127 of file ExecuteMooseObjectWarehouse.h.

Referenced by ExecuteMooseObjectWarehouse< T >::~ExecuteMooseObjectWarehouse().

128 {
129  // Use find to avoid accidental insertion
130  const auto iter = _execute_objects.find(exec_flag);
131 
132  if (iter == _execute_objects.end())
133  mooseError("Unable to locate the desired execute flag, the global list of execute parameters "
134  "is likely out-of-date.");
135 
136  return iter->second;
137 }
void mooseError(Args &&...args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:182
std::map< ExecFlagType, MooseObjectWarehouse< T > > _execute_objects
template<typename T >
MooseObjectWarehouse< T > & ExecuteMooseObjectWarehouse< T >::operator[] ( ExecFlagType  exec_flag)

Definition at line 140 of file ExecuteMooseObjectWarehouse.h.

141 {
142  // Use find to avoid accidental insertion
143  const auto iter = _execute_objects.find(exec_flag);
144 
145  if (iter == _execute_objects.end())
146  mooseError("Unable to locate the desired execute flag, the global list of execute parameters "
147  "is likely out-of-date.");
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:182
std::map< ExecFlagType, MooseObjectWarehouse< T > > _execute_objects
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 ExecuteMooseObjectWarehouse< Transfer >::end(), AuxiliarySystem::residualSetup(), and ExecuteMooseObjectWarehouse< T >::setup().

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 }
Object is evaluated in every residual computation.
Definition: MooseTypes.h:96
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::map< ExecFlagType, MooseObjectWarehouse< T > > _execute_objects
template<typename T >
void ExecuteMooseObjectWarehouse< T >::setup ( ExecFlagType  exec_flag,
THREAD_ID  tid = 0 
) const

Definition at line 186 of file ExecuteMooseObjectWarehouse.h.

Referenced by ExecuteMooseObjectWarehouse< Transfer >::end(), FEProblemBase::executeControls(), and FEProblemBase::executeSamplers().

187 {
188  checkThreadID(tid);
189  switch (exec_flag)
190  {
191  case EXEC_INITIAL:
192  initialSetup(tid);
193  break;
194  case EXEC_TIMESTEP_BEGIN:
195  timestepSetup(tid);
196  break;
197  case EXEC_SUBDOMAIN:
198  subdomainSetup(tid);
199  break;
200  case EXEC_NONLINEAR:
201  jacobianSetup(tid);
202  break;
203  case EXEC_LINEAR:
204  residualSetup(tid);
205  break;
206  default:
207  break;
208  }
209 }
Object is evaluated in every residual computation.
Definition: MooseTypes.h:96
Object is evaluated only once at the beginning of the simulation.
Definition: MooseTypes.h:94
void jacobianSetup(THREAD_ID tid=0) const
Convenience methods for calling object setup methods.
virtual void subdomainSetup(THREAD_ID tid=0) const
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
virtual void timestepSetup(THREAD_ID tid=0) const
virtual void initialSetup(THREAD_ID tid=0) const
Convenience methods for calling object setup methods.
Objects is evaluated on subdomain.
Definition: MooseTypes.h:112
void residualSetup(THREAD_ID tid=0) const
Object is evaluated at the beginning of every time step.
Definition: MooseTypes.h:102
Object is evaluated in every jacobian computation.
Definition: MooseTypes.h:98
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 251 of file ExecuteMooseObjectWarehouse.h.

Referenced by ExecuteMooseObjectWarehouse< Transfer >::end(), AuxiliarySystem::initialSetup(), and AuxGroupExecuteMooseObjectWarehouse< T >::sort().

252 {
253  // Sort execute object storage
254  for (auto & object_pair : _execute_objects)
255  object_pair.second.sort(tid);
256 }
std::map< ExecFlagType, MooseObjectWarehouse< T > > _execute_objects
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 618 of file MooseObjectWarehouseBase.h.

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

619 {
620  // Do nothing if the vector is empty
621  if (objects.empty())
622  return;
623 
624  // Make sure the object is sortable
625  mooseAssert(std::dynamic_pointer_cast<DependencyResolverInterface>(objects[0]),
626  "Objects must inhert from DependencyResolverInterface to be sorted.");
627 
628  try
629  {
630  // Sort based on dependencies
631  DependencyResolverInterface::sort<std::shared_ptr<T>>(objects);
632  }
633  catch (CyclicDependencyException<std::shared_ptr<T>> & e)
634  {
635  DependencyResolverInterface::cyclicDependencyError<std::shared_ptr<T>>(
636  e, "Cyclic dependency detected in object ordering");
637  }
638 }
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 605 of file MooseObjectWarehouseBase.h.

Referenced by NonlinearSystemBase::checkKernelCoverage().

608 {
609  for (const auto & object : _active_objects[tid])
610  unique_variables.insert(object->variable().name());
611 
612  for (const auto & object_pair : _active_block_objects[tid])
613  subdomains_covered.insert(object_pair.first);
614 }
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)
template<typename T >
void MooseObjectWarehouse< T >::subdomainSetup ( THREAD_ID  tid = 0) const
virtualinherited

Reimplemented in MaterialWarehouse.

Definition at line 96 of file MooseObjectWarehouse.h.

Referenced by MaterialWarehouse::neighborSubdomainSetup(), ExecuteMooseObjectWarehouse< T >::setup(), ComputeMarkerThread::subdomainChanged(), ComputeIndicatorThread::subdomainChanged(), ComputeUserObjectsThread::subdomainChanged(), MaterialWarehouse::subdomainSetup(), AuxiliarySystem::subdomainSetup(), and NonlinearSystemBase::subdomainSetup().

97 {
98  checkThreadID(tid);
99  for (const auto & object : _active_objects[tid])
100  object->subdomainSetup();
101 }
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)
template<typename T >
void MooseObjectWarehouse< T >::subdomainSetup ( SubdomainID  id,
THREAD_ID  tid = 0 
) const
virtualinherited

Reimplemented in MaterialWarehouse.

Definition at line 83 of file MooseObjectWarehouse.h.

84 {
85  checkThreadID(tid);
86  if (hasActiveBlockObjects(id, tid))
87  {
88  const auto & objects = getActiveBlockObjects(id, tid);
89  for (const auto & object : objects)
90  object->subdomainSetup();
91  }
92 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
const std::map< SubdomainID, std::vector< std::shared_ptr< T > > > & getActiveBlockObjects(THREAD_ID tid=0) const
bool hasActiveBlockObjects(THREAD_ID tid=0) const
template<typename T >
void MooseObjectWarehouse< T >::timestepSetup ( THREAD_ID  tid = 0) const
virtualinherited

Reimplemented in MaterialWarehouse.

Definition at line 74 of file MooseObjectWarehouse.h.

Referenced by ExecuteMooseObjectWarehouse< T >::setup(), MaterialWarehouse::timestepSetup(), AuxiliarySystem::timestepSetup(), NonlinearSystemBase::timestepSetup(), and FEProblemBase::timestepSetup().

75 {
76  checkThreadID(tid);
77  for (const auto & object : _active_objects[tid])
78  object->timestepSetup();
79 }
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)
template<typename T >
void ExecuteMooseObjectWarehouse< T >::updateActive ( THREAD_ID  tid = 0)
virtual

Updates the active objects storage.

Reimplemented from MooseObjectWarehouseBase< T >.

Reimplemented in AuxGroupExecuteMooseObjectWarehouse< T >, AuxGroupExecuteMooseObjectWarehouse< GeneralUserObject >, AuxGroupExecuteMooseObjectWarehouse< InternalSideUserObject >, AuxGroupExecuteMooseObjectWarehouse< ElementUserObject >, AuxGroupExecuteMooseObjectWarehouse< SideUserObject >, and AuxGroupExecuteMooseObjectWarehouse< NodalUserObject >.

Definition at line 154 of file ExecuteMooseObjectWarehouse.h.

Referenced by ExecuteMooseObjectWarehouse< Transfer >::end(), AuxiliarySystem::updateActive(), AuxGroupExecuteMooseObjectWarehouse< T >::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)
Updates the active objects storage.
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 471 of file MooseObjectWarehouseBase.h.

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

473 {
474  // Clear the active list
475  active.clear();
476 
477  std::copy_if(all.begin(),
478  all.end(),
479  std::back_inserter(active),
480  [](const std::shared_ptr<T> & object) { return object->enabled(); });
481 }
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 564 of file MooseObjectWarehouseBase.h.

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

567 {
568  if (hasActiveBlockObjects(id, tid))
569  updateMatPropDependencyHelper(needed_mat_props, getActiveBlockObjects(id, tid));
570 }
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.
const std::map< SubdomainID, std::vector< std::shared_ptr< T > > > & getActiveBlockObjects(THREAD_ID tid=0) const
bool hasActiveBlockObjects(THREAD_ID tid=0) const
template<typename T >
void MooseObjectWarehouseBase< T >::updateBlockVariableDependency ( SubdomainID  id,
std::set< MooseVariable * > &  needed_moose_vars,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 512 of file MooseObjectWarehouseBase.h.

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

514 {
515  if (hasActiveBlockObjects(id, tid))
516  updateVariableDependencyHelper(needed_moose_vars, getActiveBlockObjects(id, tid));
517 }
const std::map< SubdomainID, std::vector< std::shared_ptr< T > > > & getActiveBlockObjects(THREAD_ID tid=0) const
bool hasActiveBlockObjects(THREAD_ID tid=0) const
static void updateVariableDependencyHelper(std::set< MooseVariable * > &needed_moose_vars, const std::vector< std::shared_ptr< T >> &objects)
Helper method for updating variable dependency vector.
template<typename T >
void MooseObjectWarehouseBase< T >::updateBoundaryMatPropDependency ( std::set< unsigned int > &  needed_mat_props,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 574 of file MooseObjectWarehouseBase.h.

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

576 {
577  if (hasActiveBoundaryObjects(tid))
578  for (auto & active_bnd_object : _active_boundary_objects[tid])
579  updateMatPropDependencyHelper(needed_mat_props, active_bnd_object.second);
580 }
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.
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< T > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
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 584 of file MooseObjectWarehouseBase.h.

586 {
587  if (hasActiveBoundaryObjects(id, tid))
588  updateMatPropDependencyHelper(needed_mat_props, getActiveBoundaryObjects(id, tid));
589 }
const std::map< BoundaryID, std::vector< std::shared_ptr< T > > > & getActiveBoundaryObjects(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.
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
template<typename T >
void MooseObjectWarehouseBase< T >::updateBoundaryVariableDependency ( std::set< MooseVariable * > &  needed_moose_vars,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 521 of file MooseObjectWarehouseBase.h.

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

523 {
524  if (hasActiveBoundaryObjects(tid))
525  {
526  typename std::map<BoundaryID, std::vector<std::shared_ptr<T>>>::const_iterator it;
527  for (const auto & object_pair : _active_boundary_objects[tid])
528  updateVariableDependencyHelper(needed_moose_vars, object_pair.second);
529  }
530 }
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< T > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
static void updateVariableDependencyHelper(std::set< MooseVariable * > &needed_moose_vars, const std::vector< std::shared_ptr< T >> &objects)
Helper method for updating variable dependency vector.
template<typename T >
void MooseObjectWarehouseBase< T >::updateBoundaryVariableDependency ( BoundaryID  id,
std::set< MooseVariable * > &  needed_moose_vars,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 534 of file MooseObjectWarehouseBase.h.

536 {
537  if (hasActiveBoundaryObjects(id, tid))
538  updateVariableDependencyHelper(needed_moose_vars, getActiveBoundaryObjects(id, tid));
539 }
const std::map< BoundaryID, std::vector< std::shared_ptr< T > > > & getActiveBoundaryObjects(THREAD_ID tid=0) const
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
static void updateVariableDependencyHelper(std::set< MooseVariable * > &needed_moose_vars, const std::vector< std::shared_ptr< T >> &objects)
Helper method for updating variable dependency vector.
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 555 of file MooseObjectWarehouseBase.h.

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

557 {
558  if (hasActiveObjects(tid))
559  updateMatPropDependencyHelper(needed_mat_props, _all_objects[tid]);
560 }
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
Convenience functions for determining if objects exist.
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 593 of file MooseObjectWarehouseBase.h.

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

595 {
596  for (auto & object : objects)
597  {
598  auto & mp_deps = object->getMatPropDependencies();
599  needed_mat_props.insert(mp_deps.begin(), mp_deps.end());
600  }
601 }
template<typename T >
void MooseObjectWarehouseBase< T >::updateVariableDependency ( std::set< MooseVariable * > &  needed_moose_vars,
THREAD_ID  tid = 0 
) const
inherited

Update variable dependency vector.

Definition at line 503 of file MooseObjectWarehouseBase.h.

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

505 {
506  if (hasActiveObjects(tid))
507  updateVariableDependencyHelper(needed_moose_vars, _all_objects[tid]);
508 }
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
Convenience functions for determining if objects exist.
static void updateVariableDependencyHelper(std::set< MooseVariable * > &needed_moose_vars, const std::vector< std::shared_ptr< T >> &objects)
Helper method for updating variable dependency vector.
template<typename T>
void MooseObjectWarehouseBase< T >::updateVariableDependencyHelper ( std::set< MooseVariable * > &  needed_moose_vars,
const std::vector< std::shared_ptr< T >> &  objects 
)
staticprotectedinherited

Helper method for updating variable dependency vector.

Definition at line 543 of file MooseObjectWarehouseBase.h.

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

545 {
546  for (const auto & object : objects)
547  {
548  const auto & mv_deps = object->getMooseVariableDependencies();
549  needed_moose_vars.insert(mv_deps.begin(), mv_deps.end());
550  }
551 }

Member Data Documentation

template<typename T>
std::vector<std::map<SubdomainID, std::vector<std::shared_ptr<T> > > > MooseObjectWarehouseBase< T >::_active_block_objects
protectedinherited
template<typename T>
std::vector<std::map<BoundaryID, std::vector<std::shared_ptr<T> > > > MooseObjectWarehouseBase< T >::_active_boundary_objects
protectedinherited
template<typename T>
std::vector<std::vector<std::shared_ptr<T> > > MooseObjectWarehouseBase< T >::_active_objects
protectedinherited
template<typename T>
std::vector<std::map<SubdomainID, std::vector<std::shared_ptr<T> > > > MooseObjectWarehouseBase< T >::_all_block_objects
protectedinherited
template<typename T>
std::vector<std::map<BoundaryID, std::vector<std::shared_ptr<T> > > > MooseObjectWarehouseBase< T >::_all_boundary_objects
protectedinherited
template<typename T>
std::vector<std::vector<std::shared_ptr<T> > > MooseObjectWarehouseBase< T >::_all_objects
protectedinherited
template<typename T>
std::map<ExecFlagType, MooseObjectWarehouse<T> > ExecuteMooseObjectWarehouse< T >::_execute_objects
protected
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 159 of file MooseObjectWarehouseBase.h.

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


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