https://mooseframework.inl.gov
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | 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, bool recurse=true)
 Adds an object to the storage structure. More...
 
unsigned int size (THREAD_ID tid=0) const
 Return how many kernels we store in the current warehouse. More...
 
bool hasObjectsForVariableAndBlocks (const VariableName &var_name, const std::set< SubdomainID > &blocks, std::set< SubdomainID > &blocks_covered, THREAD_ID tid) const
 Whether there are objects for this variable and the set of blocks passed. More...
 
std::set< SubdomainIDgetActiveBlocks (THREAD_ID tid=0) const
 Return a set of active SubdomainsIDs. More...
 
const std::vector< std::shared_ptr< T > > & getObjectsForVariable (const VariableName &var_name, THREAD_ID tid) const
 Getter for objects that have the 'variable' set to a particular variable Note that users should check whether there are objects using 'hasObjectsForVariable' before calling this routine, because it will throw if there are no objects for this variable. 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...
 
THREAD_ID numThreads () const
 Return the number of threads. More...
 
std::string activeObjectsToFormattedString (THREAD_ID tid=0, const std::string &prefix="[DBG]") const
 Output the active content of the warehouse to a string, meant to be output to the console. 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 hasObjects (THREAD_ID tid=0) const
 Convenience functions for determining if objects exist. More...
 
bool hasActiveObjects (THREAD_ID tid=0) const
 
bool hasObjectsForVariable (const VariableName &var_name, THREAD_ID tid) const
 
bool hasActiveBlockObjects (THREAD_ID tid=0) const
 
bool hasActiveBlockObjects (SubdomainID id, THREAD_ID tid=0) const
 
bool hasActiveBoundaryObjects (THREAD_ID tid=0) const
 
bool hasActiveBoundaryObjects (BoundaryID id, THREAD_ID tid=0) const
 
bool hasBoundaryObjects (BoundaryID id, THREAD_ID tid=0) const
 
bool hasActiveObject (const std::string &name, THREAD_ID tid=0) const
 Convenience functions for checking/getting specific objects. More...
 
std::shared_ptr< T > getObject (const std::string &name, THREAD_ID tid=0) const
 
std::shared_ptr< T > getActiveObject (const std::string &name, THREAD_ID tid=0) const
 
void updateVariableDependency (std::set< MooseVariableFieldBase *> &needed_moose_vars, THREAD_ID tid=0) const
 Update variable dependency vector. More...
 
void updateBlockVariableDependency (SubdomainID id, std::set< MooseVariableFieldBase *> &needed_moose_vars, THREAD_ID tid=0) const
 
void updateBoundaryVariableDependency (std::set< MooseVariableFieldBase *> &needed_moose_vars, THREAD_ID tid=0) const
 
void updateBoundaryVariableDependency (BoundaryID id, std::set< MooseVariableFieldBase *> &needed_moose_vars, THREAD_ID tid=0) const
 
void updateBlockFEVariableCoupledVectorTagDependency (SubdomainID id, std::set< TagID > &needed_fe_var_vector_tags, THREAD_ID tid=0) const
 Update FE variable coupleable vector tag vector. More...
 
void updateBoundaryFEVariableCoupledVectorTagDependency (BoundaryID id, std::set< TagID > &needed_fe_var_vector_tags, THREAD_ID tid=0) const
 
void updateMatPropDependency (std::unordered_set< unsigned int > &needed_mat_props, THREAD_ID tid=0) const
 Update material property dependency vector. More...
 
void updateBlockMatPropDependency (SubdomainID id, std::unordered_set< unsigned int > &needed_mat_props, THREAD_ID tid=0) const
 
void updateBoundaryMatPropDependency (std::unordered_set< unsigned int > &needed_mat_props, THREAD_ID tid=0) const
 
void updateBoundaryMatPropDependency (BoundaryID id, std::unordered_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< MooseVariableFieldBase *> &needed_moose_vars, const std::vector< std::shared_ptr< T >> &objects)
 Helper method for updating variable dependency vector. More...
 
static void updateFEVariableCoupledVectorTagDependencyHelper (std::set< TagID > &needed_fe_var_vector_tags, const std::vector< std::shared_ptr< T >> &objects)
 Helper method for updating FE variable coupleable vector tag vector. More...
 
static void updateMatPropDependencyHelper (std::unordered_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...
 
std::vector< std::map< VariableName, std::vector< std::shared_ptr< T > > > > _all_variable_objects
 All objects with a certain variable selected, as the 'variable' parameter. More...
 

Friends

class MaterialWarehouse
 

Detailed Description

template<typename T>
class MooseObjectWarehouseBase< T >

A base storage container for MooseObjects.

Definition at line 30 of file MooseObjectWarehouseBase.h.

Constructor & Destructor Documentation

◆ MooseObjectWarehouseBase()

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

Constructor.

Parameters
threadedWhen true (default) threaded storage is enabled.

Definition at line 270 of file MooseObjectWarehouseBase.h.

271  : _num_threads(threaded ? libMesh::n_threads() : 1),
279 {
280 }
unsigned int n_threads()
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< VariableName, std::vector< std::shared_ptr< T > > > > _all_variable_objects
All objects with a certain variable selected, as the &#39;variable&#39; parameter.
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)

◆ ~MooseObjectWarehouseBase()

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

Destructor.

Definition at line 283 of file MooseObjectWarehouseBase.h.

284 {
285 }

