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

A storage container for MooseObjects that inherit from SetupInterface. More...

#include <ComputeDiracThread.h>

Inheritance diagram for MooseObjectTagWarehouse< T >:
[legend]

Public Member Functions

 MooseObjectTagWarehouse (bool threaded=true)
 Constructor. More...
 
virtual void updateActive (THREAD_ID tid=0) override
 Update the active status of Kernels. More...
 
MooseObjectWarehouse< T > & getVectorTagObjectWarehouse (TagID tag_id, THREAD_ID tid)
 Retrieve a moose object warehouse in which every moose object has the given vector tag. More...
 
MooseObjectWarehouse< T > & getVectorTagsObjectWarehouse (const std::set< TagID > &tags, THREAD_ID tid)
 Retrieve a moose object warehouse in which every moose object at least has one of the given vector tags. More...
 
MooseObjectWarehouse< T > & getMatrixTagObjectWarehouse (TagID tag_id, THREAD_ID tid)
 Retrieve a moose object warehouse in which every moose object has the given matrix tag. More...
 
MooseObjectWarehouse< T > & getMatrixTagsObjectWarehouse (const std::set< TagID > &tags, THREAD_ID tid)
 Retrieve a moose object warehouse in which every moose object has one of the given matrix tags. More...
 
virtual void addObject (std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true) override
 Adds an object to the storage structure. More...
 
unsigned int size (THREAD_ID tid=0)
 Return how many kernels we store in the current warehouse. More...
 
std::set< SubdomainIDgetActiveBlocks (THREAD_ID tid=0) const
 Return a set of active SubdomainsIDs. More...
 
void 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...
 
THREAD_ID numThreads ()
 Return the number of threads. More...
 
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
 
virtual void jacobianSetup (THREAD_ID tid=0) const
 
virtual void residualSetup (THREAD_ID tid=0) const
 
bool hasActiveVariableBlockObjects (unsigned int variable_id, SubdomainID block_id, THREAD_ID tid=0) const
 Methods for checking/getting variable kernels for a variable and SubdomainID. More...
 
const std::vector< std::shared_ptr< T > > & getActiveVariableBlockObjects (unsigned int variable_id, SubdomainID block_id, THREAD_ID tid=0) const
 
const std::vector< std::shared_ptr< T > > & getObjects (THREAD_ID tid=0) const
 Retrieve complete vector to the all/block/boundary restricted objects for a given thread. More...
 
const std::map< SubdomainID, std::vector< std::shared_ptr< T > > > & getBlockObjects (THREAD_ID tid=0) const
 
const std::vector< std::shared_ptr< T > > & getBlockObjects (SubdomainID id, THREAD_ID tid=0) const
 
const std::map< BoundaryID, std::vector< std::shared_ptr< T > > > & getBoundaryObjects (THREAD_ID tid=0) const
 
const std::vector< std::shared_ptr< T > > & getBoundaryObjects (BoundaryID id, THREAD_ID tid=0) const
 
const std::vector< std::shared_ptr< T > > & getActiveObjects (THREAD_ID tid=0) const
 Retrieve complete vector to the active all/block/boundary restricted objects for a given thread. More...
 
const std::map< SubdomainID, std::vector< std::shared_ptr< T > > > & getActiveBlockObjects (THREAD_ID tid=0) const
 
const std::vector< std::shared_ptr< T > > & getActiveBlockObjects (SubdomainID id, THREAD_ID tid=0) const
 
const std::map< BoundaryID, std::vector< std::shared_ptr< T > > > & getActiveBoundaryObjects (THREAD_ID tid=0) const
 
const std::vector< std::shared_ptr< T > > & getActiveBoundaryObjects (BoundaryID id, THREAD_ID tid=0) const
 
bool 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< MooseVariableFEBase *> &needed_moose_vars, THREAD_ID tid=0) const
 Update variable dependency vector. More...
 
void updateBlockVariableDependency (SubdomainID id, std::set< MooseVariableFEBase *> &needed_moose_vars, THREAD_ID tid=0) const
 
void updateBoundaryVariableDependency (std::set< MooseVariableFEBase *> &needed_moose_vars, THREAD_ID tid=0) const
 
void updateBoundaryVariableDependency (BoundaryID id, std::set< MooseVariableFEBase *> &needed_moose_vars, THREAD_ID tid=0) const
 
void updateMatPropDependency (std::set< unsigned int > &needed_mat_props, THREAD_ID tid=0) const
 Update material property dependency vector. More...
 
