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

Warehouse for storing initial conditions. More...

#include <InitialConditionWarehouse.h>

Inheritance diagram for InitialConditionWarehouse:
[legend]

Public Member Functions

 InitialConditionWarehouse ()
 
void initialSetup (THREAD_ID tid)
 Initial setup. More...
 
void addObject (std::shared_ptr< InitialConditionBase > object, THREAD_ID tid, bool recurse=true)
 Add object to the warehouse. More...
 
std::set< std::string > getDependObjects () const
 Get a list of dependent UserObjects for this exec type. 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< InitialConditionBase > > & 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< InitialConditionBase > > & 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< InitialConditionBase > > > & getBlockObjects (THREAD_ID tid=0) const
 
const std::vector< std::shared_ptr< InitialConditionBase > > & getBlockObjects (SubdomainID id, THREAD_ID tid=0) const
 
const std::map< BoundaryID, std::vector< std::shared_ptr< InitialConditionBase > > > & getBoundaryObjects (THREAD_ID tid=0) const
 
const std::vector< std::shared_ptr< InitialConditionBase > > & getBoundaryObjects (BoundaryID id, THREAD_ID tid=0) const
 
const std::vector< std::shared_ptr< InitialConditionBase > > & 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< InitialConditionBase > > > & getActiveBlockObjects (THREAD_ID tid=0) const
 
const std::vector< std::shared_ptr< InitialConditionBase > > & getActiveBlockObjects (SubdomainID id, THREAD_ID tid=0) const
 
const std::map< BoundaryID, std::vector< std::shared_ptr< InitialConditionBase > > > & getActiveBoundaryObjects (THREAD_ID tid=0) const
 
const std::vector< std::shared_ptr< InitialConditionBase > > & 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< InitialConditionBasegetObject (const std::string &name, THREAD_ID tid=0) const
 
std::shared_ptr< InitialConditionBasegetActiveObject (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< InitialConditionBase >> &active, const std::vector< std::shared_ptr< InitialConditionBase >> &all)
 Helper method for updating active vectors. More...
 
static void sortHelper (std::vector< std::shared_ptr< InitialConditionBase >> &objects)
 Helper method for sorting vectors of objects. More...
 