Member Function Documentation

◆ activeObjectsToFormattedString()

template<typename T >
std::string MooseObjectWarehouseBase< T >::activeObjectsToFormattedString ( THREAD_ID  tid = 0,
const std::string &  prefix = "[DBG]" 
) const

Output the active content of the warehouse to a string, meant to be output to the console.

Parameters
tidthe thread id
prefixa string to prepend to the string

Definition at line 847 of file MooseObjectWarehouseBase.h.

Referenced by NonlinearThread::printBlockExecutionInformation(), NonlinearThread::printBoundaryExecutionInformation(), ComputeNodalKernelBcsThread::printGeneralExecutionInformation(), ComputeNodalKernelsThread::printGeneralExecutionInformation(), ComputeNodalKernelBCJacobiansThread::printGeneralExecutionInformation(), and ComputeNodalKernelJacobiansThread::printGeneralExecutionInformation().

849 {
850  std::vector<std::string> output;
851  for (const auto & object : _active_objects[tid])
852  output.push_back(object->name());
853  return ConsoleUtils::formatString(MooseUtils::join(output, " "), prefix);
854 }
std::string join(Iterator begin, Iterator end, const std::string &delimiter)
Python-like join function for strings over an iterator range.
Definition: MooseUtils.h:142
std::string formatString(std::string message, const std::string &prefix)
Add new lines and prefixes to a string for pretty display in output NOTE: This makes a copy of the st...
Definition: ConsoleUtils.C:582
std::vector< std::vector< std::shared_ptr< T > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ addObject()

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

Adds an object to the storage structure.

Parameters
tidThe thread ID (default is 0)
recurseWhether or not to build recusive warehouses (typically for Kernels)

Reimplemented in MooseObjectWarehouse< T >, MooseObjectWarehouse< ADDirichletBCBase >, MooseObjectWarehouse< NodalDamper >, MooseObjectWarehouse< TransientMultiApp >, MooseObjectWarehouse< NodalBCBase >, MooseObjectWarehouse< AuxKernelTempl >, MooseObjectWarehouse< MaterialBase >, MooseObjectWarehouse< GeneralDamper >, MooseObjectWarehouse< UserObject >, MooseObjectWarehouse< AuxScalarKernel >, MooseObjectWarehouse< DirichletBCBase >, MooseObjectWarehouse< AuxKernelType >, MooseObjectWarehouse< InternalSideIndicatorBase >, MooseObjectWarehouse< IntegratedBCBase >, MooseObjectWarehouse< NodalKernelBase >, MooseObjectWarehouse< HDGKernel >, MooseObjectWarehouse< KernelBase >, MooseObjectWarehouse< Convergence >, MooseObjectWarehouse< DGKernelBase >, MooseObjectWarehouse< MultiApp >, MooseObjectWarehouse< Function >, MooseObjectWarehouse< ScalarKernelBase >, MooseObjectWarehouse< MeshDivision >, MooseObjectWarehouse< NodalConstraint >, MooseObjectWarehouse< InterfaceKernelBase >, MooseObjectWarehouse< Marker >, MooseObjectWarehouse< ElementDamper >, MooseObjectWarehouse< Constraint >, MooseObjectWarehouse< DiracKernelBase >, MooseObjectWarehouse< Control >, MooseObjectWarehouse< Transfer >, MooseObjectWarehouse< Indicator >, ExecuteMooseObjectWarehouse< T >, ExecuteMooseObjectWarehouse< TransientMultiApp >, ExecuteMooseObjectWarehouse< AuxKernelTempl >, ExecuteMooseObjectWarehouse< UserObject >, ExecuteMooseObjectWarehouse< AuxScalarKernel >, ExecuteMooseObjectWarehouse< MultiApp >, ExecuteMooseObjectWarehouse< Control >, ExecuteMooseObjectWarehouse< Transfer >, ConstraintWarehouse, FVInitialConditionWarehouse, and InitialConditionWarehouse.

Definition at line 297 of file MooseObjectWarehouseBase.h.

Referenced by FEProblemBase::addInitialCondition(), InitialConditionWarehouse::addObject(), FVInitialConditionWarehouse::addObject(), MooseObjectWarehouse< Indicator >::addObject(), and NonlinearSystemBase::addSplit().