void updateBlockMatPropDependency (SubdomainID id, std::set< unsigned int > &needed_mat_props, THREAD_ID tid=0) const
 
void updateBoundaryMatPropDependency (std::set< unsigned int > &needed_mat_props, THREAD_ID tid=0) const
 
void updateBoundaryMatPropDependency (BoundaryID id, std::set< unsigned int > &needed_mat_props, THREAD_ID tid=0) const
 

Protected Member Functions

void checkThreadID (THREAD_ID tid) const
 Calls assert on thread id. More...
 

Static Protected Member Functions

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

Protected Attributes

const THREAD_ID _num_threads
 
std::vector< std::map< TagID, MooseObjectWarehouse< T > > > _vector_tag_to_object_warehouse
 Tag based storage. Map from a tag to a moose object warehouse for vector tags. More...
 
std::vector< std::map< std::set< TagID >, MooseObjectWarehouse< T > > > _vector_tags_to_object_warehouse
 std::set<TagID> based storage. Map from a std::set of tags to a moose object warehouse for vector tags. More...
 
std::vector< std::map< TagID, MooseObjectWarehouse< T > > > _matrix_tag_to_object_warehouse
 Tag based storage. Map fro a tag to moose object warehouse for matrix tags. More...
 
std::vector< std::map< std::set< TagID >, MooseObjectWarehouse< T > > > _matrix_tags_to_object_warehouse
 std::set<TagID> based storage. Map from a std::set of tags to moose object warehouse for matrix tags. More...
 
std::map< unsigned int, MooseObjectWarehouse< T > > _variable_objects
 Variable based storage. 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 MooseObjectTagWarehouse< T >

A storage container for MooseObjects that inherit from SetupInterface.

Objects that inherit from SetupInterface have various functions (e.g., initialSetup). This class provides convenience functions for looping over all active Objects stored in the warehouse and calling the setup methods.

Definition at line 21 of file ComputeDiracThread.h.

Constructor & Destructor Documentation

◆ MooseObjectTagWarehouse()

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

Constructor.

Parameters
threadedWhen true (default) threaded storage is enabled.

Definition at line 89 of file MooseObjectTagWarehouse.h.

90  : MooseObjectWarehouse<T>(threaded),
91  _num_threads(threaded ? libMesh::n_threads() : 1),
96 {
97 }
std::vector< std::map< std::set< TagID >, MooseObjectWarehouse< T > > > _vector_tags_to_object_warehouse
std::set<TagID> based storage. Map from a std::set of tags to a moose object warehouse for vector tag...
A storage container for MooseObjects that inherit from SetupInterface.
std::vector< std::map< std::set< TagID >, MooseObjectWarehouse< T > > > _matrix_tags_to_object_warehouse
std::set<TagID> based storage. Map from a std::set of tags to moose object warehouse for matrix tags...
std::vector< std::map< TagID, MooseObjectWarehouse< T > > > _matrix_tag_to_object_warehouse
Tag based storage. Map fro a tag to moose object warehouse for matrix tags.
std::vector< std::map< TagID, MooseObjectWarehouse< T > > > _vector_tag_to_object_warehouse
Tag based storage. Map from a tag to a moose object warehouse for vector tags.

Member Function Documentation

◆ addObject()

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

Adds an object to the storage structure.

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

Reimplemented from MooseObjectWarehouseBase< T >.

Reimplemented in ExecuteMooseObjectWarehouse< T >, ExecuteMooseObjectWarehouse< TransientMultiApp >, ExecuteMooseObjectWarehouse< Sampler >, ExecuteMooseObjectWarehouse< UserObject >, ExecuteMooseObjectWarehouse< AuxScalarKernel >, ExecuteMooseObjectWarehouse< AuxKernel >, ExecuteMooseObjectWarehouse< MultiApp >, ExecuteMooseObjectWarehouse< Control >, ExecuteMooseObjectWarehouse< Transfer >, and ConstraintWarehouse.

Definition at line 92 of file MooseObjectWarehouse.h.

Referenced by NonlinearSystemBase::addBoundaryCondition(), NonlinearSystemBase::addDamper(), NonlinearSystemBase::addDGKernel(), NonlinearSystemBase::addDiracKernel(), FEProblemBase::addFunction(), FEProblemBase::addIndicator(), NonlinearSystemBase::addInterfaceKernel(), MooseEigenSystem::addKernel(), NonlinearSystemBase::addKernel(), FEProblemBase::addMarker(), FEProblemBase::addMaterialHelper(), NonlinearSystemBase::addNodalKernel(), ConstraintWarehouse::addObject(), ExecuteMooseObjectWarehouse< Transfer >::addObjectMask(), MaterialWarehouse::addObjects(), NonlinearSystemBase::addScalarKernel(), and FEProblemBase::checkNonlocalCoupling().