static void updateVariableDependencyHelper (std::set< MooseVariableFieldBase * > &needed_moose_vars, const std::vector< std::shared_ptr< InitialConditionBase >> &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< InitialConditionBase >> &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< InitialConditionBase >> &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< InitialConditionBase > > > _all_objects
 Storage container for the ALL pointers (THREAD_ID on outer vector) More...
 
std::vector< std::vector< std::shared_ptr< InitialConditionBase > > > _active_objects
 All active objects (THREAD_ID on outer vector) More...
 
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< InitialConditionBase > > > > _all_block_objects
 
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< InitialConditionBase > > > > _active_block_objects
 Active block restricted objects (THREAD_ID on outer vector) More...
 
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< InitialConditionBase > > > > _all_boundary_objects
 
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< InitialConditionBase > > > > _active_boundary_objects
 Active boundary restricted objects (THREAD_ID on outer vector) More...
 
std::vector< std::map< VariableName, std::vector< std::shared_ptr< InitialConditionBase > > > > _all_variable_objects
 All objects with a certain variable selected, as the 'variable' parameter. More...
 
using ic_key_type = std::tuple< VariableName, unsigned short >
 
std::vector< std::map< ic_key_type, std::set< BoundaryID > > > _boundary_ics
 
std::vector< std::map< ic_key_type, std::set< SubdomainID > > > _block_ics
 

Detailed Description

Warehouse for storing initial conditions.

Definition at line 20 of file InitialConditionWarehouse.h.

Member Typedef Documentation

◆ ic_key_type

using InitialConditionWarehouse::ic_key_type = std::tuple<VariableName, unsigned short>
protected

Maps used to check if multiple ICs define the same variable on the same block/boundary for the same state (e.g CURRENT, OLD, OLDER). They are vectors of maps because each map is repeated for each thread. Each map relates string-int tuples to a set of block/boundary IDs. The string-int tuple is a unique identifier for a specific variable and state. The string-int tuple is renamed to ic_key_type for clarity. The algorithm then makes sure that a new IC object does not overlap with a previous IC object (i.e. same block/boundary).

Definition at line 48 of file InitialConditionWarehouse.h.

Constructor & Destructor Documentation

◆ InitialConditionWarehouse()

InitialConditionWarehouse::InitialConditionWarehouse ( )

Definition at line 16 of file InitialConditionWarehouse.C.

20 {
21 }
unsigned int n_threads()
std::vector< std::map< ic_key_type, std::set< SubdomainID > > > _block_ics
std::vector< std::map< ic_key_type, std::set< BoundaryID > > > _boundary_ics

Member Function Documentation

◆ activeObjectsToFormattedString()

std::string MooseObjectWarehouseBase< InitialConditionBase >::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 847 of file MooseObjectWarehouseBase.h.

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< InitialConditionBase > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ addObject()

void InitialConditionWarehouse::addObject ( std::shared_ptr< InitialConditionBase object,
THREAD_ID  tid,
bool  recurse = true 
)
virtual

Add object to the warehouse.

Reimplemented from MooseObjectWarehouseBase< InitialConditionBase >.

Definition at line 32 of file InitialConditionWarehouse.C.

Referenced by FEProblemBase::addInitialCondition().

35 {
36  // Check that when object is boundary restricted that the variable is nodal
37  const MooseVariableFEBase & var = object->variable();
38  const auto ic_key = std::tuple(var.name(), object->getState());
39 
40  // Boundary Restricted
41  if (object->boundaryRestricted())
42  {
43  if (!var.isNodal())
44  mooseError("You are trying to set a boundary restricted variable on non-nodal variable. That "
45  "is not allowed.");
46 
47  const auto iter = _boundary_ics[tid].find(ic_key);
48  if (iter != _boundary_ics[tid].end() && object->hasBoundary(iter->second))
49  mooseError("The initial condition '",
50  object->name(),
51  "' is being defined on a boundary that already has an initial condition defined "
52  "with the same variable and state.");
53  else
54  _boundary_ics[tid][ic_key].insert(object->boundaryIDs().begin(), object->boundaryIDs().end());
55  }
56 
57  // Block Restricted
58  else if (object->blockRestricted())
59  {
60  auto iter = _block_ics[tid].find(ic_key);
61  if (iter != _block_ics[tid].end() &&
62  (object->hasBlocks(iter->second) ||
63  (iter->second.find(Moose::ANY_BLOCK_ID) != iter->second.end())))
64  mooseError("The initial condition '",
65  object->name(),
66  "' is being defined on a block that already has an initial condition defined "
67  "with the same variable and state.");
68  else
69  _block_ics[tid][ic_key].insert(object->blockIDs().begin(), object->blockIDs().end());
70  }
71 
72  // Non-restricted
73  else
74  {
75  auto iter = _block_ics[tid].find(ic_key);
76  if (iter != _block_ics[tid].end())
77  mooseError("The initial condition '",
78  object->name(),
79  "' is being defined on a block that already has an initial condition defined "
80  "with the same variable and state.");
81  else
82  _block_ics[tid][ic_key].insert(Moose::ANY_BLOCK_ID);
83  }
84 
85  // Add the IC to the storage
87 }
virtual bool isNodal() const
Is this variable nodal.
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
Definition: MooseError.h:302
const std::string & name() const override
Get the variable name.
This class provides an interface for common operations on field variables of both FE and FV types wit...
std::vector< std::map< ic_key_type, std::set< SubdomainID > > > _block_ics
const SubdomainID ANY_BLOCK_ID
Definition: MooseTypes.C:19
std::vector< std::map< ic_key_type, std::set< BoundaryID > > > _boundary_ics
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true)
Adds an object to the storage structure.

◆ checkThreadID()

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

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]

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

Definition at line 452 of file MooseObjectWarehouseBase.h.

453 {
454  checkThreadID(tid);
455  return _active_block_objects[tid];
456 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< InitialConditionBase > > > > _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< InitialConditionBase > > & MooseObjectWarehouseBase< InitialConditionBase >::getActiveBlockObjects ( SubdomainID  id,
THREAD_ID  tid = 0 
) const
inherited

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< InitialConditionBase > > > > _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< InitialConditionBase >::getActiveBlocks ( THREAD_ID  tid = 0) const
inherited

Return a set of active SubdomainsIDs.

Definition at line 616 of file MooseObjectWarehouseBase.h.

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< InitialConditionBase > > > > _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< InitialConditionBase > > > & MooseObjectWarehouseBase< InitialConditionBase >::getActiveBoundaryObjects ( THREAD_ID  tid = 0) const
inlineinherited

Definition at line 433 of file MooseObjectWarehouseBase.h.

434 {
435  checkThreadID(tid);
436  return _active_boundary_objects[tid];
437 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< InitialConditionBase > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)

◆ getActiveBoundaryObjects() [2/2]

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

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< InitialConditionBase > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)

