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 sort(THREAD_ID tid=0)
Sort the objects using the DependencyResolver.
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...
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...
InitialConditionBase serves as the abstract base class for InitialConditions and VectorInitialConditi...
The following methods are specializations for using the libMesh::Parallel::packed_range_* routines fo...
void initialSetup(THREAD_ID tid)
Initial setup.
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...
InitialConditionWarehouse()
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
const SubdomainID ANY_BLOCK_ID
std::vector< std::map< ic_key_type, std::set< BoundaryID > > > _boundary_ics
std::set< std::string > getDependObjects() const
Get a list of dependent UserObjects for this exec type.
virtual void addObject(std::shared_ptr< T > object, THREAD_ID tid=0, bool recurse=true)
Adds an object to the storage structure.
std::vector< std::vector< std::shared_ptr< InitialConditionBase > > > _active_objects
All active objects (THREAD_ID on outer vector)
A base storage container for MooseObjects.