300 {
301  checkThreadID(tid);
302 
303  // Stores object in list of all objects
304  _all_objects[tid].push_back(object);
305 
306  // If enabled, store object in a list of all active
307  bool enabled = object->enabled();
308  if (enabled)
309  _active_objects[tid].push_back(object);
310 
311  // Perform casts to the Block/BoundaryRestrictable
312  std::shared_ptr<BoundaryRestrictable> bnd =
314  std::shared_ptr<BlockRestrictable> blk = std::dynamic_pointer_cast<BlockRestrictable>(object);
315 
316  // Boundary Restricted
317  if (bnd && bnd->boundaryRestricted())
318  {
319  const std::set<BoundaryID> & ids = bnd->boundaryIDs();
320  for (std::set<BoundaryID>::const_iterator it = ids.begin(); it != ids.end(); ++it)
321  {
322  _all_boundary_objects[tid][*it].push_back(object);
323  if (enabled)
324  _active_boundary_objects[tid][*it].push_back(object);
325  }
326  }
327 
328  // Block Restricted
329  else if (blk)
330  {
331  const std::set<SubdomainID> & ids =
332  blk->blockRestricted() ? blk->blockIDs() : blk->meshBlockIDs();
333  for (std::set<SubdomainID>::const_iterator it = ids.begin(); it != ids.end(); ++it)
334  {
335  _all_block_objects[tid][*it].push_back(object);
336  if (enabled)
337  _active_block_objects[tid][*it].push_back(object);
338  }
339 
340  // Check variables
341  std::shared_ptr<Coupleable> c_ptr = std::dynamic_pointer_cast<Coupleable>(object);
342  if (c_ptr)
343  for (MooseVariableFieldBase * var : c_ptr->getCoupledMooseVars())
344  blk->checkVariable(*var);
345 
346  const InputParameters & parameters = object->parameters();
347 
348  SubProblem & problem = *parameters.get<SubProblem *>("_subproblem");
349 
350  THREAD_ID tid = parameters.get<THREAD_ID>("_tid");
351 
352  if (parameters.isParamValid("variable"))
353  {
354  // Try the scalar version first
355  std::string variable_name = parameters.getMooseType("variable");
356  if (variable_name == "")
357  // When using vector variables, we are only going to use the first one in the list at the
358  // interface level...
359  variable_name = parameters.getVecMooseType("variable")[0];
360 
361  blk->checkVariable(problem.getVariable(
363 
364  _all_variable_objects[tid][variable_name].push_back(object);
365  }
366  }
367 }
std::string getMooseType(const std::string &name) const
Utility functions for retrieving one of the MooseTypes variables into the common "string" base class...
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< T > > > > _all_block_objects
std::vector< std::pair< R1, R2 > > get(const std::string &param1, const std::string &param2) const
Combine two vector parameters into a single vector of pairs.
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< VariableName, std::vector< std::shared_ptr< T > > > > _all_variable_objects
All objects with a certain variable selected, as the &#39;variable&#39; parameter.
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.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
/class BoundaryRestrictable /brief Provides functionality for limiting the object to certain boundary...
std::unique_ptr< T_DEST, T_DELETER > dynamic_pointer_cast(std::unique_ptr< T_SRC, T_DELETER > &src)
These are reworked from https://stackoverflow.com/a/11003103.
This class provides an interface for common operations on field variables of both FE and FV types wit...
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< T > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)
virtual const MooseVariableFieldBase & getVariable(const THREAD_ID tid, const std::string &var_name, Moose::VarKindType expected_var_type=Moose::VarKindType::VAR_ANY, Moose::VarFieldType expected_var_field_type=Moose::VarFieldType::VAR_FIELD_ANY) const =0
Returns the variable reference for requested variable which must be of the expected_var_type (Nonline...
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< T > > > > _all_boundary_objects
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:45
Generic class for solving transient nonlinear problems.
Definition: SubProblem.h:78
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)
std::vector< std::string > getVecMooseType(const std::string &name) const
unsigned int THREAD_ID
Definition: MooseTypes.h:209
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ checkThreadID()

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

Calls assert on thread id.

Definition at line 878 of file MooseObjectWarehouseBase.h.

879 {
880  mooseAssert(tid < _num_threads,
881  "Attempting to access a thread id ("
882  << tid << ") greater than the number allowed by the storage item ("
883  << _num_threads << ")");
884 }
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
inline

Definition at line 452 of file MooseObjectWarehouseBase.h.

Referenced by MaterialPropertyInterface::buildRequiredMaterials(), FEProblemBase::checkProblemIntegrity(), NonlinearThread::computeOnElement(), ComputeResidualThread::computeOnInternalFace(), ComputeFullJacobianThread::computeOnInternalFace(), ComputeResidualAndJacobianThread::computeOnInternalFace(), NonlinearThread::computeOnInternalFace(), FEProblemBase::getFVMatsAndDependencies(), BlockRestrictable::hasBlockMaterialPropertyHelper(), ComputeMarkerThread::onElement(), ComputeMaterialsObjectThread::onElement(), ComputeIndicatorThread::onElement(), ComputeIndicatorThread::onInternalSide(), ComputeNodalKernelsThread::onNode(), ComputeNodalKernelJacobiansThread::onNode(), ComputeInitialConditionThread::operator()(), ComputeFVInitialConditionThread::operator()(), ComputeMarkerThread::printBlockExecutionInformation(), ComputeDiracThread::printBlockExecutionInformation(), ComputeIndicatorThread::printBlockExecutionInformation(), FEProblemBase::reinitMaterials(), and Moose::Mortar::setupMortarMaterials().

453 {
454  checkThreadID(tid);
455  return _active_block_objects[tid];
456 }
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.

◆ getActiveBlockObjects() [2/2]

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

Definition at line 460 of file MooseObjectWarehouseBase.h.

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

Return a set of active SubdomainsIDs.

Definition at line 616 of file MooseObjectWarehouseBase.h.

Referenced by FEProblemBase::checkProblemIntegrity().

617 {
618  checkThreadID(tid);
619  std::set<SubdomainID> ids;
620  for (const auto & object_pair : _active_block_objects[tid])
621  ids.insert(object_pair.first);
622  return ids;
623 }
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
inline

◆ getActiveBoundaryObjects() [2/2]

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

Definition at line 441 of file MooseObjectWarehouseBase.h.

442 {
443  checkThreadID(tid);
444  const auto iter = _active_boundary_objects[tid].find(id);
445  mooseAssert(iter != _active_boundary_objects[tid].end(),
446  "Unable to located active boundary objects for the given id: " << id << ".");
447  return iter->second;
448 }
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

Definition at line 597 of file MooseObjectWarehouseBase.h.

Referenced by DerivativeParsedMaterialHelperTempl< is_ad >::assembleDerivatives(), FEProblemBase::getConvergence(), FEProblemBase::getFunction(), FEProblemBase::getMaterial(), FEProblemBase::getMeshDivision(), NonlinearSystemBase::getSplit(), LibtorchArtificialNeuralNetParameters::initialSetup(), and LibtorchControlValuePostprocessor::initialSetup().

598 {
599  checkThreadID(tid);
600  for (const auto & object : _active_objects[tid])
601  if (object->name() == name)
602  return object;
603  mooseError("Unable to locate active object: ", name, ".");
604 }
std::string name(const ElemQuality q)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
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
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 425 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::finalizeMultiApps(), FEProblemBase::finishMultiAppStep(), ConstraintWarehouse::getActiveNodalConstraints(), FEProblemBase::getConvergenceObjects(), FEProblemBase::getTransfers(), FEProblemBase::incrementMultiAppTStep(), FEProblemBase::initialSetup(), ComputeElemDampingThread::onElement(), ComputeDiracThread::onElement(), ComputeNodalDampingThread::onNode(), FEProblemBase::postExecute(), FEProblemBase::projectInitialConditionOnCustomRange(), FEProblemBase::projectSolution(), FEProblemBase::restoreMultiApps(), and AuxiliarySystem::setScalarVariableCoupleableTags().

426 {
427  checkThreadID(tid);
428  return _active_objects[tid];
429 }
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)

