18 _boundary_ics(
libMesh::n_threads()),
19 _block_ics(
libMesh::n_threads())
38 const auto ic_key = std::tuple(var.
name(), object->getState());
41 if (object->boundaryRestricted())
44 mooseError(
"You are trying to set a boundary restricted variable on non-nodal variable. That "
48 if (iter !=
_boundary_ics[tid].end() && object->hasBoundary(iter->second))
51 "' is being defined on a boundary that already has an initial condition defined "
52 "with the same variable and state.");
54 _boundary_ics[tid][ic_key].insert(object->boundaryIDs().begin(), object->boundaryIDs().end());
58 else if (object->blockRestricted())
62 (object->hasBlocks(iter->second) ||
66 "' is being defined on a block that already has an initial condition defined "
67 "with the same variable and state.");
69 _block_ics[tid][ic_key].insert(object->blockIDs().begin(), object->blockIDs().end());
79 "' is being defined on a block that already has an initial condition defined "
80 "with the same variable and state.");
92 std::set<std::string> depend_objects;
95 for (
const auto & ic : ics)
97 const auto & uo = ic->getDependObjects();
98 depend_objects.insert(uo.begin(), uo.end());
101 return depend_objects;
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application.
InitialConditionBase serves as the abstract base class for InitialConditions and VectorInitialConditi...
InitialConditionWarehouse()
std::set< std::string > getDependObjects() const
Get a list of dependent UserObjects for this exec type.
void addObject(std::shared_ptr< InitialConditionBase > object, THREAD_ID tid, bool recurse=true)
Add object to the warehouse.
std::vector< std::map< ic_key_type, std::set< SubdomainID > > > _block_ics
void initialSetup(THREAD_ID tid)
Initial setup.
std::vector< std::map< ic_key_type, std::set< BoundaryID > > > _boundary_ics
const std::string & name() const
Get the name of the class.
A base storage container for MooseObjects.
std::vector< std::vector< std::shared_ptr< InitialConditionBase > > > _active_objects
All active objects (THREAD_ID on outer vector)
void sort(THREAD_ID tid=0)
Sort the objects using the DependencyResolver.
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true)
Adds an object to the storage structure.
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.
virtual bool isNodal() const
Is this variable nodal.
This class provides an interface for common operations on field variables of both FE and FV types wit...
const SubdomainID ANY_BLOCK_ID
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...