95 {
96  MooseObjectWarehouseBase<T>::addObject(object, tid, recurse);
97 
98  if (recurse)
99  {
100  {
102 
103  if (mvi)
104  _variable_objects[mvi->mooseVariable()->number()].addObject(object, tid, false);
105  }
106 
107  {
109 
110  if (mvi)
111  _variable_objects[mvi->mooseVariable()->number()].addObject(object, tid, false);
112  }
113  }
114 }
std::unique_ptr< T_DEST, T_DELETER > dynamic_pointer_cast(std::unique_ptr< T_SRC, T_DELETER > &src)
std::map< unsigned int, MooseObjectWarehouse< T > > _variable_objects
Variable based storage.
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true)
Adds an object to the storage structure.

◆ checkThreadID()

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

Calls assert on thread id.

Definition at line 673 of file MooseObjectWarehouseBase.h.

674 {
675  mooseAssert(tid < _num_threads,
676  "Attempting to access a thread id ("
677  << tid << ") greater than the number allowed by the storage item ("
678  << _num_threads << ")");
679 }
const THREAD_ID _num_threads
Convenience member storing the number of threads used for storage (1 or libMesh::n_threads) ...

◆ getActiveBlockObjects() [1/2]

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

◆ getActiveBlockObjects() [2/2]

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

Definition at line 394 of file MooseObjectWarehouseBase.h.

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

◆ getActiveBlocks()

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

Return a set of active SubdomainsIDs.

Definition at line 475 of file MooseObjectWarehouseBase.h.

Referenced by FEProblemBase::checkProblemIntegrity().