◆ getBlockObjects() [1/2]

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

Referenced by MaterialPropertyDebugOutput::printMaterialMap().

407 {
408  checkThreadID(tid);
409  return _all_block_objects[tid];
410 }
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

Definition at line 414 of file MooseObjectWarehouseBase.h.

415 {
416  checkThreadID(tid);
417  const auto iter = _all_block_objects[tid].find(id);
418  mooseAssert(iter != _all_block_objects[tid].end(),
419  "Unable to located active block objects for the given id: " << id << ".");
420  return iter->second;
421 }
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
inline

Definition at line 379 of file MooseObjectWarehouseBase.h.

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

380 {
381  checkThreadID(tid);
382  return _all_boundary_objects[tid];
383 }
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

Definition at line 395 of file MooseObjectWarehouseBase.h.

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

◆ getObject()

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

Definition at line 586 of file MooseObjectWarehouseBase.h.

Referenced by FEProblemBase::getMultiApp().

587 {
588  checkThreadID(tid);
589  for (const auto & object : _all_objects[tid])
590  if (object->name() == name)
591  return object;
592  mooseError("Unable to locate object: ", name, ".");
593 }
std::string name(const ElemQuality q)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
std::vector< std::vector< std::shared_ptr< T > > > _all_objects
Storage container for the ALL pointers (THREAD_ID on outer vector)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ getObjects()

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

◆ getObjectsForVariable()

template<typename T >
const std::vector< std::shared_ptr< T > > & MooseObjectWarehouseBase< T >::getObjectsForVariable ( const VariableName &  var_name,
THREAD_ID  tid 
) const

Getter for objects that have the 'variable' set to a particular variable Note that users should check whether there are objects using 'hasObjectsForVariable' before calling this routine, because it will throw if there are no objects for this variable.

Definition at line 608 of file MooseObjectWarehouseBase.h.

610 {
611  return libmesh_map_find(_all_variable_objects[tid], var_name);
612 }
std::vector< std::map< VariableName, std::vector< std::shared_ptr< T > > > > _all_variable_objects
All objects with a certain variable selected, as the &#39;variable&#39; parameter.

◆ hasActiveBlockObjects() [1/2]

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

Definition at line 535 of file MooseObjectWarehouseBase.h.

Referenced by AuxiliarySystem::computeElementalVarsHelper(), NonlinearSystemBase::computeJacobianInternal(), AuxiliarySystem::computeMortarNodalVars(), AuxiliarySystem::computeNodalVarsHelper(), NonlinearThread::computeOnElement(), ComputeResidualThread::computeOnInternalFace(), ComputeFullJacobianThread::computeOnInternalFace(), ComputeResidualAndJacobianThread::computeOnInternalFace(), ComputeJacobianThread::computeOnInternalFace(), NonlinearSystemBase::computeResidualInternal(), BlockRestrictable::hasBlockMaterialPropertyHelper(), ComputeMarkerThread::onElement(), ComputeIndicatorThread::onElement(), ComputeMaterialsObjectThread::onElement(), ProjectMaterialProperties::onElement(), ComputeIndicatorThread::onInternalSide(), NonlinearThread::onInternalSide(), ComputeNodalKernelsThread::onNode(), ComputeNodalKernelJacobiansThread::onNode(), ComputeInitialConditionThread::operator()(), ComputeFVInitialConditionThread::operator()(), ComputeJacobianBlocksThread::postInternalSide(), FEProblemBase::prepareMaterials(), ComputeMarkerThread::printBlockExecutionInformation(), ComputeDiracThread::printBlockExecutionInformation(), ComputeIndicatorThread::printBlockExecutionInformation(), NonlinearThread::printBlockExecutionInformation(), FEProblemBase::reinitMaterials(), and NonlinearThread::shouldComputeInternalSide().