◆ getActiveObject()

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

Definition at line 597 of file MooseObjectWarehouseBase.h.

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< InitialConditionBase > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ getActiveObjects()

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

Referenced by getDependObjects().

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< InitialConditionBase > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ getBlockObjects() [1/2]

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

Definition at line 406 of file MooseObjectWarehouseBase.h.

407 {
408  checkThreadID(tid);
409  return _all_block_objects[tid];
410 }
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< InitialConditionBase > > > > _all_block_objects
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.

◆ getBlockObjects() [2/2]

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

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< InitialConditionBase > > > > _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< InitialConditionBase > > > & MooseObjectWarehouseBase< InitialConditionBase >::getBoundaryObjects ( THREAD_ID  tid = 0) const
inlineinherited

Definition at line 379 of file MooseObjectWarehouseBase.h.

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< InitialConditionBase > > > > _all_boundary_objects

◆ getBoundaryObjects() [2/2]

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

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< InitialConditionBase > > > > _all_boundary_objects

◆ getDependObjects()

std::set< std::string > InitialConditionWarehouse::getDependObjects ( ) const

Get a list of dependent UserObjects for this exec type.

Returns
a set of dependent user objects

Definition at line 90 of file InitialConditionWarehouse.C.

Referenced by FEProblemBase::initialSetup().

91 {
92  std::set<std::string> depend_objects;
93 
94  const auto & ics = getActiveObjects();
95  for (const auto & ic : ics)
96  {
97  const auto & uo = ic->getDependObjects();
98  depend_objects.insert(uo.begin(), uo.end());
99  }
100 
101  return depend_objects;
102 }
const std::vector< std::shared_ptr< InitialConditionBase > > & getActiveObjects(THREAD_ID tid=0) const
Retrieve complete vector to the active all/block/boundary restricted objects for a given thread...

◆ getObject()

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

Definition at line 586 of file MooseObjectWarehouseBase.h.

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< InitialConditionBase > > > _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< InitialConditionBase > > & MooseObjectWarehouseBase< InitialConditionBase >::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 371 of file MooseObjectWarehouseBase.h.

372 {
373  checkThreadID(tid);
374  return _all_objects[tid];
375 }
std::vector< std::vector< std::shared_ptr< InitialConditionBase > > > _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< InitialConditionBase > > & MooseObjectWarehouseBase< InitialConditionBase >::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 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< InitialConditionBase > > > > _all_variable_objects
All objects with a certain variable selected, as the &#39;variable&#39; parameter.

◆ hasActiveBlockObjects() [1/2]

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

Definition at line 535 of file MooseObjectWarehouseBase.h.

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< InitialConditionBase > > > > _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< InitialConditionBase >::hasActiveBlockObjects ( SubdomainID  id,
THREAD_ID  tid = 0 
) const
inherited

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< InitialConditionBase > > > > _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< InitialConditionBase >::hasActiveBoundaryObjects ( THREAD_ID  tid = 0) const
inherited

Definition at line 555 of file MooseObjectWarehouseBase.h.

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< InitialConditionBase > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)

◆ hasActiveBoundaryObjects() [2/2]

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

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< InitialConditionBase > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)

◆ hasActiveObject()

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

Convenience functions for checking/getting specific objects.

Definition at line 575 of file MooseObjectWarehouseBase.h.

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< InitialConditionBase > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ hasActiveObjects()

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

Definition at line 479 of file MooseObjectWarehouseBase.h.

480 {
481  checkThreadID(tid);
482  return !_active_objects[tid].empty();
483 }
void checkThreadID(THREAD_ID tid) const
Calls assert on thread id.
std::vector< std::vector< std::shared_ptr< InitialConditionBase > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ hasBoundaryObjects()

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

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< InitialConditionBase > > > > _all_boundary_objects

◆ hasObjects()

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

Convenience functions for determining if objects exist.

Definition at line 471 of file MooseObjectWarehouseBase.h.

472 {
473  checkThreadID(tid);
474  return !_all_objects[tid].empty();
475 }
std::vector< std::vector< std::shared_ptr< InitialConditionBase > > > _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< InitialConditionBase >::hasObjectsForVariable ( const VariableName &  var_name,
THREAD_ID  tid 
) const
inherited

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< InitialConditionBase > > > > _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< InitialConditionBase >::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 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< InitialConditionBase > > > > _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 InitialConditionWarehouse::initialSetup ( THREAD_ID  tid)

Initial setup.

Definition at line 24 of file InitialConditionWarehouse.C.

Referenced by FEProblemBase::initialSetup().