476 {
477  checkThreadID(tid);
478  std::set<SubdomainID> ids;
479  for (const auto & object_pair : _active_block_objects[tid])
480  ids.insert(object_pair.first);
481  return ids;
482 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< T > > > > _active_block_objects
Active block restricted objects (THREAD_ID on outer vector)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ getActiveBoundaryObjects() [1/2]

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

◆ getActiveBoundaryObjects() [2/2]

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

Definition at line 375 of file MooseObjectWarehouseBase.h.

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

◆ getActiveObject()

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

Definition at line 464 of file MooseObjectWarehouseBase.h.

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

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

◆ getActiveObjects()

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

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

Parameters
tidThe thread id to retrieve objects from

Definition at line 359 of file MooseObjectWarehouseBase.h.

Referenced by FEProblemBase::backupMultiApps(), NonlinearEigenSystem::checkIntegrity(), FEProblemBase::checkProblemIntegrity(), NonlinearSystemBase::computeDamping(), NonlinearSystemBase::computeDiracContributions(), FEProblemBase::computeIndicators(), FEProblemBase::computeMarkers(), FEProblemBase::computeMultiAppsDT(), NonlinearSystemBase::computeResidualInternal(), NonlinearSystemBase::computeScalarKernelsJacobians(), AuxiliarySystem::computeScalarVars(), FEProblemBase::execMultiApps(), FEProblemBase::execMultiAppTransfers(), FEProblemBase::execTransfers(), FEProblemBase::executeSamplers(), FEProblemBase::finishMultiAppStep(), ConstraintWarehouse::getActiveNodalConstraints(), AuxiliarySystem::getDependObjects(), MooseObjectTagWarehouse< InterfaceKernel >::getMatrixTagObjectWarehouse(), MooseObjectTagWarehouse< InterfaceKernel >::getMatrixTagsObjectWarehouse(), FEProblemBase::getTransfers(), MooseObjectTagWarehouse< InterfaceKernel >::getVectorTagObjectWarehouse(), MooseObjectTagWarehouse< InterfaceKernel >::getVectorTagsObjectWarehouse(), FEProblemBase::incrementMultiAppTStep(), ComputeElemDampingThread::onElement(), ComputeDiracThread::onElement(), ComputeNodalDampingThread::onNode(), FEProblemBase::postExecute(), FEProblemBase::projectSolution(), FEProblemBase::restoreMultiApps(), and AuxiliarySystem::setScalarVariableCoupleableTags().

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

◆ getActiveVariableBlockObjects()

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

Definition at line 128 of file MooseObjectWarehouse.h.

Referenced by ComputeFullJacobianThread::computeJacobian().

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

◆ getBlockObjects() [1/2]

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

Definition at line 340 of file MooseObjectWarehouseBase.h.

Referenced by MaterialPropertyDebugOutput::printMaterialMap().

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

◆ getBlockObjects() [2/2]

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

Definition at line 348 of file MooseObjectWarehouseBase.h.

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

◆ getBoundaryObjects() [1/2]

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

Definition at line 321 of file MooseObjectWarehouseBase.h.

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

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

◆ getBoundaryObjects() [2/2]

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

Definition at line 329 of file MooseObjectWarehouseBase.h.

330 {
331  checkThreadID(tid);
332  const auto iter = _all_boundary_objects[tid].find(id);
333  mooseAssert(iter != _all_boundary_objects[tid].end(),
334  "Unable to located active boundary objects for the given id: " << id << ".");
335  return iter->second;
336 }
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

◆ getMatrixTagObjectWarehouse()

template<typename T >
MooseObjectWarehouse< T > & MooseObjectTagWarehouse< T >::getMatrixTagObjectWarehouse ( TagID  tag_id,
THREAD_ID  tid 
)

Retrieve a moose object warehouse in which every moose object has the given matrix tag.

If the warehouse is not constructed yet, it will be constructed here and returned. If the warehouse is already cached (it was queried before), we just directly return the cached warehouse.

Definition at line 153 of file MooseObjectTagWarehouse.h.

Referenced by NonlinearSystemBase::computeJacobianInternal(), NonlinearSystemBase::computeScalarKernelsJacobians(), ComputeNodalKernelBCJacobiansThread::pre(), ComputeNodalKernelJacobiansThread::pre(), ComputeJacobianThread::subdomainChanged(), and ComputeDiracThread::subdomainChanged().

154 {
155  auto & matrix_tag_to_object_warehouse = _matrix_tag_to_object_warehouse[tid];
156 
157  const auto & house_end = matrix_tag_to_object_warehouse.end();
158  const auto & tag_warehouse = matrix_tag_to_object_warehouse.find(tag_id);
159 
160  if (tag_warehouse != house_end)
161  return tag_warehouse->second;
162  else
163  matrix_tag_to_object_warehouse[tag_id];
164 
165  // Add moose objects to matrix-tag warehouse
166  const auto & objects = MooseObjectWarehouse<T>::getActiveObjects(tid);
167  for (auto & object : objects)
168  {
169  auto & tags = object->getMatrixTags();
170  for (auto & tag : tags)
171  {
172  if (tag == tag_id)
173  {
174  // Tag based storage
175  matrix_tag_to_object_warehouse[tag_id].addObject(object, tid);
176 
177  break;
178  }
179  }
180  }
181 
182  return matrix_tag_to_object_warehouse[tag_id];
183 }
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...
std::vector< std::map< TagID, MooseObjectWarehouse< T > > > _matrix_tag_to_object_warehouse
Tag based storage. Map fro a tag to moose object warehouse for matrix tags.

◆ getMatrixTagsObjectWarehouse()

template<typename T >
MooseObjectWarehouse< T > & MooseObjectTagWarehouse< T >::getMatrixTagsObjectWarehouse ( const std::set< TagID > &  tags,
THREAD_ID  tid 
)

Retrieve a moose object warehouse in which every moose object has one of the given matrix tags.

If the warehouse is not constructed yet, it will be constructed here and returned. If the warehouse is already cached (it was queried before), we just directly return the cached warehouse.

Definition at line 226 of file MooseObjectTagWarehouse.h.

Referenced by NonlinearSystemBase::computeJacobianInternal(), NonlinearSystemBase::computeScalarKernelsJacobians(), ComputeNodalKernelBCJacobiansThread::pre(), ComputeNodalKernelJacobiansThread::pre(), ComputeJacobianThread::subdomainChanged(), and ComputeDiracThread::subdomainChanged().

228 {
229  auto & matrix_tags_to_object_warehouse = _matrix_tags_to_object_warehouse[tid];
230 
231  const auto & house_end = matrix_tags_to_object_warehouse.end();
232  const auto & tags_warehouse = matrix_tags_to_object_warehouse.find(m_tags);
233 
234  if (tags_warehouse != house_end)
235  return tags_warehouse->second;
236  else
237  matrix_tags_to_object_warehouse[m_tags];
238 
239  const auto & objects = MooseObjectWarehouse<T>::getActiveObjects(tid);
240  for (auto & object : objects)
241  {
242  auto & tags = object->getMatrixTags();
243  const auto & tags_end = tags.end();
244  for (auto & m_tag : m_tags)
245  {
246  const auto & tag_found = tags.find(m_tag);
247  // Object contains at least one of required tags
248  if (tag_found != tags_end)
249  {
250  // std::vector<Tag> based storage
251  matrix_tags_to_object_warehouse[m_tags].addObject(object, tid);
252  // Then we should work for next object
253  break;
254  }
255  }
256  }
257 
258  return matrix_tags_to_object_warehouse[m_tags];
259 }
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...
std::vector< std::map< std::set< TagID >, MooseObjectWarehouse< T > > > _matrix_tags_to_object_warehouse
std::set<TagID> based storage. Map from a std::set of tags to moose object warehouse for matrix tags...

◆ getObjects()

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

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

Parameters
tidThe thread id to retrieve objects from

Definition at line 313 of file MooseObjectWarehouseBase.h.

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

314 {
315  checkThreadID(tid);
316  return _all_objects[tid];
317 }
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.

◆ getVectorTagObjectWarehouse()

template<typename T >
MooseObjectWarehouse< T > & MooseObjectTagWarehouse< T >::getVectorTagObjectWarehouse ( TagID  tag_id,
THREAD_ID  tid 
)

Retrieve a moose object warehouse in which every moose object has the given vector tag.

If the warehouse is not constructed yet, it will be constructed here and returned. If the warehouse is already cached (it was queried before), we just directly return the cached warehouse.

Definition at line 120 of file MooseObjectTagWarehouse.h.

Referenced by NonlinearSystemBase::computeNodalBCs(), NonlinearSystemBase::computeResidualInternal(), NonlinearSystemBase::containsTimeKernel(), ComputeNodalKernelBcsThread::pre(), ComputeNodalKernelsThread::pre(), ComputeResidualThread::subdomainChanged(), and ComputeDiracThread::subdomainChanged().

121 {
122  auto & vector_tag_to_object_warehouse = _vector_tag_to_object_warehouse[tid];
123 
124  const auto & house_end = vector_tag_to_object_warehouse.end();
125  const auto & tag_warehouse = vector_tag_to_object_warehouse.find(tag_id);
126 
127  if (tag_warehouse != house_end)
128  return tag_warehouse->second;
129  else
130  vector_tag_to_object_warehouse[tag_id];
131 
132  // Now add actual moose objects into warehouse
133  const auto & objects = MooseObjectWarehouse<T>::getActiveObjects(tid);
134  for (auto & object : objects)
135  {
136  auto & tags = object->getVectorTags();
137  for (auto & tag : tags)
138  {
139  if (tag == tag_id)
140  {
141  // Tag based storage
142  vector_tag_to_object_warehouse[tag_id].addObject(object, tid);
143  break;
144  }
145  }
146  }
147 
148  return vector_tag_to_object_warehouse[tag_id];
149 }
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...
std::vector< std::map< TagID, MooseObjectWarehouse< T > > > _vector_tag_to_object_warehouse
Tag based storage. Map from a tag to a moose object warehouse for vector tags.

◆ getVectorTagsObjectWarehouse()

template<typename T >
MooseObjectWarehouse< T > & MooseObjectTagWarehouse< T >::getVectorTagsObjectWarehouse ( const std::set< TagID > &  tags,
THREAD_ID  tid 
)

Retrieve a moose object warehouse in which every moose object at least has one of the given vector tags.

If the warehouse is not constructed yet, it will be constructed here and returned. If the warehouse is already cached (it was queried before), we just directly return the cached warehouse.

Definition at line 187 of file MooseObjectTagWarehouse.h.

Referenced by NonlinearSystemBase::computeNodalBCs(), NonlinearSystemBase::computeResidualInternal(), ComputeNodalKernelBcsThread::pre(), ComputeNodalKernelsThread::pre(), ComputeResidualThread::subdomainChanged(), and ComputeDiracThread::subdomainChanged().

189 {
190  // std::map is not thread-safe for writes
191  auto & vector_tags_to_object_warehouse = _vector_tags_to_object_warehouse[tid];
192 
193  const auto & house_end = vector_tags_to_object_warehouse.end();
194  const auto & tags_warehouse = vector_tags_to_object_warehouse.find(v_tags);
195 
196  if (tags_warehouse != house_end)
197  return tags_warehouse->second;
198  else
199  vector_tags_to_object_warehouse[v_tags];
200 
201  // Add moose objects to vector-tags warehouse
202  const auto & objects = MooseObjectWarehouse<T>::getActiveObjects(tid);
203  for (auto & object : objects)
204  {
205  auto & tags = object->getVectorTags();
206  const auto & tags_end = tags.end();
207  for (auto & v_tag : v_tags)
208  {
209  const auto & tag_found = tags.find(v_tag);
210  // Object contains at least one of required tags
211  if (tag_found != tags_end)
212  {
213  // std::vector<Tag> based storage
214  vector_tags_to_object_warehouse[v_tags].addObject(object, tid);
215  // Then we should work for next object
216  break;
217  }
218  }
219  }
220 
221  return vector_tags_to_object_warehouse[v_tags];
222 }
std::vector< std::map< std::set< TagID >, MooseObjectWarehouse< T > > > _vector_tags_to_object_warehouse
std::set<TagID> based storage. Map from a std::set of tags to a moose object warehouse for vector tag...
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...

◆ hasActiveBlockObjects() [1/2]

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

Definition at line 413 of file MooseObjectWarehouseBase.h.

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

414 {
415  checkThreadID(tid);
416  bool has_active_block_objects = false;
417  for (const auto & object_pair : _active_block_objects[tid])
418  has_active_block_objects |= !(object_pair.second.empty());
419  return has_active_block_objects;
420 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< T > > > > _active_block_objects
Active block restricted objects (THREAD_ID on outer vector)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ hasActiveBlockObjects() [2/2]

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

Definition at line 424 of file MooseObjectWarehouseBase.h.

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

◆ hasActiveBoundaryObjects() [1/2]

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

Definition at line 433 of file MooseObjectWarehouseBase.h.

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

434 {
435  checkThreadID(tid);
436  bool has_active_boundary_objects = false;
437  for (const auto & object_pair : _active_boundary_objects[tid])
438  has_active_boundary_objects |= !(object_pair.second.empty());
439  return has_active_boundary_objects;
440 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< T > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)

◆ hasActiveBoundaryObjects() [2/2]

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

Definition at line 444 of file MooseObjectWarehouseBase.h.

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

◆ hasActiveObject()

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

Convenience functions for checking/getting specific objects.

Definition at line 453 of file MooseObjectWarehouseBase.h.

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

454 {
455  checkThreadID(tid);
456  for (const auto & object : _active_objects[tid])
457  if (object->name() == name)
458  return true;
459  return false;
460 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::vector< std::shared_ptr< T > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ hasActiveObjects()

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

◆ hasActiveVariableBlockObjects()

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

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

Definition at line 118 of file MooseObjectWarehouse.h.

Referenced by ComputeFullJacobianThread::computeJacobian().

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

◆ initialSetup()

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

Convenience methods for calling object setup methods.

Reimplemented in MaterialWarehouse.

Definition at line 142 of file MooseObjectWarehouse.h.

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

143 {
144  checkThreadID(tid);
145  for (const auto & object : _active_objects[tid])
146  object->initialSetup();
147 }
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)

◆ jacobianSetup()

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

◆ numThreads()

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

Return the number of threads.

Definition at line 161 of file MooseObjectWarehouseBase.h.

Referenced by NonlinearEigenSystem::addEigenTagToMooseObjects().

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

◆ residualSetup()

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

◆ size()

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

Return how many kernels we store in the current warehouse.

Definition at line 233 of file MooseObjectWarehouseBase.h.

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

◆ sort()

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

Sort the objects using the DependencyResolver.

Definition at line 515 of file MooseObjectWarehouseBase.h.

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

516 {
517  checkThreadID(tid);
518 
519  for (auto & object_pair : _all_block_objects[tid])
520  sortHelper(object_pair.second);
521 
522  for (auto & object_pair : _all_boundary_objects[tid])
523  sortHelper(object_pair.second);
524 
525  sortHelper(_all_objects[tid]);
526 
527  // The active lists now must be update to reflect the order changes
528  updateActive(tid);
529 }
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.

◆ sortHelper()

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

Helper method for sorting vectors of objects.

Definition at line 653 of file MooseObjectWarehouseBase.h.

654 {
655  // Do nothing if the vector is empty
656  if (objects.empty())
657  return;
658 
659  try
660  {
661  // Sort based on dependencies
662  DependencyResolverInterface::sort<std::shared_ptr<T>>(objects);
663  }
664  catch (CyclicDependencyException<std::shared_ptr<T>> & e)
665  {
666  DependencyResolverInterface::cyclicDependencyError<std::shared_ptr<T>>(
667  e, "Cyclic dependency detected in object ordering");
668  }
669 }

◆ subdomainsCovered()

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

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

Definition at line 640 of file MooseObjectWarehouseBase.h.

Referenced by NonlinearSystemBase::checkKernelCoverage().

643 {
644  for (const auto & object : _active_objects[tid])
645  unique_variables.insert(object->variable().name());
646 
647  for (const auto & object_pair : _active_block_objects[tid])
648  subdomains_covered.insert(object_pair.first);
649 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< T > > > > _active_block_objects
Active block restricted objects (THREAD_ID on outer vector)
std::vector< std::vector< std::shared_ptr< T > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ subdomainSetup() [1/2]

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

Reimplemented in MaterialWarehouse.

Definition at line 173 of file MooseObjectWarehouse.h.

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

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

◆ subdomainSetup() [2/2]

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

Reimplemented in MaterialWarehouse.

Definition at line 160 of file MooseObjectWarehouse.h.

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

◆ timestepSetup()

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

Reimplemented in MaterialWarehouse.

Definition at line 151 of file MooseObjectWarehouse.h.

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

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

◆ updateActive()

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

Update the active status of Kernels.

Reimplemented from MooseObjectWarehouse< T >.

Definition at line 101 of file MooseObjectTagWarehouse.h.

Referenced by NonlinearSystemBase::updateActive().

102 {
104 
105  for (auto & it : _vector_tag_to_object_warehouse[tid])
106  it.second.updateActive(tid);
107 
108  for (auto & it : _vector_tags_to_object_warehouse[tid])
109  it.second.updateActive(tid);
110 
111  for (auto & it : _matrix_tag_to_object_warehouse[tid])
112  it.second.updateActive(tid);
113 
114  for (auto & it : _matrix_tags_to_object_warehouse[tid])
115  it.second.updateActive(tid);
116 }
std::vector< std::map< std::set< TagID >, MooseObjectWarehouse< T > > > _vector_tags_to_object_warehouse
std::set<TagID> based storage. Map from a std::set of tags to a moose object warehouse for vector tag...
std::vector< std::map< std::set< TagID >, MooseObjectWarehouse< T > > > _matrix_tags_to_object_warehouse
std::set<TagID> based storage. Map from a std::set of tags to moose object warehouse for matrix tags...
std::vector< std::map< TagID, MooseObjectWarehouse< T > > > _matrix_tag_to_object_warehouse
Tag based storage. Map fro a tag to moose object warehouse for matrix tags.
virtual void updateActive(THREAD_ID tid=0) override
Update the active status of Kernels.
std::vector< std::map< TagID, MooseObjectWarehouse< T > > > _vector_tag_to_object_warehouse
Tag based storage. Map from a tag to a moose object warehouse for vector tags.

◆ updateActiveHelper()

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

Helper method for updating active vectors.

Definition at line 501 of file MooseObjectWarehouseBase.h.

503 {
504  // Clear the active list
505  active.clear();
506 
507  std::copy_if(all.begin(),
508  all.end(),
509  std::back_inserter(active),
510  [](const std::shared_ptr<T> & object) { return object->enabled(); });
511 }

◆ updateBlockMatPropDependency()

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

Definition at line 599 of file MooseObjectWarehouseBase.h.

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

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

◆ updateBlockVariableDependency()

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

Definition at line 542 of file MooseObjectWarehouseBase.h.

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

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

◆ updateBoundaryMatPropDependency() [1/2]

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

Definition at line 609 of file MooseObjectWarehouseBase.h.

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

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

◆ updateBoundaryMatPropDependency() [2/2]

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

Definition at line 619 of file MooseObjectWarehouseBase.h.

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

◆ updateBoundaryVariableDependency() [1/2]

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

Definition at line 553 of file MooseObjectWarehouseBase.h.

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

555 {
556  if (hasActiveBoundaryObjects(tid))
557  {
558  typename std::map<BoundaryID, std::vector<std::shared_ptr<T>>>::const_iterator it;
559  for (const auto & object_pair : _active_boundary_objects[tid])
560  updateVariableDependencyHelper(needed_moose_vars, object_pair.second);
561  }
562 }
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< T > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)
static void updateVariableDependencyHelper(std::set< MooseVariableFEBase *> &needed_moose_vars, const std::vector< std::shared_ptr< T >> &objects)
Helper method for updating variable dependency vector.

◆ updateBoundaryVariableDependency() [2/2]

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

Definition at line 566 of file MooseObjectWarehouseBase.h.

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

◆ updateMatPropDependency()

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

Update material property dependency vector.

Definition at line 590 of file MooseObjectWarehouseBase.h.

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

592 {
593  if (hasActiveObjects(tid))
594  updateMatPropDependencyHelper(needed_mat_props, _all_objects[tid]);
595 }
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.

◆ updateMatPropDependencyHelper()

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

Helper method for updating material property dependency vector.

Definition at line 628 of file MooseObjectWarehouseBase.h.

630 {
631  for (auto & object : objects)
632  {
633  auto & mp_deps = object->getMatPropDependencies();
634  needed_mat_props.insert(mp_deps.begin(), mp_deps.end());
635  }
636 }

◆ updateVariableDependency()

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

Update variable dependency vector.

Definition at line 533 of file MooseObjectWarehouseBase.h.

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

535 {
536  if (hasActiveObjects(tid))
537  updateVariableDependencyHelper(needed_moose_vars, _all_objects[tid]);
538 }
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< MooseVariableFEBase *> &needed_moose_vars, const std::vector< std::shared_ptr< T >> &objects)
Helper method for updating variable dependency vector.

◆ updateVariableDependencyHelper()

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

Helper method for updating variable dependency vector.

Definition at line 577 of file MooseObjectWarehouseBase.h.

580 {
581  for (const auto & object : objects)
582  {
583  const auto & mv_deps = object->getMooseVariableDependencies();
584  needed_moose_vars.insert(mv_deps.begin(), mv_deps.end());
585  }
586 }

Member Data Documentation

◆ _active_block_objects

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

Active block restricted objects (THREAD_ID on outer vector)

Definition at line 177 of file MooseObjectWarehouseBase.h.

◆ _active_boundary_objects

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

Active boundary restricted objects (THREAD_ID on outer vector)

Definition at line 183 of file MooseObjectWarehouseBase.h.

◆ _active_objects

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

All active objects (THREAD_ID on outer vector)

Definition at line 171 of file MooseObjectWarehouseBase.h.

◆ _all_block_objects

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

Definition at line 174 of file MooseObjectWarehouseBase.h.

◆ _all_boundary_objects

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

Definition at line 180 of file MooseObjectWarehouseBase.h.

◆ _all_objects

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

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

Definition at line 168 of file MooseObjectWarehouseBase.h.

◆ _matrix_tag_to_object_warehouse

template<typename T>
std::vector<std::map<TagID, MooseObjectWarehouse<T> > > MooseObjectTagWarehouse< T >::_matrix_tag_to_object_warehouse
protected

Tag based storage. Map fro a tag to moose object warehouse for matrix tags.

Definition at line 82 of file MooseObjectTagWarehouse.h.

◆ _matrix_tags_to_object_warehouse

template<typename T>
std::vector<std::map<std::set<TagID>, MooseObjectWarehouse<T> > > MooseObjectTagWarehouse< T >::_matrix_tags_to_object_warehouse
protected

std::set<TagID> based storage. Map from a std::set of tags to moose object warehouse for matrix tags.

Definition at line 85 of file MooseObjectTagWarehouse.h.

◆ _num_threads

template<typename T>
const THREAD_ID MooseObjectTagWarehouse< T >::_num_threads
protected

Definition at line 73 of file MooseObjectTagWarehouse.h.

◆ _variable_objects

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

Variable based storage.

Definition at line 81 of file MooseObjectWarehouse.h.

◆ _vector_tag_to_object_warehouse

template<typename T>
std::vector<std::map<TagID, MooseObjectWarehouse<T> > > MooseObjectTagWarehouse< T >::_vector_tag_to_object_warehouse
protected

Tag based storage. Map from a tag to a moose object warehouse for vector tags.

Definition at line 76 of file MooseObjectTagWarehouse.h.

◆ _vector_tags_to_object_warehouse

template<typename T>
std::vector<std::map<std::set<TagID>, MooseObjectWarehouse<T> > > MooseObjectTagWarehouse< T >::_vector_tags_to_object_warehouse
protected

std::set<TagID> based storage. Map from a std::set of tags to a moose object warehouse for vector tags.

Definition at line 79 of file MooseObjectTagWarehouse.h.


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