536 {
537  checkThreadID(tid);
538  bool has_active_block_objects = false;
539  for (const auto & object_pair : _active_block_objects[tid])
540  has_active_block_objects |= !(object_pair.second.empty());
541  return has_active_block_objects;
542 }
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

Definition at line 546 of file MooseObjectWarehouseBase.h.

547 {
548  checkThreadID(tid);
549  const auto iter = _active_block_objects[tid].find(id);
550  return iter != _active_block_objects[tid].end();
551 }
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

Definition at line 555 of file MooseObjectWarehouseBase.h.

Referenced by AuxiliarySystem::computeElementalVarsHelper(), NonlinearSystemBase::computeJacobianBlocks(), NonlinearSystemBase::computeJacobianInternal(), AuxiliarySystem::computeMortarNodalVars(), NonlinearSystemBase::computeNodalBCs(), NonlinearSystemBase::computeNodalBCsResidualAndJacobian(), AuxiliarySystem::computeNodalVarsHelper(), ComputeFullJacobianThread::computeOnBoundary(), ComputeFullJacobianThread::computeOnInterface(), NonlinearSystemBase::computeResidualInternal(), BoundaryRestrictable::hasBoundaryMaterialPropertyHelper(), NonlinearSystemBase::needBoundaryMaterialOnSide(), NonlinearSystemBase::needInterfaceMaterialOnSide(), FEProblemBase::needInterfaceMaterialOnSide(), ComputeMaterialsObjectThread::onBoundary(), NonlinearThread::onBoundary(), ComputeMaterialsObjectThread::onInterface(), NonlinearThread::onInterface(), ComputeBoundaryInitialConditionThread::onNode(), ComputeNodalKernelBcsThread::onNode(), ComputeNodalKernelBCJacobiansThread::onNode(), NonlinearThread::printBoundaryExecutionInformation(), ComputeNodalKernelBCJacobiansThread::printGeneralExecutionInformation(), FEProblemBase::reinitMaterialsBoundary(), FEProblemBase::reinitMaterialsInterface(), and NonlinearSystemBase::setInitialSolution().

556 {
557  checkThreadID(tid);
558  bool has_active_boundary_objects = false;
559  for (const auto & object_pair : _active_boundary_objects[tid])
560  has_active_boundary_objects |= !(object_pair.second.empty());
561  return has_active_boundary_objects;
562 }
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

Definition at line 566 of file MooseObjectWarehouseBase.h.

567 {
568  checkThreadID(tid);
569  const auto iter = _active_boundary_objects[tid].find(id);
570  return iter != _active_boundary_objects[tid].end();
571 }
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

Convenience functions for checking/getting specific objects.

Definition at line 575 of file MooseObjectWarehouseBase.h.

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

576 {
577  checkThreadID(tid);
578  for (const auto & object : _active_objects[tid])
579  if (object->name() == name)
580  return true;
581  return false;
582 }
std::string name(const ElemQuality q)
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

◆ hasBoundaryObjects()

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

Definition at line 387 of file MooseObjectWarehouseBase.h.

388 {
389  checkThreadID(tid);
390  return _all_boundary_objects[tid].find(id) != _all_boundary_objects[tid].end();
391 }
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

◆ hasObjects()

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

Convenience functions for determining if objects exist.

Definition at line 471 of file MooseObjectWarehouseBase.h.

Referenced by FEProblemBase::initialSetup().

472 {
473  checkThreadID(tid);
474  return !_all_objects[tid].empty();
475 }
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.

◆ hasObjectsForVariable()

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

Definition at line 487 of file MooseObjectWarehouseBase.h.

489 {
490  checkThreadID(tid);
491  return _all_variable_objects[tid].count(var_name);
492 }
std::vector< std::map< VariableName, std::vector< std::shared_ptr< T > > > > _all_variable_objects
All objects with a certain variable selected, as the &#39;variable&#39; parameter.
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ hasObjectsForVariableAndBlocks()

template<typename T >
bool MooseObjectWarehouseBase< T >::hasObjectsForVariableAndBlocks ( const VariableName &  var_name,
const std::set< SubdomainID > &  blocks,
std::set< SubdomainID > &  blocks_covered,
THREAD_ID  tid 
) const

Whether there are objects for this variable and the set of blocks passed.

Parameters
var_namename of the variable
blocksblocks to consider
blocks_coveredsubset of blocks for which there is an object

Definition at line 496 of file MooseObjectWarehouseBase.h.

500 {
501  checkThreadID(tid);
502  blocks_covered.clear();
503  if (!hasObjectsForVariable(var_name, tid))
504  return false;
505 
506  // Check block restriction as a whole
507  for (const auto & object : libmesh_map_find(_all_variable_objects[tid], var_name))
508  {
509  std::shared_ptr<BlockRestrictable> blk = std::dynamic_pointer_cast<BlockRestrictable>(object);
510  if (blk && blk->hasBlocks(blocks))
511  {
512  blocks_covered = blocks;
513  return true;
514  }
515  }
516  // No object has all the blocks, but one might overlap, which could be troublesome.
517  // We'll keep track of which blocks are covered in case several overlap
518  for (const auto & object : libmesh_map_find(_all_variable_objects[tid], var_name))
519  {
520  std::shared_ptr<BlockRestrictable> blk = std::dynamic_pointer_cast<BlockRestrictable>(object);
521  if (blk)
522  for (const auto & block : blocks)
523  if (blk->hasBlocks(block))
524  blocks_covered.insert(block);
525  }
526  // No overlap at all
527  if (blocks_covered.empty())
528  return false;
529 
530  return (blocks == blocks_covered);
531 }
char ** blocks
std::vector< std::map< VariableName, std::vector< std::shared_ptr< T > > > > _all_variable_objects
All objects with a certain variable selected, as the &#39;variable&#39; parameter.
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::unique_ptr< T_DEST, T_DELETER > dynamic_pointer_cast(std::unique_ptr< T_SRC, T_DELETER > &src)
These are reworked from https://stackoverflow.com/a/11003103.
bool hasObjectsForVariable(const VariableName &var_name, THREAD_ID tid) const
An interface that restricts an object to subdomains via the &#39;blocks&#39; input parameter.

