15const unsigned int MASTER = std::numeric_limits<unsigned int>::max();
19 random_interface.isNodal(),
20 random_interface.getResetOnTime(),
21 random_interface.getMasterSeed())
29 : _rd_problem(fe_problem),
30 _rd_mesh(fe_problem.
mesh()),
34 _current_master_seed(
std::numeric_limits<unsigned
int>::max()),
43 "Call to updateSeeds() is stale! Check your initialize() or timestepSetup() calls");
95 unsigned int parallel_seed = 0;
112 for (
const auto node_ptr :
115 auto id = node_ptr->id();
119 auto elem_id_it = node_to_elem.find(
id);
121 if (elem_id_it != node_to_elem.end())
123 for (
auto elem_id : elem_id_it->second)
125 const auto * elem_ptr =
mesh.elem_ptr(elem_id);
127 if (elem_ptr && processor_id == elem_ptr->processor_id())
141 for (
const auto & elem_ptr : as_range(
_rd_mesh.
getMesh().active_elements_begin(),
144 auto id = elem_ptr->id();
148 if (processor_id == elem_ptr->processor_id())
const ExecFlagType EXEC_INITIAL
const unsigned int MASTER
void ErrorVector unsigned int
Specialization of SubProblem for solving nonlinear equations plus auxiliary equations.
virtual int & timeStep() const
Class for containing MooseEnum item information.
MeshBase & getMesh()
Accessor for the underlying libMesh Mesh object.
virtual bool isDistributedMesh() const
Returns the final Mesh distribution type.
const std::unordered_map< dof_id_type, std::vector< dof_id_type > > & nodeToElemMap()
If not already created, creates a map from every node to all elements to which they are connected.
static uint32_t randl()
This method returns the next random number (long format) from the generator.
void restoreState()
This method restores the last saved generator state.
void saveState()
This method saves the current state of all generators which can be restored at a later time (i....
static void seed(unsigned int seed)
The method seeds the random number generator.
void updateSeeds(ExecFlagType exec_flag)
This method is called to reset or update the seeds based on the reset_on flag and the passed executio...
unsigned int getSeed(dof_id_type id)
Get the seed for the passed in elem/node id.
unsigned int _current_master_seed
unsigned int _master_seed
FEProblemBase & _rd_problem
std::unordered_map< dof_id_type, unsigned int > _seeds
RandomData(FEProblemBase &fe_problem, const RandomInterface &random_interface)
Interface for objects that need parallel consistent random numbers without patterns over the course o...
processor_id_type processor_id() const
processor_id_type n_processors() const