www.mooseframework.org
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
MooseObjectWarehouseBase< T > Class Template Reference

A base storage container for MooseObjects. More...

#include <MooseObjectWarehouseBase.h>

Inheritance diagram for MooseObjectWarehouseBase< T >:
[legend]

Public Member Functions

 MooseObjectWarehouseBase (bool threaded=true)
 Constructor. More...
 
virtual ~MooseObjectWarehouseBase ()
 Destructor. More...
 
virtual void addObject (std::shared_ptr< T > object, THREAD_ID tid=0)
 Adds an object to the storage structure. More...
 
std::set< SubdomainIDgetActiveBlocks (THREAD_ID tid=0) const
 Return a set of active SubdomainsIDs. More...
 
virtual void updateActive (THREAD_ID tid=0)
 Updates the active objects storage. More...
 
void sort (THREAD_ID tid=0)
 Sort the objects using the DependencyResolver. 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 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

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

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 MooseObjectWarehouseBase< T >

A base storage container for MooseObjects.

Definition at line 33 of file MooseObjectWarehouseBase.h.

Constructor & Destructor Documentation

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

Constructor.

Parameters
threadedWhen true (default) threaded storage is enabled.

Definition at line 209 of file MooseObjectWarehouseBase.h.

210  : _num_threads(threaded ? libMesh::n_threads() : 1),
217 {
218 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< T > > > > _all_block_objects
std::vector< std::vector< std::shared_ptr< T > > > _all_objects
Storage container for the ALL pointers (THREAD_ID on outer vector)
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< T > > > > _active_block_objects
Active block restricted objects (THREAD_ID on outer vector)
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< T > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< T > > > > _all_boundary_objects
const THREAD_ID _num_threads
Convenience member storing the number of threads used for storage (1 or libMesh::n_threads) ...
std::vector< std::vector< std::shared_ptr< T > > > _active_objects
All active objects (THREAD_ID on outer vector)
template<typename T >
MooseObjectWarehouseBase< T >::~MooseObjectWarehouseBase ( )
virtual

Destructor.

Definition at line 221 of file MooseObjectWarehouseBase.h.

222 {
223 }

Member Function Documentation

template<typename T>
void MooseObjectWarehouseBase< 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 in ExecuteMooseObjectWarehouse< T >, ExecuteMooseObjectWarehouse< TransientMultiApp >, ExecuteMooseObjectWarehouse< Sampler >, ExecuteMooseObjectWarehouse< GeneralUserObject >, ExecuteMooseObjectWarehouse< UserObject >, ExecuteMooseObjectWarehouse< AuxScalarKernel >, ExecuteMooseObjectWarehouse< InternalSideUserObject >, ExecuteMooseObjectWarehouse< ElementUserObject >, ExecuteMooseObjectWarehouse< SideUserObject >, ExecuteMooseObjectWarehouse< NodalUserObject >, ExecuteMooseObjectWarehouse< AuxKernel >, ExecuteMooseObjectWarehouse< MultiApp >, ExecuteMooseObjectWarehouse< Control >, ExecuteMooseObjectWarehouse< Transfer >, ConstraintWarehouse, KernelWarehouse, and InitialConditionWarehouse.

Definition at line 227 of file MooseObjectWarehouseBase.h.

Referenced by NonlinearSystemBase::addBoundaryCondition(), NonlinearSystemBase::addDamper(), NonlinearSystemBase::addDGKernel(), NonlinearSystemBase::addDiracKernel(), FEProblemBase::addDistribution(), FEProblemBase::addFunction(), FEProblemBase::addIndicator(), FEProblemBase::addInitialCondition(), NonlinearSystemBase::addInterfaceKernel(), FEProblemBase::addMarker(), FEProblemBase::addMaterial(), NonlinearSystemBase::addNodalKernel(), InitialConditionWarehouse::addObject(), KernelWarehouse::addObject(), ConstraintWarehouse::addObject(), ExecuteMooseObjectWarehouse< T >::addObjectMask(), MaterialWarehouse::addObjects(), NonlinearSystemBase::addScalarKernel(), NonlinearSystemBase::addSplit(), and FEProblemBase::checkNonlocalCoupling().

228 {
229  checkThreadID(tid);
230 
231  // Stores object in list of all objects
232  _all_objects[tid].push_back(object);
233 
234  // If enabled, store object in a list of all active
235  bool enabled = object->enabled();
236  if (enabled)
237  _active_objects[tid].push_back(object);
238 
239  // Perform casts to the Block/BoundaryRestrictable
240  std::shared_ptr<BoundaryRestrictable> bnd =
241  std::dynamic_pointer_cast<BoundaryRestrictable>(object);
242  std::shared_ptr<BlockRestrictable> blk = std::dynamic_pointer_cast<BlockRestrictable>(object);
243 
244  // Boundary Restricted
245  if (bnd && bnd->boundaryRestricted())
246  {
247  const std::set<BoundaryID> & ids = bnd->boundaryIDs();
248  for (std::set<BoundaryID>::const_iterator it = ids.begin(); it != ids.end(); ++it)
249  {
250  _all_boundary_objects[tid][*it].push_back(object);
251  if (enabled)
252  _active_boundary_objects[tid][*it].push_back(object);
253  }
254  }
255 
256  // Block Restricted
257  else if (blk)
258  {
259  const std::set<SubdomainID> & ids =
260  blk->blockRestricted() ? blk->blockIDs() : blk->meshBlockIDs();
261  for (std::set<SubdomainID>::const_iterator it = ids.begin(); it != ids.end(); ++it)
262  {
263  _all_block_objects[tid][*it].push_back(object);
264  if (enabled)
265  _active_block_objects[tid][*it].push_back(object);
266  }
267 
268  // Check variables
269  std::shared_ptr<Coupleable> c_ptr = std::dynamic_pointer_cast<Coupleable>(object);
270  if (c_ptr)
271  for (MooseVariable * var : c_ptr->getCoupledMooseVars())
272  blk->checkVariable(*var);
273 
274  std::shared_ptr<MooseVariableInterface> mvi_ptr =
275  std::dynamic_pointer_cast<MooseVariableInterface>(object);
276  if (mvi_ptr)
277  blk->checkVariable(*(mvi_ptr->mooseVariable()));
278  }
279 }
Class for stuff related to variables.
Definition: MooseVariable.h:43
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< T > > > > _all_block_objects
std::vector< std::vector< std::shared_ptr< T > > > _all_objects
Storage container for the ALL pointers (THREAD_ID on outer vector)
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< T > > > > _active_block_objects
Active block restricted objects (THREAD_ID on outer vector)
/class BoundaryRestrictable /brief Provides functionality for limiting the object to certain boundary...
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)
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< T > > > > _all_boundary_objects
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:35
Interface for objects that need to get values of MooseVariables.
An interface that restricts an object to subdomains via the &#39;blocks&#39; input parameter.
std::vector< std::vector< std::shared_ptr< T > > > _active_objects
All active objects (THREAD_ID on outer vector)
template<typename T>
void MooseObjectWarehouseBase< T >::checkThreadID ( THREAD_ID  tid) const
inlineprotected

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 >
const std::map< SubdomainID, std::vector< std::shared_ptr< T > > > & MooseObjectWarehouseBase< T >::getActiveBlockObjects ( THREAD_ID  tid = 0) const
inline

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

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

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
inline

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

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

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
inline

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
inline

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

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
inline

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

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
inline

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 >
bool MooseObjectWarehouseBase< T >::hasActiveBlockObjects ( THREAD_ID  tid = 0) const

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

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

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

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

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
template<typename T >
void MooseObjectWarehouseBase< T >::sort ( THREAD_ID  tid = 0)