◆ numThreads()

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

Return the number of threads.

Definition at line 196 of file MooseObjectWarehouseBase.h.

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

◆ size()

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

Return how many kernels we store in the current warehouse.

Definition at line 289 of file MooseObjectWarehouseBase.h.

Referenced by NonlinearSystemBase::computeNodalBCs(), and NonlinearThread::printBlockExecutionInformation().

290 {
291  checkThreadID(tid);
292  return _all_objects[tid].size();
293 }
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)

Sort the objects using the DependencyResolver.

Definition at line 656 of file MooseObjectWarehouseBase.h.

Referenced by FVInitialConditionWarehouse::initialSetup(), InitialConditionWarehouse::initialSetup(), ScalarInitialConditionWarehouse::initialSetup(), and FEProblemBase::initialSetup().

657 {
658  checkThreadID(tid);
659 
660  for (auto & object_pair : _all_block_objects[tid])
661  sortHelper(object_pair.second);
662 
663  for (auto & object_pair : _all_boundary_objects[tid])
664  sortHelper(object_pair.second);
665 
666  sortHelper(_all_objects[tid]);
667 
668  // The active lists now must be update to reflect the order changes
669  updateActive(tid);
670 }
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)
staticprotected

Helper method for sorting vectors of objects.

Definition at line 858 of file MooseObjectWarehouseBase.h.

859 {
860  // Do nothing if the vector is empty
861  if (objects.empty())
862  return;
863 
864  try
865  {
866  // Sort based on dependencies
867  DependencyResolverInterface::sort<std::shared_ptr<T>>(objects);
868  }
869  catch (CyclicDependencyException<std::shared_ptr<T>> & e)
870  {
871  DependencyResolverInterface::cyclicDependencyError<std::shared_ptr<T>>(
872  e, "Cyclic dependency detected in object ordering");
873  }
874 }

◆ subdomainsCovered()

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

Referenced by NonlinearSystemBase::checkKernelCoverage().

832 {
833  for (const auto & object : _active_objects[tid])
834  {
835  unique_variables.insert(object->variable().name());
836  const auto additional_variables_covered = object->additionalROVariables();
837  unique_variables.insert(additional_variables_covered.begin(),
838  additional_variables_covered.end());
839  }
840 
841  for (const auto & object_pair : _active_block_objects[tid])
842  subdomains_covered.insert(object_pair.first);
843 }
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)

◆ updateActive()

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

Updates the active objects storage.

Reimplemented in MooseObjectWarehouse< T >, MooseObjectWarehouse< ADDirichletBCBase >, MooseObjectWarehouse< NodalDamper >, MooseObjectWarehouse< TransientMultiApp >, MooseObjectWarehouse< NodalBCBase >, MooseObjectWarehouse< AuxKernelTempl >, MooseObjectWarehouse< MaterialBase >, MooseObjectWarehouse< GeneralDamper >, MooseObjectWarehouse< UserObject >, MooseObjectWarehouse< AuxScalarKernel >, MooseObjectWarehouse< DirichletBCBase >, MooseObjectWarehouse< AuxKernelType >, MooseObjectWarehouse< InternalSideIndicatorBase >, MooseObjectWarehouse< IntegratedBCBase >, MooseObjectWarehouse< NodalKernelBase >, MooseObjectWarehouse< HDGKernel >, MooseObjectWarehouse< KernelBase >, MooseObjectWarehouse< Convergence >, MooseObjectWarehouse< DGKernelBase >, MooseObjectWarehouse< MultiApp >, MooseObjectWarehouse< Function >, MooseObjectWarehouse< ScalarKernelBase >, MooseObjectWarehouse< MeshDivision >, MooseObjectWarehouse< NodalConstraint >, MooseObjectWarehouse< InterfaceKernelBase >, MooseObjectWarehouse< Marker >, MooseObjectWarehouse< ElementDamper >, MooseObjectWarehouse< Constraint >, MooseObjectWarehouse< DiracKernelBase >, MooseObjectWarehouse< Control >, MooseObjectWarehouse< Transfer >, MooseObjectWarehouse< Indicator >, ConstraintWarehouse, ExecuteMooseObjectWarehouse< T >, ExecuteMooseObjectWarehouse< TransientMultiApp >, ExecuteMooseObjectWarehouse< AuxKernelTempl >, ExecuteMooseObjectWarehouse< UserObject >, ExecuteMooseObjectWarehouse< AuxScalarKernel >, ExecuteMooseObjectWarehouse< MultiApp >, ExecuteMooseObjectWarehouse< Control >, ExecuteMooseObjectWarehouse< Transfer >, MaterialWarehouse, MooseObjectTagWarehouse< T >, MooseObjectTagWarehouse< NodalBCBase >, MooseObjectTagWarehouse< IntegratedBCBase >, MooseObjectTagWarehouse< NodalKernelBase >, MooseObjectTagWarehouse< HDGKernel >, MooseObjectTagWarehouse< KernelBase >, MooseObjectTagWarehouse< DGKernelBase >, MooseObjectTagWarehouse< ScalarKernelBase >, MooseObjectTagWarehouse< InterfaceKernelBase >, and MooseObjectTagWarehouse< DiracKernelBase >.

