Warehouse for storing initial conditions. More...
#include <InitialConditionWarehouse.h>
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< SubdomainID > | getActiveBlocks (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< InitialConditionBase > | getObject (const std::string &name, THREAD_ID tid=0) const |
std::shared_ptr< InitialConditionBase > | getActiveObject (const std::string &name, THREAD_ID tid=0) const |
void | updateVariableDependency (std::set< MooseVariableFieldBase * > &needed_moose_vars, THREAD_ID tid=0) const |
Update variable dependency vector. More... | |
void | updateBlockVariableDependency (SubdomainID id, std::set< MooseVariableFieldBase * > &needed_moose_vars, THREAD_ID tid=0) const |
void | updateBoundaryVariableDependency (std::set< MooseVariableFieldBase * > &needed_moose_vars, THREAD_ID tid=0) const |
void | updateBoundaryVariableDependency (BoundaryID id, std::set< MooseVariableFieldBase * > &needed_moose_vars, THREAD_ID tid=0) const |
void | updateBlockFEVariableCoupledVectorTagDependency (SubdomainID id, std::set< TagID > &needed_fe_var_vector_tags, THREAD_ID tid=0) const |
Update FE variable coupleable vector tag vector. More... | |
void | updateBoundaryFEVariableCoupledVectorTagDependency (BoundaryID id, std::set< TagID > &needed_fe_var_vector_tags, THREAD_ID tid=0) const |
void | updateMatPropDependency (std::unordered_set< unsigned int > &needed_mat_props, THREAD_ID tid=0) const |
Update material property dependency vector. More... | |
void | updateBlockMatPropDependency (SubdomainID id, std::unordered_set< unsigned int > &needed_mat_props, THREAD_ID tid=0) const |
void | updateBoundaryMatPropDependency (std::unordered_set< unsigned int > &needed_mat_props, THREAD_ID tid=0) const |
void | updateBoundaryMatPropDependency (BoundaryID id, std::unordered_set< unsigned int > &needed_mat_props, THREAD_ID tid=0) const |
Protected Member Functions | |
void | checkThreadID (THREAD_ID tid) const |
Calls assert on thread id. More... | |
Static Protected Member Functions | |
static void | updateActiveHelper (std::vector< std::shared_ptr< 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 |
Warehouse for storing initial conditions.
Definition at line 20 of file InitialConditionWarehouse.h.
|
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.
InitialConditionWarehouse::InitialConditionWarehouse | ( | ) |
Definition at line 16 of file InitialConditionWarehouse.C.
|
inherited |
Output the active content of the warehouse to a string, meant to be output to the console.
tid | the thread id |
prefix | a string to prepend to the string |
Definition at line 847 of file MooseObjectWarehouseBase.h.
|
virtual |
Add object to the warehouse.
Reimplemented from MooseObjectWarehouseBase< InitialConditionBase >.
Definition at line 32 of file InitialConditionWarehouse.C.
Referenced by FEProblemBase::addInitialCondition().
|
inlineprotectedinherited |
Calls assert on thread id.
Definition at line 878 of file MooseObjectWarehouseBase.h.
|
inlineinherited |
Definition at line 452 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 460 of file MooseObjectWarehouseBase.h.
|
inherited |
Return a set of active SubdomainsIDs.
Definition at line 616 of file MooseObjectWarehouseBase.h.
|
inlineinherited |
Definition at line 433 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 441 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 597 of file MooseObjectWarehouseBase.h.
|
inlineinherited |
Retrieve complete vector to the active all/block/boundary restricted objects for a given thread.
tid | The thread id to retrieve objects from |
Definition at line 425 of file MooseObjectWarehouseBase.h.
Referenced by getDependObjects().
|
inlineinherited |
Definition at line 406 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 414 of file MooseObjectWarehouseBase.h.
|
inlineinherited |
Definition at line 379 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 395 of file MooseObjectWarehouseBase.h.
std::set< std::string > InitialConditionWarehouse::getDependObjects | ( | ) | const |
Get a list of dependent UserObjects for this exec type.
Definition at line 90 of file InitialConditionWarehouse.C.
Referenced by FEProblemBase::initialSetup().
|
inherited |
Definition at line 586 of file MooseObjectWarehouseBase.h.
|
inlineinherited |
Retrieve complete vector to the all/block/boundary restricted objects for a given thread.
tid | The thread id to retrieve objects from |
Definition at line 371 of file MooseObjectWarehouseBase.h.
|
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.
|
inherited |
Definition at line 535 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 546 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 555 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 566 of file MooseObjectWarehouseBase.h.
|
inherited |
Convenience functions for checking/getting specific objects.
Definition at line 575 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 479 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 387 of file MooseObjectWarehouseBase.h.
|
inherited |
Convenience functions for determining if objects exist.
Definition at line 471 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 487 of file MooseObjectWarehouseBase.h.
|
inherited |
Whether there are objects for this variable and the set of blocks passed.
var_name | name of the variable |
blocks | blocks to consider |
blocks_covered | subset of blocks for which there is an object |
Definition at line 496 of file MooseObjectWarehouseBase.h.
Initial setup.
Definition at line 24 of file InitialConditionWarehouse.C.
Referenced by FEProblemBase::initialSetup().
|
inlineinherited |
Return the number of threads.
Definition at line 196 of file MooseObjectWarehouseBase.h.
|
inherited |
Return how many kernels we store in the current warehouse.
Definition at line 289 of file MooseObjectWarehouseBase.h.
|
inherited |
Sort the objects using the DependencyResolver.
Definition at line 656 of file MooseObjectWarehouseBase.h.
|
staticprotectedinherited |
Helper method for sorting vectors of objects.
Definition at line 858 of file MooseObjectWarehouseBase.h.
|
inherited |
Populates a set of covered subdomains and the associated variable names.
Definition at line 829 of file MooseObjectWarehouseBase.h.
|
virtualinherited |
Updates the active objects storage.
Definition at line 627 of file MooseObjectWarehouseBase.h.
|
staticprotectedinherited |
Helper method for updating active vectors.
Definition at line 642 of file MooseObjectWarehouseBase.h.
|
inherited |
Update FE variable coupleable vector tag vector.
Definition at line 735 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 780 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 683 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 745 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 791 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 801 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 694 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 707 of file MooseObjectWarehouseBase.h.
|
staticprotectedinherited |
Helper method for updating FE variable coupleable vector tag vector.
Definition at line 755 of file MooseObjectWarehouseBase.h.
|
inherited |
Update material property dependency vector.
Definition at line 771 of file MooseObjectWarehouseBase.h.
|
staticprotectedinherited |
Helper method for updating material property dependency vector.
Definition at line 812 of file MooseObjectWarehouseBase.h.
|
inherited |
Update variable dependency vector.
Definition at line 674 of file MooseObjectWarehouseBase.h.
|
staticprotectedinherited |
Helper method for updating variable dependency vector.
Definition at line 718 of file MooseObjectWarehouseBase.h.
|
protectedinherited |
Active block restricted objects (THREAD_ID on outer vector)
Definition at line 220 of file MooseObjectWarehouseBase.h.
|
protectedinherited |
Active boundary restricted objects (THREAD_ID on outer vector)
Definition at line 226 of file MooseObjectWarehouseBase.h.
|
protectedinherited |
All active objects (THREAD_ID on outer vector)
Definition at line 214 of file MooseObjectWarehouseBase.h.
Referenced by initialSetup().
|
protectedinherited |
Definition at line 217 of file MooseObjectWarehouseBase.h.
|
protectedinherited |
Definition at line 223 of file MooseObjectWarehouseBase.h.
|
protectedinherited |
Storage container for the ALL pointers (THREAD_ID on outer vector)
Definition at line 211 of file MooseObjectWarehouseBase.h.
|
protectedinherited |
All objects with a certain variable selected, as the 'variable' parameter.
Definition at line 229 of file MooseObjectWarehouseBase.h.
|
protected |
Definition at line 50 of file InitialConditionWarehouse.h.
Referenced by addObject().
|
protected |
Definition at line 49 of file InitialConditionWarehouse.h.
Referenced by addObject().
|
protectedinherited |
Convenience member storing the number of threads used for storage (1 or libMesh::n_threads)
Definition at line 208 of file MooseObjectWarehouseBase.h.