25 {
27  for (const auto & ic : _active_objects[tid])
28  ic->initialSetup();
29 }
void sort(THREAD_ID tid=0)
Sort the objects using the DependencyResolver.
std::vector< std::vector< std::shared_ptr< InitialConditionBase > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ numThreads()

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

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

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

Return how many kernels we store in the current warehouse.

Definition at line 289 of file MooseObjectWarehouseBase.h.

290 {
291  checkThreadID(tid);
292  return _all_objects[tid].size();
293 }
std::vector< std::vector< std::shared_ptr< InitialConditionBase > > > _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 656 of file MooseObjectWarehouseBase.h.

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< InitialConditionBase > > > > _all_block_objects
std::vector< std::vector< std::shared_ptr< InitialConditionBase > > > _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< InitialConditionBase >> &objects)
Helper method for sorting vectors of objects.
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< InitialConditionBase > > > > _all_boundary_objects
virtual void updateActive(THREAD_ID tid=0)
Updates the active objects storage.

◆ sortHelper()

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

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

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

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< InitialConditionBase > > > > _active_block_objects
Active block restricted objects (THREAD_ID on outer vector)
std::vector< std::vector< std::shared_ptr< InitialConditionBase > > > _active_objects
All active objects (THREAD_ID on outer vector)

◆ updateActive()

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

Updates the active objects storage.

Definition at line 627 of file MooseObjectWarehouseBase.h.

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< InitialConditionBase > > > > _all_block_objects
std::vector< std::vector< std::shared_ptr< InitialConditionBase > > > _all_objects
Storage container for the ALL pointers (THREAD_ID on outer vector)
std::vector< std::map< SubdomainID, std::vector< std::shared_ptr< InitialConditionBase > > > > _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< InitialConditionBase > > > > _active_boundary_objects
Active boundary restricted objects (THREAD_ID on outer vector)
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< InitialConditionBase > > > > _all_boundary_objects
std::vector< std::vector< std::shared_ptr< InitialConditionBase > > > _active_objects
All active objects (THREAD_ID on outer vector)
static void updateActiveHelper(std::vector< std::shared_ptr< InitialConditionBase >> &active, const std::vector< std::shared_ptr< InitialConditionBase >> &all)
Helper method for updating active vectors.

◆ updateActiveHelper()

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

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

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

Update FE variable coupleable vector tag vector.

Definition at line 735 of file MooseObjectWarehouseBase.h.

737 {
738  if (hasActiveBlockObjects(id, tid))
739  updateFEVariableCoupledVectorTagDependencyHelper(needed_fe_var_vector_tags,
740  getActiveBlockObjects(id, tid));
741 }
const std::map< SubdomainID, std::vector< std::shared_ptr< InitialConditionBase > > > & getActiveBlockObjects(THREAD_ID tid=0) const
static void updateFEVariableCoupledVectorTagDependencyHelper(std::set< TagID > &needed_fe_var_vector_tags, const std::vector< std::shared_ptr< InitialConditionBase >> &objects)
Helper method for updating FE variable coupleable vector tag vector.

◆ updateBlockMatPropDependency()

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

Definition at line 780 of file MooseObjectWarehouseBase.h.

784 {
785  if (hasActiveBlockObjects(id, tid))
786  updateMatPropDependencyHelper(needed_mat_props, getActiveBlockObjects(id, tid));
787 }
const std::map< SubdomainID, std::vector< std::shared_ptr< InitialConditionBase > > > & getActiveBlockObjects(THREAD_ID tid=0) const
static void updateMatPropDependencyHelper(std::unordered_set< unsigned int > &needed_mat_props, const std::vector< std::shared_ptr< InitialConditionBase >> &objects)
Helper method for updating material property dependency vector.

◆ updateBlockVariableDependency()

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

Definition at line 683 of file MooseObjectWarehouseBase.h.

687 {
688  if (hasActiveBlockObjects(id, tid))
689  updateVariableDependencyHelper(needed_moose_vars, getActiveBlockObjects(id, tid));
690 }
const std::map< SubdomainID, std::vector< std::shared_ptr< InitialConditionBase > > > & getActiveBlockObjects(THREAD_ID tid=0) const
static void updateVariableDependencyHelper(std::set< MooseVariableFieldBase * > &needed_moose_vars, const std::vector< std::shared_ptr< InitialConditionBase >> &objects)
Helper method for updating variable dependency vector.

◆ updateBoundaryFEVariableCoupledVectorTagDependency()

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