Definition at line 627 of file MooseObjectWarehouseBase.h.

Referenced by MooseObjectWarehouse< Indicator >::updateActive().

628 {
629  checkThreadID(tid);
630 
632 
633  for (const auto & object_pair : _all_block_objects[tid])
634  updateActiveHelper(_active_block_objects[tid][object_pair.first], object_pair.second);
635 
636  for (const auto & object_pair : _all_boundary_objects[tid])
637  updateActiveHelper(_active_boundary_objects[tid][object_pair.first], object_pair.second);
638 }
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.

◆ updateActiveHelper()

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

644 {
645  // Clear the active list
646  active.clear();
647 
648  std::copy_if(all.begin(),
649  all.end(),
650  std::back_inserter(active),
651  [](const std::shared_ptr<T> & object) { return object->enabled(); });
652 }

◆ updateBlockFEVariableCoupledVectorTagDependency()

template<typename T >
void MooseObjectWarehouseBase< T >::updateBlockFEVariableCoupledVectorTagDependency ( SubdomainID  id,
std::set< TagID > &  needed_fe_var_vector_tags,
THREAD_ID  tid = 0 
) const

Update FE variable coupleable vector tag vector.

Definition at line 735 of file MooseObjectWarehouseBase.h.

Referenced by ComputeNodalKernelsThread::onNode(), ComputeMaterialsObjectThread::subdomainChanged(), ComputeIndicatorThread::subdomainChanged(), NonlinearThread::subdomainChanged(), and ComputeUserObjectsThread::subdomainChanged().

737 {
738  if (hasActiveBlockObjects(id, tid))
739  updateFEVariableCoupledVectorTagDependencyHelper(needed_fe_var_vector_tags,
740  getActiveBlockObjects(id, tid));
741 }
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 updateFEVariableCoupledVectorTagDependencyHelper(std::set< TagID > &needed_fe_var_vector_tags, const std::vector< std::shared_ptr< T >> &objects)
Helper method for updating FE variable coupleable vector tag vector.

◆ updateBlockMatPropDependency()

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

Definition at line 780 of file MooseObjectWarehouseBase.h.

Referenced by FEProblemBase::prepareMaterials(), and NonlinearThread::subdomainChanged().

784 {
785  if (hasActiveBlockObjects(id, tid))
786  updateMatPropDependencyHelper(needed_mat_props, getActiveBlockObjects(id, tid));
787 }
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::unordered_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< MooseVariableFieldBase *> &  needed_moose_vars,
THREAD_ID  tid = 0 
) const

Definition at line 683 of file MooseObjectWarehouseBase.h.

Referenced by NonlinearThread::subdomainChanged().

687 {
688  if (hasActiveBlockObjects(id, tid))
689  updateVariableDependencyHelper(needed_moose_vars, getActiveBlockObjects(id, tid));
690 }
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< MooseVariableFieldBase *> &needed_moose_vars, const std::vector< std::shared_ptr< T >> &objects)
Helper method for updating variable dependency vector.

◆ updateBoundaryFEVariableCoupledVectorTagDependency()

template<typename T >
void MooseObjectWarehouseBase< T >::updateBoundaryFEVariableCoupledVectorTagDependency ( BoundaryID  id,
std::set< TagID > &  needed_fe_var_vector_tags,
THREAD_ID  tid = 0 
) const

Definition at line 745 of file MooseObjectWarehouseBase.h.

Referenced by ComputeNodalKernelBcsThread::onNode().

747 {
748  if (hasActiveBoundaryObjects(id, tid))
749  updateFEVariableCoupledVectorTagDependencyHelper(needed_fe_var_vector_tags,
750  getActiveBoundaryObjects(id, tid));
751 }
static void updateFEVariableCoupledVectorTagDependencyHelper(std::set< TagID > &needed_fe_var_vector_tags, const std::vector< std::shared_ptr< T >> &objects)
Helper method for updating FE variable coupleable vector tag vector.
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
const std::map< BoundaryID, std::vector< std::shared_ptr< T > > > & getActiveBoundaryObjects(THREAD_ID tid=0) const

◆ updateBoundaryMatPropDependency() [1/2]

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

Definition at line 791 of file MooseObjectWarehouseBase.h.

Referenced by FEProblemBase::prepareMaterials(), and NonlinearThread::subdomainChanged().

793 {
794  if (hasActiveBoundaryObjects(tid))
795  for (auto & active_bnd_object : _active_boundary_objects[tid])
796  updateMatPropDependencyHelper(needed_mat_props, active_bnd_object.second);
797 }
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 updateMatPropDependencyHelper(std::unordered_set< unsigned int > &needed_mat_props, const std::vector< std::shared_ptr< T >> &objects)
Helper method for updating material property dependency vector.

◆ updateBoundaryMatPropDependency() [2/2]

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

Definition at line 801 of file MooseObjectWarehouseBase.h.

