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 (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 | 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< InitialConditionBase >> &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... | |
| bool | hasBoundaryObjectsHelper (const std::vector< std::map< BoundaryID, std::vector< std::shared_ptr< InitialConditionBase >>>> &boundary_objects, const THREAD_ID tid=0) const |
| Helper for determining whether we have boundary objects. 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... | |
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 898 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 929 of file MooseObjectWarehouseBase.h.
|
inlineinherited |
Definition at line 469 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 477 of file MooseObjectWarehouseBase.h.
|
inherited |
Return a set of active SubdomainsIDs.
Definition at line 649 of file MooseObjectWarehouseBase.h.
|
inlineinherited |
Definition at line 450 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 458 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 630 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 442 of file MooseObjectWarehouseBase.h.
Referenced by getDependObjects().
|
inlineinherited |
Definition at line 423 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 431 of file MooseObjectWarehouseBase.h.
|
inlineinherited |
Definition at line 396 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 412 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 619 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 388 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 641 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 552 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 563 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 592 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 599 of file MooseObjectWarehouseBase.h.
|
inherited |
Convenience functions for checking/getting specific objects.
Definition at line 608 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 496 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 585 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 404 of file MooseObjectWarehouseBase.h.
|
protectedinherited |
Helper for determining whether we have boundary objects.
Definition at line 572 of file MooseObjectWarehouseBase.h.
|
inherited |
Convenience functions for determining if objects exist.
Definition at line 488 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 504 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 513 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 205 of file MooseObjectWarehouseBase.h.
|
inherited |
Return how many kernels we store in the current warehouse.
Definition at line 306 of file MooseObjectWarehouseBase.h.
|
inherited |
Sort the objects using the DependencyResolver.
Definition at line 689 of file MooseObjectWarehouseBase.h.
|
staticprotectedinherited |
Helper method for sorting vectors of objects.
Definition at line 909 of file MooseObjectWarehouseBase.h.
|
inherited |
Populates a set of covered subdomains and the associated variable names.
Definition at line 880 of file MooseObjectWarehouseBase.h.
|
virtualinherited |
Updates the active objects storage.
Definition at line 660 of file MooseObjectWarehouseBase.h.
|
staticprotectedinherited |
Helper method for updating active vectors.
Definition at line 675 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 778 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 825 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 716 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 788 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 837 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 849 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 727 of file MooseObjectWarehouseBase.h.
|
inherited |
Definition at line 740 of file MooseObjectWarehouseBase.h.
|
inherited |
Update FE variable coupleable vector tag vector for all objects, block-restricted objects, and boundary-restricted objects.
Definition at line 768 of file MooseObjectWarehouseBase.h.
|
staticprotectedinherited |
Helper method for updating FE variable coupleable vector tag vector.
Definition at line 798 of file MooseObjectWarehouseBase.h.
|
inherited |
Update material property dependency vector.
| producer_only | Only append dependencies of materials producing the needed_mat_props |
Definition at line 814 of file MooseObjectWarehouseBase.h.
|
protectedvirtualinherited |
Helper method for updating material property dependency vector.
Definition at line 862 of file MooseObjectWarehouseBase.h.
|
inherited |
Update variable dependency vector.
Definition at line 707 of file MooseObjectWarehouseBase.h.
|
staticprotectedinherited |
Helper method for updating variable dependency vector.
Definition at line 751 of file MooseObjectWarehouseBase.h.
|
protectedinherited |
Active block restricted objects (THREAD_ID on outer vector)
Definition at line 229 of file MooseObjectWarehouseBase.h.
|
protectedinherited |
Active boundary restricted objects (THREAD_ID on outer vector)
Definition at line 235 of file MooseObjectWarehouseBase.h.
|
protectedinherited |
All active objects (THREAD_ID on outer vector)
Definition at line 223 of file MooseObjectWarehouseBase.h.
Referenced by initialSetup().
|
protectedinherited |
Definition at line 226 of file MooseObjectWarehouseBase.h.
|
protectedinherited |
Definition at line 232 of file MooseObjectWarehouseBase.h.
|
protectedinherited |
Storage container for the ALL pointers (THREAD_ID on outer vector)
Definition at line 220 of file MooseObjectWarehouseBase.h.
|
protectedinherited |
All objects with a certain variable selected, as the 'variable' parameter.
Definition at line 238 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 217 of file MooseObjectWarehouseBase.h.
1.8.14