Definition at line 745 of file MooseObjectWarehouseBase.h.

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< InitialConditionBase >> &objects)
Helper method for updating FE variable coupleable vector tag vector.
const std::map< BoundaryID, std::vector< std::shared_ptr< InitialConditionBase > > > & getActiveBoundaryObjects(THREAD_ID tid=0) const

◆ updateBoundaryMatPropDependency() [1/2]

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

Definition at line 791 of file MooseObjectWarehouseBase.h.

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 }
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< InitialConditionBase > > > > _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< InitialConditionBase >> &objects)
Helper method for updating material property dependency vector.

◆ updateBoundaryMatPropDependency() [2/2]

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

Definition at line 801 of file MooseObjectWarehouseBase.h.

805 {
806  if (hasActiveBoundaryObjects(id, tid))
807  updateMatPropDependencyHelper(needed_mat_props, getActiveBoundaryObjects(id, tid));
808 }
static void updateMatPropDependencyHelper(std::unordered_set< unsigned int > &needed_mat_props, const std::vector< std::shared_ptr< InitialConditionBase >> &objects)
Helper method for updating material property dependency vector.
const std::map< BoundaryID, std::vector< std::shared_ptr< InitialConditionBase > > > & getActiveBoundaryObjects(THREAD_ID tid=0) const

◆ updateBoundaryVariableDependency() [1/2]

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

Definition at line 694 of file MooseObjectWarehouseBase.h.

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 }
std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< InitialConditionBase > > > > _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< InitialConditionBase >> &objects)
Helper method for updating variable dependency vector.

◆ updateBoundaryVariableDependency() [2/2]

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

Definition at line 707 of file MooseObjectWarehouseBase.h.

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

◆ updateFEVariableCoupledVectorTagDependencyHelper()

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

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

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

Update material property dependency vector.

Definition at line 771 of file MooseObjectWarehouseBase.h.

773 {
774  if (hasActiveObjects(tid))
775  updateMatPropDependencyHelper(needed_mat_props, _all_objects[tid]);
776 }
std::vector< std::vector< std::shared_ptr< InitialConditionBase > > > _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< InitialConditionBase >> &objects)
Helper method for updating material property dependency vector.

◆ updateMatPropDependencyHelper()

void MooseObjectWarehouseBase< InitialConditionBase >::updateMatPropDependencyHelper ( std::unordered_set< unsigned int > &  needed_mat_props,
const std::vector< std::shared_ptr< InitialConditionBase >> &  objects 
)
staticprotectedinherited

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

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

Update variable dependency vector.

Definition at line 674 of file MooseObjectWarehouseBase.h.

676 {
677  if (hasActiveObjects(tid))
678  updateVariableDependencyHelper(needed_moose_vars, _all_objects[tid]);
679 }
std::vector< std::vector< std::shared_ptr< InitialConditionBase > > > _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< InitialConditionBase >> &objects)
Helper method for updating variable dependency vector.

◆ updateVariableDependencyHelper()

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

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.

Member Data Documentation

◆ _active_block_objects

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

Active block restricted objects (THREAD_ID on outer vector)

Definition at line 220 of file MooseObjectWarehouseBase.h.

◆ _active_boundary_objects

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

Active boundary restricted objects (THREAD_ID on outer vector)

Definition at line 226 of file MooseObjectWarehouseBase.h.

◆ _active_objects

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

All active objects (THREAD_ID on outer vector)

Definition at line 214 of file MooseObjectWarehouseBase.h.

Referenced by initialSetup().

◆ _all_block_objects

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

Definition at line 217 of file MooseObjectWarehouseBase.h.

◆ _all_boundary_objects

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

Definition at line 223 of file MooseObjectWarehouseBase.h.

◆ _all_objects

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

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

Definition at line 211 of file MooseObjectWarehouseBase.h.

◆ _all_variable_objects

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

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

Definition at line 229 of file MooseObjectWarehouseBase.h.

◆ _block_ics

std::vector<std::map<ic_key_type, std::set<SubdomainID> > > InitialConditionWarehouse::_block_ics
protected

Definition at line 50 of file InitialConditionWarehouse.h.

Referenced by addObject().

◆ _boundary_ics

std::vector<std::map<ic_key_type, std::set<BoundaryID> > > InitialConditionWarehouse::_boundary_ics
protected

Definition at line 49 of file InitialConditionWarehouse.h.

Referenced by addObject().

◆ _num_threads

const THREAD_ID MooseObjectWarehouseBase< InitialConditionBase >::_num_threads
protectedinherited

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

Definition at line 208 of file MooseObjectWarehouseBase.h.


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