805 {
806  if (hasActiveBoundaryObjects(id, tid))
807  updateMatPropDependencyHelper(needed_mat_props, getActiveBoundaryObjects(id, tid));
808 }
bool hasActiveBoundaryObjects(THREAD_ID tid=0) const
static void updateMatPropDependencyHelper(std::unordered_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< 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< MooseVariableFieldBase *> &  needed_moose_vars,
THREAD_ID  tid = 0 
) const

Definition at line 694 of file MooseObjectWarehouseBase.h.

Referenced by FEProblemBase::prepareMaterials(), and NonlinearThread::subdomainChanged().

696 {
697  if (hasActiveBoundaryObjects(tid))
698  {
699  typename std::map<BoundaryID, std::vector<std::shared_ptr<T>>>::const_iterator it;
700  for (const auto & object_pair : _active_boundary_objects[tid])
701  updateVariableDependencyHelper(needed_moose_vars, object_pair.second);
702  }
703 }
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< MooseVariableFieldBase *> &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< MooseVariableFieldBase *> &  needed_moose_vars,
THREAD_ID  tid = 0 
) const

Definition at line 707 of file MooseObjectWarehouseBase.h.

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

◆ updateFEVariableCoupledVectorTagDependencyHelper()

template<typename T>
void MooseObjectWarehouseBase< T >::updateFEVariableCoupledVectorTagDependencyHelper ( std::set< TagID > &  needed_fe_var_vector_tags,
const std::vector< std::shared_ptr< T >> &  objects 
)
staticprotected

Helper method for updating FE variable coupleable vector tag vector.

Definition at line 755 of file MooseObjectWarehouseBase.h.

757 {
758  for (const auto & object : objects)
759  {
760  auto c = dynamic_cast<const Coupleable *>(object.get());
761  if (c)
762  {
763  const auto & tag_deps = c->getFEVariableCoupleableVectorTags();
764  needed_fe_var_vector_tags.insert(tag_deps.begin(), tag_deps.end());
765  }
766  }
767 }
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:45
std::set< TagID > & getFEVariableCoupleableVectorTags()
Definition: Coupleable.h:106

◆ updateMatPropDependency()

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

Update material property dependency vector.

Definition at line 771 of file MooseObjectWarehouseBase.h.

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

773 {
774  if (hasActiveObjects(tid))
775  updateMatPropDependencyHelper(needed_mat_props, _all_objects[tid]);
776 }
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::unordered_set< unsigned int > &needed_mat_props, const std::vector< std::shared_ptr< T >> &objects)
Helper method for updating material property dependency vector.
bool hasActiveObjects(THREAD_ID tid=0) const

◆ updateMatPropDependencyHelper()

template<typename T>
void MooseObjectWarehouseBase< T >::updateMatPropDependencyHelper ( std::unordered_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 812 of file MooseObjectWarehouseBase.h.

815 {
816  for (auto & object : objects)
817  {
818  auto c = dynamic_cast<const MaterialPropertyInterface *>(object.get());
819  if (c)
820  {
821  auto & mp_deps = c->getMatPropDependencies();
822  needed_mat_props.insert(mp_deps.begin(), mp_deps.end());
823  }
824  }
825 }
virtual const std::unordered_set< unsigned int > & getMatPropDependencies() const
Retrieve the set of material properties that this object depends on.
An interface for accessing Materials.

◆ updateVariableDependency()

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

Update variable dependency vector.

Definition at line 674 of file MooseObjectWarehouseBase.h.

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

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

◆ updateVariableDependencyHelper()

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

Helper method for updating variable dependency vector.

Definition at line 718 of file MooseObjectWarehouseBase.h.

721 {
722  for (const auto & object : objects)
723  {
724  auto c = dynamic_cast<const MooseVariableDependencyInterface *>(object.get());
725  if (c)
726  {
727  const auto & mv_deps = c->getMooseVariableDependencies();
728  needed_moose_vars.insert(mv_deps.begin(), mv_deps.end());
729  }
730  }
731 }
const std::set< MooseVariableFieldBase * > & getMooseVariableDependencies() const
Retrieve the set of MooseVariableFieldBase that this object depends on.

Friends And Related Function Documentation

◆ MaterialWarehouse

template<typename T>
friend class MaterialWarehouse
friend

Definition at line 266 of file MooseObjectWarehouseBase.h.

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
protected

Active block restricted objects (THREAD_ID on outer vector)

Definition at line 220 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
protected

Active boundary restricted objects (THREAD_ID on outer vector)

Definition at line 226 of file MooseObjectWarehouseBase.h.

◆ _active_objects

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

All active objects (THREAD_ID on outer vector)

Definition at line 214 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
protected

Definition at line 217 of file MooseObjectWarehouseBase.h.

Referenced by MaterialWarehouse::sort().

◆ _all_boundary_objects

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

Definition at line 223 of file MooseObjectWarehouseBase.h.

Referenced by MaterialWarehouse::sort().

◆ _all_objects

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

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

Definition at line 211 of file MooseObjectWarehouseBase.h.

◆ _all_variable_objects

template<typename T>
std::vector<std::map<VariableName, std::vector<std::shared_ptr<T> > > > MooseObjectWarehouseBase< T >::_all_variable_objects
protected

All objects with a certain variable selected, as the 'variable' parameter.

Definition at line 229 of file MooseObjectWarehouseBase.h.

◆ _num_threads

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

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


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