https://mooseframework.inl.gov
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
ScalarInitialConditionWarehouse Class Reference

Warehouse for storing scalar initial conditions. More...

#include <ScalarInitialConditionWarehouse.h>

Inheritance diagram for ScalarInitialConditionWarehouse:
[legend]

Public Member Functions

 ScalarInitialConditionWarehouse ()
 
void initialSetup ()
 Initial setup. More...
 
virtual void addObject (std::shared_ptr< ScalarInitialCondition > 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< ScalarInitialCondition > > & 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< ScalarInitialCondition > > & 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< ScalarInitialCondition > > > & getBlockObjects (THREAD_ID tid=0) const
 
const std::vector< std::shared_ptr< ScalarInitialCondition > > & getBlockObjects (SubdomainID id, THREAD_ID tid=0) const
 
const std::map< BoundaryID, std::vector< std::shared_ptr< ScalarInitialCondition > > > & getBoundaryObjects (THREAD_ID tid=0) const
 
const std::vector< std::shared_ptr< ScalarInitialCondition > > & getBoundaryObjects (BoundaryID id, THREAD_ID tid=0) const
 
const std::vector< std::shared_ptr< ScalarInitialCondition > > & 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< ScalarInitialCondition > > > & getActiveBlockObjects (THREAD_ID tid=0) const
 
const std::vector< std::shared_ptr< ScalarInitialCondition > > & getActiveBlockObjects (SubdomainID id, THREAD_ID tid=0) const
 
const std::map< BoundaryID, std::vector< std::shared_ptr< ScalarInitialCondition > > > & getActiveBoundaryObjects (THREAD_ID tid=0) const
 
const std::vector< std::shared_ptr< ScalarInitialCondition > > & 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< ScalarInitialConditiongetObject (const std::string &name, THREAD_ID tid=0) const
 
std::shared_ptr< ScalarInitialConditiongetActiveObject (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 updateFEVariableCoupledVectorTagDependency (std::set< TagID > &needed_fe_var_vector_tags, THREAD_ID tid=0) const
 Update FE variable coupleable vector tag vector for all objects, block-restricted objects, and boundary-restricted objects. More...
 
void updateBlockFEVariableCoupledVectorTagDependency (SubdomainID id, std::set< TagID > &needed_fe_var_vector_tags, THREAD_ID tid=0) const
 
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 bool producer_only=false) const
 Update material property dependency vector. More...
 
void updateBlockMatPropDependency (SubdomainID id, std::unordered_set< unsigned int > &needed_mat_props, THREAD_ID tid=0, const bool producer_only=false) const
 
void updateBoundaryMatPropDependency (std::unordered_set< unsigned int > &needed_mat_props, THREAD_ID tid=0, const bool producer_only=false) const
 
void updateBoundaryMatPropDependency (BoundaryID id, std::unordered_set< unsigned int > &needed_mat_props, THREAD_ID tid=0, const bool producer_only=false) const
 

Protected Member Functions

virtual void updateMatPropDependencyHelper (std::unordered_set< unsigned int > &needed_mat_props, const std::vector< std::shared_ptr< ScalarInitialCondition >> &objects, const bool producer_only) const
 Helper method for updating material property dependency vector. More...
 
void checkThreadID (THREAD_ID tid) const
 Calls assert on thread id. More...
 

Static Protected Member Functions

static void updateActiveHelper (std::vector< std::shared_ptr< ScalarInitialCondition >> &active, const std::vector< std::shared_ptr< ScalarInitialCondition >> &all)
 Helper method for updating active vectors. More...
 
static void sortHelper (std::vector< std::shared_ptr< ScalarInitialCondition >> &objects)
 Helper method for sorting vectors of objects. More...
 
static void updateVariableDependencyHelper (std::set< MooseVariableFieldBase * > &needed_moose_vars, const std::vector< std::shared_ptr< ScalarInitialCondition >> &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< ScalarInitialCondition >> &objects)
 Helper method for updating FE variable coupleable vector tag 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< ScalarInitialCondition > > > _all_objects
 Storage container for the ALL pointers (THREAD_ID on outer vector) More...
 
std::vector< std::vector< std::shared_ptr< ScalarInitialCondition > > > _active_objects
 All active objects (THREAD_ID on outer vector) More...
 
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< ScalarInitialCondition > > > > _all_block_objects
 
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< ScalarInitialCondition > > > > _active_block_objects
 Active block restricted objects (THREAD_ID on outer vector) More...
 
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< ScalarInitialCondition > > > > _all_boundary_objects
 
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< ScalarInitialCondition > > > > _active_boundary_objects
 Active boundary restricted objects (THREAD_ID on outer vector) More...
 
std::vector< std::map< VariableName, std::vector< std::shared_ptr< ScalarInitialCondition > > > > _all_variable_objects
 All objects with a certain variable selected, as the 'variable' parameter. More...
 

Detailed Description

Warehouse for storing scalar initial conditions.

Definition at line 20 of file ScalarInitialConditionWarehouse.h.

Constructor & Destructor Documentation

◆ ScalarInitialConditionWarehouse()

ScalarInitialConditionWarehouse::ScalarInitialConditionWarehouse ( )

Member Function Documentation

◆ activeObjectsToFormattedString()

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

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

876 {
877  std::vector<std::string> output;
878  for (const auto & object : _active_objects[tid])
879  output.push_back(object->name());
880  return ConsoleUtils::formatString(MooseUtils::join(output, " "), prefix);
881 }
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:583
std::vector< std::vector< std::shared_ptr< ScalarInitialCondition > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ addObject()

void MooseObjectWarehouseBase< ScalarInitialCondition >::addObject ( std::shared_ptr< ScalarInitialCondition object,
THREAD_ID  tid = 0,
bool  recurse = true 
)
virtualinherited

Adds an object to the storage structure.

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

Definition at line 306 of file MooseObjectWarehouseBase.h.

309 {
310  checkThreadID(tid);
311 
312  // Stores object in list of all objects
313  _all_objects[tid].push_back(object);
314 
315  // If enabled, store object in a list of all active
316  bool enabled = object->enabled();
317  if (enabled)
318  _active_objects[tid].push_back(object);
319 
320  // Perform casts to the Block/BoundaryRestrictable
321  std::shared_ptr<BoundaryRestrictable> bnd =
323  std::shared_ptr<BlockRestrictable> blk = std::dynamic_pointer_cast<BlockRestrictable>(object);
324 
325  // Boundary Restricted
326  if (bnd && bnd->boundaryRestricted())
327  {
328  const std::set<BoundaryID> & ids = bnd->boundaryIDs();
329  for (std::set<BoundaryID>::const_iterator it = ids.begin(); it != ids.end(); ++it)
330  {
331  _all_boundary_objects[tid][*it].push_back(object);
332  if (enabled)
333  _active_boundary_objects[tid][*it].push_back(object);
334  }
335  }
336 
337  // Block Restricted
338  else if (blk)
339  {
340  const std::set<SubdomainID> & ids =
341  blk->blockRestricted() ? blk->blockIDs() : blk->meshBlockIDs();
342  for (std::set<SubdomainID>::const_iterator it = ids.begin(); it != ids.end(); ++it)
343  {
344  _all_block_objects[tid][*it].push_back(object);
345  if (enabled)
346  _active_block_objects[tid][*it].push_back(object);
347  }
348 
349  // Check variables
350  std::shared_ptr<Coupleable> c_ptr = std::dynamic_pointer_cast<Coupleable>(object);
351  if (c_ptr)
352  for (MooseVariableFieldBase * var : c_ptr->getCoupledMooseVars())
353  blk->checkVariable(*var);
354 
355  const InputParameters & parameters = object->parameters();
356 
357  SubProblem & problem = *parameters.get<SubProblem *>("_subproblem");
358 
359  THREAD_ID tid = parameters.get<THREAD_ID>("_tid");
360 
361  if (parameters.isParamValid("variable"))
362  {
363  // Try the scalar version first
364  std::string variable_name = parameters.getMooseType("variable");
365  if (variable_name == "")
366  // When using vector variables, we are only going to use the first one in the list at the
367  // interface level...
368  variable_name = parameters.getVecMooseType("variable")[0];
369 
370  blk->checkVariable(problem.getVariable(
372 
373  _all_variable_objects[tid][variable_name].push_back(object);
374  }
375  }
376 }
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< ScalarInitialCondition > > > > _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< ScalarInitialCondition > > > _all_objects
Storage container for the ALL pointers (THREAD_ID on outer vector)
std::vector< std::map< VariableName, std::vector< std::shared_ptr< ScalarInitialCondition > > > > _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< ScalarInitialCondition > > > > _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< ScalarInitialCondition > > > > _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< ScalarInitialCondition > > > > _all_boundary_objects
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:52
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< ScalarInitialCondition > > > _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:237
bool isParamValid(const std::string &name) const
This method returns parameters that have been initialized in one fashion or another, i.e.

◆ checkThreadID()

void MooseObjectWarehouseBase< ScalarInitialCondition >::checkThreadID ( THREAD_ID  tid) const
inlineprotectedinherited

Calls assert on thread id.

Definition at line 905 of file MooseObjectWarehouseBase.h.

906 {
907  mooseAssert(tid < _num_threads,
908  "Attempting to access a thread id ("
909  << tid << ") greater than the number allowed by the storage item ("
910  << _num_threads << ")");
911 }
const THREAD_ID _num_threads
Convenience member storing the number of threads used for storage (1 or libMesh::n_threads) ...

◆ getActiveBlockObjects() [1/2]

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

Definition at line 461 of file MooseObjectWarehouseBase.h.

462 {
463  checkThreadID(tid);
464  return _active_block_objects[tid];
465 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< ScalarInitialCondition > > > > _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]

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

Definition at line 469 of file MooseObjectWarehouseBase.h.

470 {
471  checkThreadID(tid);
472  const auto iter = _active_block_objects[tid].find(id);
473  mooseAssert(iter != _active_block_objects[tid].end(),
474  "Unable to located active block objects for the given id: " << id << ".");
475  return iter->second;
476 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< ScalarInitialCondition > > > > _active_block_objects
Active block restricted objects (THREAD_ID on outer vector)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ getActiveBlocks()

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

Return a set of active SubdomainsIDs.

Definition at line 625 of file MooseObjectWarehouseBase.h.

626 {
627  checkThreadID(tid);
628  std::set<SubdomainID> ids;
629  for (const auto & object_pair : _active_block_objects[tid])
630  ids.insert(object_pair.first);
631  return ids;
632 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< ScalarInitialCondition > > > > _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]

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

Definition at line 442 of file MooseObjectWarehouseBase.h.

443 {
444  checkThreadID(tid);
445  return _active_boundary_objects[tid];
446 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< ScalarInitialCondition > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)

◆ getActiveBoundaryObjects() [2/2]

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

Definition at line 450 of file MooseObjectWarehouseBase.h.

451 {
452  checkThreadID(tid);
453  const auto iter = _active_boundary_objects[tid].find(id);
454  mooseAssert(iter != _active_boundary_objects[tid].end(),
455  "Unable to located active boundary objects for the given id: " << id << ".");
456  return iter->second;
457 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< ScalarInitialCondition > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)

◆ getActiveObject()

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

Definition at line 606 of file MooseObjectWarehouseBase.h.

607 {
608  checkThreadID(tid);
609  for (const auto & object : _active_objects[tid])
610  if (object->name() == name)
611  return object;
612  mooseError("Unable to locate active object: ", name, ".");
613 }
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:311
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::vector< std::shared_ptr< ScalarInitialCondition > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ getActiveObjects()

const std::vector< std::shared_ptr< ScalarInitialCondition > > & MooseObjectWarehouseBase< ScalarInitialCondition >::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 434 of file MooseObjectWarehouseBase.h.

435 {
436  checkThreadID(tid);
437  return _active_objects[tid];
438 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::vector< std::shared_ptr< ScalarInitialCondition > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ getBlockObjects() [1/2]

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

Definition at line 415 of file MooseObjectWarehouseBase.h.

416 {
417  checkThreadID(tid);
418  return _all_block_objects[tid];
419 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< ScalarInitialCondition > > > > _all_block_objects
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ getBlockObjects() [2/2]

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

Definition at line 423 of file MooseObjectWarehouseBase.h.

424 {
425  checkThreadID(tid);
426  const auto iter = _all_block_objects[tid].find(id);
427  mooseAssert(iter != _all_block_objects[tid].end(),
428  "Unable to located active block objects for the given id: " << id << ".");
429  return iter->second;
430 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< ScalarInitialCondition > > > > _all_block_objects
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ getBoundaryObjects() [1/2]

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

Definition at line 388 of file MooseObjectWarehouseBase.h.

389 {
390  checkThreadID(tid);
391  return _all_boundary_objects[tid];
392 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< ScalarInitialCondition > > > > _all_boundary_objects

◆ getBoundaryObjects() [2/2]

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

Definition at line 404 of file MooseObjectWarehouseBase.h.

405 {
406  checkThreadID(tid);
407  const auto iter = _all_boundary_objects[tid].find(id);
408  mooseAssert(iter != _all_boundary_objects[tid].end(),
409  "Unable to located active boundary objects for the given id: " << id << ".");
410  return iter->second;
411 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< ScalarInitialCondition > > > > _all_boundary_objects

◆ getObject()

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

Definition at line 595 of file MooseObjectWarehouseBase.h.

596 {
597  checkThreadID(tid);
598  for (const auto & object : _all_objects[tid])
599  if (object->name() == name)
600  return object;
601  mooseError("Unable to locate object: ", name, ".");
602 }
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:311
std::vector< std::vector< std::shared_ptr< ScalarInitialCondition > > > _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()

const std::vector< std::shared_ptr< ScalarInitialCondition > > & MooseObjectWarehouseBase< ScalarInitialCondition >::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 380 of file MooseObjectWarehouseBase.h.

381 {
382  checkThreadID(tid);
383  return _all_objects[tid];
384 }
std::vector< std::vector< std::shared_ptr< ScalarInitialCondition > > > _all_objects
Storage container for the ALL pointers (THREAD_ID on outer vector)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ getObjectsForVariable()

const std::vector< std::shared_ptr< ScalarInitialCondition > > & MooseObjectWarehouseBase< ScalarInitialCondition >::getObjectsForVariable ( const VariableName &  var_name,
THREAD_ID  tid 
) const
inherited

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

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

◆ hasActiveBlockObjects() [1/2]

bool MooseObjectWarehouseBase< ScalarInitialCondition >::hasActiveBlockObjects ( THREAD_ID  tid = 0) const
inherited

Definition at line 544 of file MooseObjectWarehouseBase.h.

545 {
546  checkThreadID(tid);
547  bool has_active_block_objects = false;
548  for (const auto & object_pair : _active_block_objects[tid])
549  has_active_block_objects |= !(object_pair.second.empty());
550  return has_active_block_objects;
551 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< ScalarInitialCondition > > > > _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]

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

Definition at line 555 of file MooseObjectWarehouseBase.h.

556 {
557  checkThreadID(tid);
558  const auto iter = _active_block_objects[tid].find(id);
559  return iter != _active_block_objects[tid].end();
560 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< ScalarInitialCondition > > > > _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]

bool MooseObjectWarehouseBase< ScalarInitialCondition >::hasActiveBoundaryObjects ( THREAD_ID  tid = 0) const
inherited

Definition at line 564 of file MooseObjectWarehouseBase.h.

565 {
566  checkThreadID(tid);
567  bool has_active_boundary_objects = false;
568  for (const auto & object_pair : _active_boundary_objects[tid])
569  has_active_boundary_objects |= !(object_pair.second.empty());
570  return has_active_boundary_objects;
571 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< ScalarInitialCondition > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)

◆ hasActiveBoundaryObjects() [2/2]

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

Definition at line 575 of file MooseObjectWarehouseBase.h.

576 {
577  checkThreadID(tid);
578  const auto iter = _active_boundary_objects[tid].find(id);
579  return iter != _active_boundary_objects[tid].end();
580 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< ScalarInitialCondition > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)

◆ hasActiveObject()

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

Convenience functions for checking/getting specific objects.

Definition at line 584 of file MooseObjectWarehouseBase.h.

585 {
586  checkThreadID(tid);
587  for (const auto & object : _active_objects[tid])
588  if (object->name() == name)
589  return true;
590  return false;
591 }
std::string name(const ElemQuality q)
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::vector< std::shared_ptr< ScalarInitialCondition > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ hasActiveObjects()

bool MooseObjectWarehouseBase< ScalarInitialCondition >::hasActiveObjects ( THREAD_ID  tid = 0) const
inherited

Definition at line 488 of file MooseObjectWarehouseBase.h.

489 {
490  checkThreadID(tid);
491  return !_active_objects[tid].empty();
492 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::vector< std::shared_ptr< ScalarInitialCondition > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ hasBoundaryObjects()

bool MooseObjectWarehouseBase< ScalarInitialCondition >::hasBoundaryObjects ( BoundaryID  id,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 396 of file MooseObjectWarehouseBase.h.

397 {
398  checkThreadID(tid);
399  return _all_boundary_objects[tid].find(id) != _all_boundary_objects[tid].end();
400 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< ScalarInitialCondition > > > > _all_boundary_objects

◆ hasObjects()

bool MooseObjectWarehouseBase< ScalarInitialCondition >::hasObjects ( THREAD_ID  tid = 0) const
inherited

Convenience functions for determining if objects exist.

Definition at line 480 of file MooseObjectWarehouseBase.h.

481 {
482  checkThreadID(tid);
483  return !_all_objects[tid].empty();
484 }
std::vector< std::vector< std::shared_ptr< ScalarInitialCondition > > > _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()

bool MooseObjectWarehouseBase< ScalarInitialCondition >::hasObjectsForVariable ( const VariableName &  var_name,
THREAD_ID  tid 
) const
inherited

Definition at line 496 of file MooseObjectWarehouseBase.h.

498 {
499  checkThreadID(tid);
500  return _all_variable_objects[tid].count(var_name);
501 }
std::vector< std::map< VariableName, std::vector< std::shared_ptr< ScalarInitialCondition > > > > _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()

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

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

509 {
510  checkThreadID(tid);
511  blocks_covered.clear();
512  if (!hasObjectsForVariable(var_name, tid))
513  return false;
514 
515  // Check block restriction as a whole
516  for (const auto & object : libmesh_map_find(_all_variable_objects[tid], var_name))
517  {
518  std::shared_ptr<BlockRestrictable> blk = std::dynamic_pointer_cast<BlockRestrictable>(object);
519  if (blk && blk->hasBlocks(blocks))
520  {
521  blocks_covered = blocks;
522  return true;
523  }
524  }
525  // No object has all the blocks, but one might overlap, which could be troublesome.
526  // We'll keep track of which blocks are covered in case several overlap
527  for (const auto & object : libmesh_map_find(_all_variable_objects[tid], var_name))
528  {
529  std::shared_ptr<BlockRestrictable> blk = std::dynamic_pointer_cast<BlockRestrictable>(object);
530  if (blk)
531  for (const auto & block : blocks)
532  if (blk->hasBlocks(block))
533  blocks_covered.insert(block);
534  }
535  // No overlap at all
536  if (blocks_covered.empty())
537  return false;
538 
539  return (blocks == blocks_covered);
540 }
char ** blocks
std::vector< std::map< VariableName, std::vector< std::shared_ptr< ScalarInitialCondition > > > > _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.

◆ initialSetup()

void ScalarInitialConditionWarehouse::initialSetup ( )

Initial setup.

Definition at line 19 of file ScalarInitialConditionWarehouse.C.

Referenced by FEProblemBase::initialSetup().

20 {
22  for (const auto & ic : _active_objects[0])
23  ic->initialSetup();
24 }
void sort(THREAD_ID tid=0)
Sort the objects using the DependencyResolver.
std::vector< std::vector< std::shared_ptr< ScalarInitialCondition > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ numThreads()

THREAD_ID MooseObjectWarehouseBase< ScalarInitialCondition >::numThreads ( ) const
inlineinherited

Return the number of threads.

Definition at line 204 of file MooseObjectWarehouseBase.h.

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

◆ size()

unsigned int MooseObjectWarehouseBase< ScalarInitialCondition >::size ( THREAD_ID  tid = 0) const
inherited

Return how many kernels we store in the current warehouse.

Definition at line 298 of file MooseObjectWarehouseBase.h.

299 {
300  checkThreadID(tid);
301  return _all_objects[tid].size();
302 }
std::vector< std::vector< std::shared_ptr< ScalarInitialCondition > > > _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()

Sort the objects using the DependencyResolver.

Definition at line 665 of file MooseObjectWarehouseBase.h.

666 {
667  checkThreadID(tid);
668 
669  for (auto & object_pair : _all_block_objects[tid])
670  sortHelper(object_pair.second);
671 
672  for (auto & object_pair : _all_boundary_objects[tid])
673  sortHelper(object_pair.second);
674 
675  sortHelper(_all_objects[tid]);
676 
677  // The active lists now must be update to reflect the order changes
678  updateActive(tid);
679 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< ScalarInitialCondition > > > > _all_block_objects
std::vector< std::vector< std::shared_ptr< ScalarInitialCondition > > > _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< ScalarInitialCondition >> &objects)
Helper method for sorting vectors of objects.
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< ScalarInitialCondition > > > > _all_boundary_objects
virtual void updateActive(THREAD_ID tid=0)
Updates the active objects storage.

◆ sortHelper()

void MooseObjectWarehouseBase< ScalarInitialCondition >::sortHelper ( std::vector< std::shared_ptr< ScalarInitialCondition >> &  objects)
staticprotectedinherited

Helper method for sorting vectors of objects.

Definition at line 885 of file MooseObjectWarehouseBase.h.

886 {
887  // Do nothing if the vector is empty
888  if (objects.empty())
889  return;
890 
891  try
892  {
893  // Sort based on dependencies
894  DependencyResolverInterface::sort<std::shared_ptr<T>>(objects);
895  }
896  catch (CyclicDependencyException<std::shared_ptr<T>> & e)
897  {
898  DependencyResolverInterface::cyclicDependencyError<std::shared_ptr<T>>(
899  e, "Cyclic dependency detected in object ordering");
900  }
901 }

◆ subdomainsCovered()

void MooseObjectWarehouseBase< ScalarInitialCondition >::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 856 of file MooseObjectWarehouseBase.h.

859 {
860  for (const auto & object : _active_objects[tid])
861  {
862  unique_variables.insert(object->variable().name());
863  const auto additional_variables_covered = object->additionalROVariables();
864  unique_variables.insert(additional_variables_covered.begin(),
865  additional_variables_covered.end());
866  }
867 
868  for (const auto & object_pair : _active_block_objects[tid])
869  subdomains_covered.insert(object_pair.first);
870 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< ScalarInitialCondition > > > > _active_block_objects
Active block restricted objects (THREAD_ID on outer vector)
std::vector< std::vector< std::shared_ptr< ScalarInitialCondition > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ updateActive()

void MooseObjectWarehouseBase< ScalarInitialCondition >::updateActive ( THREAD_ID  tid = 0)
virtualinherited

Updates the active objects storage.

Definition at line 636 of file MooseObjectWarehouseBase.h.

637 {
638  checkThreadID(tid);
639 
641 
642  for (const auto & object_pair : _all_block_objects[tid])
643  updateActiveHelper(_active_block_objects[tid][object_pair.first], object_pair.second);
644 
645  for (const auto & object_pair : _all_boundary_objects[tid])
646  updateActiveHelper(_active_boundary_objects[tid][object_pair.first], object_pair.second);
647 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< ScalarInitialCondition > > > > _all_block_objects
std::vector< std::vector< std::shared_ptr< ScalarInitialCondition > > > _all_objects
Storage container for the ALL pointers (THREAD_ID on outer vector)
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< ScalarInitialCondition > > > > _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< ScalarInitialCondition > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< ScalarInitialCondition > > > > _all_boundary_objects
std::vector< std::vector< std::shared_ptr< ScalarInitialCondition > > > _active_objects
All active objects (THREAD_ID on outer vector)
static void updateActiveHelper(std::vector< std::shared_ptr< ScalarInitialCondition >> &active, const std::vector< std::shared_ptr< ScalarInitialCondition >> &all)
Helper method for updating active vectors.

◆ updateActiveHelper()

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

Helper method for updating active vectors.

Definition at line 651 of file MooseObjectWarehouseBase.h.

653 {
654  // Clear the active list
655  active.clear();
656 
657  std::copy_if(all.begin(),
658  all.end(),
659  std::back_inserter(active),
660  [](const std::shared_ptr<T> & object) { return object->enabled(); });
661 }

◆ updateBlockFEVariableCoupledVectorTagDependency()

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

Definition at line 754 of file MooseObjectWarehouseBase.h.

756 {
757  if (hasActiveBlockObjects(id, tid))
758  updateFEVariableCoupledVectorTagDependencyHelper(needed_fe_var_vector_tags,
759  getActiveBlockObjects(id, tid));
760 }
const std::map< SubdomainID, std::vector< std::shared_ptr< ScalarInitialCondition > > > & getActiveBlockObjects(THREAD_ID tid=0) const
static void updateFEVariableCoupledVectorTagDependencyHelper(std::set< TagID > &needed_fe_var_vector_tags, const std::vector< std::shared_ptr< ScalarInitialCondition >> &objects)
Helper method for updating FE variable coupleable vector tag vector.

◆ updateBlockMatPropDependency()

void MooseObjectWarehouseBase< ScalarInitialCondition >::updateBlockMatPropDependency ( SubdomainID  id,
std::unordered_set< unsigned int > &  needed_mat_props,
THREAD_ID  tid = 0,
const bool  producer_only = false 
) const
inherited

Definition at line 801 of file MooseObjectWarehouseBase.h.

806 {
807  if (hasActiveBlockObjects(id, tid))
808  updateMatPropDependencyHelper(needed_mat_props, getActiveBlockObjects(id, tid), producer_only);
809 }
const std::map< SubdomainID, std::vector< std::shared_ptr< ScalarInitialCondition > > > & getActiveBlockObjects(THREAD_ID tid=0) const
virtual void updateMatPropDependencyHelper(std::unordered_set< unsigned int > &needed_mat_props, const std::vector< std::shared_ptr< ScalarInitialCondition >> &objects, const bool producer_only) const
Helper method for updating material property dependency vector.

◆ updateBlockVariableDependency()

void MooseObjectWarehouseBase< ScalarInitialCondition >::updateBlockVariableDependency ( SubdomainID  id,
std::set< MooseVariableFieldBase *> &  needed_moose_vars,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 692 of file MooseObjectWarehouseBase.h.

696 {
697  if (hasActiveBlockObjects(id, tid))
698  updateVariableDependencyHelper(needed_moose_vars, getActiveBlockObjects(id, tid));
699 }
const std::map< SubdomainID, std::vector< std::shared_ptr< ScalarInitialCondition > > > & getActiveBlockObjects(THREAD_ID tid=0) const
static void updateVariableDependencyHelper(std::set< MooseVariableFieldBase * > &needed_moose_vars, const std::vector< std::shared_ptr< ScalarInitialCondition >> &objects)
Helper method for updating variable dependency vector.

◆ updateBoundaryFEVariableCoupledVectorTagDependency()

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

Definition at line 764 of file MooseObjectWarehouseBase.h.

766 {
767  if (hasActiveBoundaryObjects(id, tid))
768  updateFEVariableCoupledVectorTagDependencyHelper(needed_fe_var_vector_tags,
769  getActiveBoundaryObjects(id, tid));
770 }
static void updateFEVariableCoupledVectorTagDependencyHelper(std::set< TagID > &needed_fe_var_vector_tags, const std::vector< std::shared_ptr< ScalarInitialCondition >> &objects)
Helper method for updating FE variable coupleable vector tag vector.
const std::map< BoundaryID, std::vector< std::shared_ptr< ScalarInitialCondition > > > & getActiveBoundaryObjects(THREAD_ID tid=0) const

◆ updateBoundaryMatPropDependency() [1/2]

void MooseObjectWarehouseBase< ScalarInitialCondition >::updateBoundaryMatPropDependency ( std::unordered_set< unsigned int > &  needed_mat_props,
THREAD_ID  tid = 0,
const bool  producer_only = false 
) const
inherited

Definition at line 813 of file MooseObjectWarehouseBase.h.

817 {
818  if (hasActiveBoundaryObjects(tid))
819  for (auto & active_bnd_object : _active_boundary_objects[tid])
820  updateMatPropDependencyHelper(needed_mat_props, active_bnd_object.second, producer_only);
821 }
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< ScalarInitialCondition > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)
virtual void updateMatPropDependencyHelper(std::unordered_set< unsigned int > &needed_mat_props, const std::vector< std::shared_ptr< ScalarInitialCondition >> &objects, const bool producer_only) const
Helper method for updating material property dependency vector.

◆ updateBoundaryMatPropDependency() [2/2]

void MooseObjectWarehouseBase< ScalarInitialCondition >::updateBoundaryMatPropDependency ( BoundaryID  id,
std::unordered_set< unsigned int > &  needed_mat_props,
THREAD_ID  tid = 0,
const bool  producer_only = false 
) const
inherited

Definition at line 825 of file MooseObjectWarehouseBase.h.

830 {
831  if (hasActiveBoundaryObjects(id, tid))
833  needed_mat_props, getActiveBoundaryObjects(id, tid), producer_only);
834 }
const std::map< BoundaryID, std::vector< std::shared_ptr< ScalarInitialCondition > > > & getActiveBoundaryObjects(THREAD_ID tid=0) const
virtual void updateMatPropDependencyHelper(std::unordered_set< unsigned int > &needed_mat_props, const std::vector< std::shared_ptr< ScalarInitialCondition >> &objects, const bool producer_only) const
Helper method for updating material property dependency vector.

◆ updateBoundaryVariableDependency() [1/2]

void MooseObjectWarehouseBase< ScalarInitialCondition >::updateBoundaryVariableDependency ( std::set< MooseVariableFieldBase *> &  needed_moose_vars,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 703 of file MooseObjectWarehouseBase.h.

705 {
706  if (hasActiveBoundaryObjects(tid))
707  {
708  typename std::map<BoundaryID, std::vector<std::shared_ptr<T>>>::const_iterator it;
709  for (const auto & object_pair : _active_boundary_objects[tid])
710  updateVariableDependencyHelper(needed_moose_vars, object_pair.second);
711  }
712 }
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< ScalarInitialCondition > > > > _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< ScalarInitialCondition >> &objects)
Helper method for updating variable dependency vector.

◆ updateBoundaryVariableDependency() [2/2]

void MooseObjectWarehouseBase< ScalarInitialCondition >::updateBoundaryVariableDependency ( BoundaryID  id,
std::set< MooseVariableFieldBase *> &  needed_moose_vars,
THREAD_ID  tid = 0 
) const
inherited

Definition at line 716 of file MooseObjectWarehouseBase.h.

720 {
721  if (hasActiveBoundaryObjects(id, tid))
722  updateVariableDependencyHelper(needed_moose_vars, getActiveBoundaryObjects(id, tid));
723 }
static void updateVariableDependencyHelper(std::set< MooseVariableFieldBase * > &needed_moose_vars, const std::vector< std::shared_ptr< ScalarInitialCondition >> &objects)
Helper method for updating variable dependency vector.
const std::map< BoundaryID, std::vector< std::shared_ptr< ScalarInitialCondition > > > & getActiveBoundaryObjects(THREAD_ID tid=0) const

◆ updateFEVariableCoupledVectorTagDependency()

void MooseObjectWarehouseBase< ScalarInitialCondition >::updateFEVariableCoupledVectorTagDependency ( std::set< TagID > &  needed_fe_var_vector_tags,
THREAD_ID  tid = 0 
) const
inherited

Update FE variable coupleable vector tag vector for all objects, block-restricted objects, and boundary-restricted objects.

Definition at line 744 of file MooseObjectWarehouseBase.h.

746 {
747  if (hasActiveObjects(tid))
748  updateFEVariableCoupledVectorTagDependencyHelper(needed_fe_var_vector_tags,
749  _active_objects[tid]);
750 }
static void updateFEVariableCoupledVectorTagDependencyHelper(std::set< TagID > &needed_fe_var_vector_tags, const std::vector< std::shared_ptr< ScalarInitialCondition >> &objects)
Helper method for updating FE variable coupleable vector tag vector.
std::vector< std::vector< std::shared_ptr< ScalarInitialCondition > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ updateFEVariableCoupledVectorTagDependencyHelper()

void MooseObjectWarehouseBase< ScalarInitialCondition >::updateFEVariableCoupledVectorTagDependencyHelper ( std::set< TagID > &  needed_fe_var_vector_tags,
const std::vector< std::shared_ptr< ScalarInitialCondition >> &  objects 
)
staticprotectedinherited

Helper method for updating FE variable coupleable vector tag vector.

Definition at line 774 of file MooseObjectWarehouseBase.h.

776 {
777  for (const auto & object : objects)
778  {
779  auto c = dynamic_cast<const Coupleable *>(object.get());
780  if (c)
781  {
782  const auto & tag_deps = c->getFEVariableCoupleableVectorTags();
783  needed_fe_var_vector_tags.insert(tag_deps.begin(), tag_deps.end());
784  }
785  }
786 }
Interface for objects that needs coupling capabilities.
Definition: Coupleable.h:52
std::set< TagID > & getFEVariableCoupleableVectorTags()
Definition: Coupleable.h:120

◆ updateMatPropDependency()

void MooseObjectWarehouseBase< ScalarInitialCondition >::updateMatPropDependency ( std::unordered_set< unsigned int > &  needed_mat_props,
THREAD_ID  tid = 0,
const bool  producer_only = false 
) const
inherited

Update material property dependency vector.

Parameters
producer_onlyOnly append dependencies of materials producing the needed_mat_props

Definition at line 790 of file MooseObjectWarehouseBase.h.

794 {
795  if (hasActiveObjects(tid))
796  updateMatPropDependencyHelper(needed_mat_props, _active_objects[tid], producer_only);
797 }
std::vector< std::vector< std::shared_ptr< ScalarInitialCondition > > > _active_objects
All active objects (THREAD_ID on outer vector)
virtual void updateMatPropDependencyHelper(std::unordered_set< unsigned int > &needed_mat_props, const std::vector< std::shared_ptr< ScalarInitialCondition >> &objects, const bool producer_only) const
Helper method for updating material property dependency vector.

◆ updateMatPropDependencyHelper()

void MooseObjectWarehouseBase< ScalarInitialCondition >::updateMatPropDependencyHelper ( std::unordered_set< unsigned int > &  needed_mat_props,
const std::vector< std::shared_ptr< ScalarInitialCondition >> &  objects,
const bool  producer_only 
) const
protectedvirtualinherited

Helper method for updating material property dependency vector.

Definition at line 838 of file MooseObjectWarehouseBase.h.

842 {
843  for (auto & object : objects)
844  {
845  auto c = dynamic_cast<const MaterialPropertyInterface *>(object.get());
846  if (c)
847  {
848  auto & mp_deps = c->getMatPropDependencies();
849  needed_mat_props.insert(mp_deps.begin(), mp_deps.end());
850  }
851  }
852 }
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()

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

Update variable dependency vector.

Definition at line 683 of file MooseObjectWarehouseBase.h.

685 {
686  if (hasActiveObjects(tid))
687  updateVariableDependencyHelper(needed_moose_vars, _active_objects[tid]);
688 }
static void updateVariableDependencyHelper(std::set< MooseVariableFieldBase * > &needed_moose_vars, const std::vector< std::shared_ptr< ScalarInitialCondition >> &objects)
Helper method for updating variable dependency vector.
std::vector< std::vector< std::shared_ptr< ScalarInitialCondition > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ updateVariableDependencyHelper()

void MooseObjectWarehouseBase< ScalarInitialCondition >::updateVariableDependencyHelper ( std::set< MooseVariableFieldBase *> &  needed_moose_vars,
const std::vector< std::shared_ptr< ScalarInitialCondition >> &  objects 
)
staticprotectedinherited

Helper method for updating variable dependency vector.

Definition at line 727 of file MooseObjectWarehouseBase.h.

730 {
731  for (const auto & object : objects)
732  {
733  auto c = dynamic_cast<const MooseVariableDependencyInterface *>(object.get());
734  if (c)
735  {
736  const auto & mv_deps = c->getMooseVariableDependencies();
737  needed_moose_vars.insert(mv_deps.begin(), mv_deps.end());
738  }
739  }
740 }
const std::set< MooseVariableFieldBase * > & getMooseVariableDependencies() const
Retrieve the set of MooseVariableFieldBase that this object depends on.

Member Data Documentation

◆ _active_block_objects

std::vector<std::map<SubdomainID, std::vector<std::shared_ptr<ScalarInitialCondition > > > > MooseObjectWarehouseBase< ScalarInitialCondition >::_active_block_objects
protectedinherited

Active block restricted objects (THREAD_ID on outer vector)

Definition at line 228 of file MooseObjectWarehouseBase.h.

◆ _active_boundary_objects

std::vector<std::map<BoundaryID, std::vector<std::shared_ptr<ScalarInitialCondition > > > > MooseObjectWarehouseBase< ScalarInitialCondition >::_active_boundary_objects
protectedinherited

Active boundary restricted objects (THREAD_ID on outer vector)

Definition at line 234 of file MooseObjectWarehouseBase.h.

◆ _active_objects

std::vector<std::vector<std::shared_ptr<ScalarInitialCondition > > > MooseObjectWarehouseBase< ScalarInitialCondition >::_active_objects
protectedinherited

All active objects (THREAD_ID on outer vector)

Definition at line 222 of file MooseObjectWarehouseBase.h.

Referenced by initialSetup().

◆ _all_block_objects

std::vector<std::map<SubdomainID, std::vector<std::shared_ptr<ScalarInitialCondition > > > > MooseObjectWarehouseBase< ScalarInitialCondition >::_all_block_objects
protectedinherited

Definition at line 225 of file MooseObjectWarehouseBase.h.

◆ _all_boundary_objects

std::vector<std::map<BoundaryID, std::vector<std::shared_ptr<ScalarInitialCondition > > > > MooseObjectWarehouseBase< ScalarInitialCondition >::_all_boundary_objects
protectedinherited

Definition at line 231 of file MooseObjectWarehouseBase.h.

◆ _all_objects

std::vector<std::vector<std::shared_ptr<ScalarInitialCondition > > > MooseObjectWarehouseBase< ScalarInitialCondition >::_all_objects
protectedinherited

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

Definition at line 219 of file MooseObjectWarehouseBase.h.

◆ _all_variable_objects

std::vector<std::map<VariableName, std::vector<std::shared_ptr<ScalarInitialCondition > > > > MooseObjectWarehouseBase< ScalarInitialCondition >::_all_variable_objects
protectedinherited

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

Definition at line 237 of file MooseObjectWarehouseBase.h.

◆ _num_threads

const THREAD_ID MooseObjectWarehouseBase< ScalarInitialCondition >::_num_threads
protectedinherited

Convenience member storing the number of threads used for storage (1 or libMesh::n_threads)

Definition at line 216 of file MooseObjectWarehouseBase.h.


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