Sort the objects using the DependencyResolver.

Definition at line 485 of file MooseObjectWarehouseBase.h.

Referenced by InitialConditionWarehouse::initialSetup(), FEProblemBase::initialSetup(), and MaterialWarehouse::sort().

486 {
487  checkThreadID(tid);
488 
489  for (auto & object_pair : _all_block_objects[tid])
490  sortHelper(object_pair.second);
491 
492  for (auto & object_pair : _all_boundary_objects[tid])
493  sortHelper(object_pair.second);
494 
495  sortHelper(_all_objects[tid]);
496 
497  // The active lists now must be update to reflect the order changes
498  updateActive(tid);
499 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< T > > > > _all_block_objects
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.
static void sortHelper(std::vector< std::shared_ptr< T >> &objects)
Helper method for sorting vectors of objects.
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< T > > > > _all_boundary_objects
virtual void updateActive(THREAD_ID tid=0)
Updates the active objects storage.
template<typename T>
void MooseObjectWarehouseBase< T >::sortHelper ( std::vector< std::shared_ptr< T >> &  objects)
staticprotected

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

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 MooseObjectWarehouseBase< T >::updateActive ( THREAD_ID  tid = 0)
virtual

Updates the active objects storage.

Reimplemented in ExecuteMooseObjectWarehouse< T >, ExecuteMooseObjectWarehouse< TransientMultiApp >, ExecuteMooseObjectWarehouse< Sampler >, ExecuteMooseObjectWarehouse< GeneralUserObject >, ExecuteMooseObjectWarehouse< UserObject >, ExecuteMooseObjectWarehouse< AuxScalarKernel >, ExecuteMooseObjectWarehouse< InternalSideUserObject >, ExecuteMooseObjectWarehouse< ElementUserObject >, ExecuteMooseObjectWarehouse< SideUserObject >, ExecuteMooseObjectWarehouse< NodalUserObject >, ExecuteMooseObjectWarehouse< AuxKernel >, ExecuteMooseObjectWarehouse< MultiApp >, ExecuteMooseObjectWarehouse< Control >, ExecuteMooseObjectWarehouse< Transfer >, ConstraintWarehouse, AuxGroupExecuteMooseObjectWarehouse< T >, AuxGroupExecuteMooseObjectWarehouse< GeneralUserObject >, AuxGroupExecuteMooseObjectWarehouse< InternalSideUserObject >, AuxGroupExecuteMooseObjectWarehouse< ElementUserObject >, AuxGroupExecuteMooseObjectWarehouse< SideUserObject >, AuxGroupExecuteMooseObjectWarehouse< NodalUserObject >, KernelWarehouse, and MaterialWarehouse.

Definition at line 456 of file MooseObjectWarehouseBase.h.

Referenced by MooseObjectWarehouseBase< T >::sort(), MaterialWarehouse::updateActive(), KernelWarehouse::updateActive(), ConstraintWarehouse::updateActive(), ExecuteMooseObjectWarehouse< T >::updateActive(), NonlinearSystemBase::updateActive(), and FEProblemBase::updateActiveObjects().

457 {
458  checkThreadID(tid);
459 
461 
462  for (const auto & object_pair : _all_block_objects[tid])
463  updateActiveHelper(_active_block_objects[tid][object_pair.first], object_pair.second);
464 
465  for (const auto & object_pair : _all_boundary_objects[tid])
466  updateActiveHelper(_active_boundary_objects[tid][object_pair.first], object_pair.second);
467 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< T > > > > _all_block_objects
std::vector< std::vector< std::shared_ptr< T > > > _all_objects
Storage container for the ALL pointers (THREAD_ID on outer vector)
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.
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< T > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< T > > > > _all_boundary_objects
std::vector< std::vector< std::shared_ptr< T > > > _active_objects
All active objects (THREAD_ID on outer vector)
static void updateActiveHelper(std::vector< std::shared_ptr< T >> &active, const std::vector< std::shared_ptr< T >> &all)
Helper method for updating active vectors.
template<typename T>
void MooseObjectWarehouseBase< T >::updateActiveHelper ( std::vector< std::shared_ptr< T >> &  active,
const std::vector< std::shared_ptr< T >> &  all 
)
staticprotected

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

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

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

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

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

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

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

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

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

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

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
protected
template<typename T>
std::vector<std::map<BoundaryID, std::vector<std::shared_ptr<T> > > > MooseObjectWarehouseBase< T >::_active_boundary_objects
protected
template<typename T>
std::vector<std::vector<std::shared_ptr<T> > > MooseObjectWarehouseBase< T >::_active_objects
protected
template<typename T>
std::vector<std::map<SubdomainID, std::vector<std::shared_ptr<T> > > > MooseObjectWarehouseBase< T >::_all_block_objects
protected
template<typename T>
std::vector<std::map<BoundaryID, std::vector<std::shared_ptr<T> > > > MooseObjectWarehouseBase< T >::_all_boundary_objects
protected
template<typename T>
std::vector<std::vector<std::shared_ptr<T> > > MooseObjectWarehouseBase< T >::_all_objects
protected
template<typename T>
const THREAD_ID MooseObjectWarehouseBase< T >::_num_threads
protected

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: