11 #include "libmesh/parallel_algebra.h"
13 #include "libmesh/quadrature.h"
22 params.addClassDescription(
"Manages the list of currently active nucleation sites and adds new "
23 "sites according to a given probability function.");
24 params.addRequiredParam<MaterialPropertyName>(
25 "probability",
"Probability density for inserting a discrete nucleus");
26 params.addRequiredParam<Real>(
"hold_time",
"Time to keep each nucleus active");
32 _probability(getMaterialProperty<Real>(
"probability")),
33 _hold_time(getParam<Real>(
"hold_time")),
34 _local_nucleus_list(declareRestartableData(
"local_nucleus_list",
NucleusList(0)))
45 if (_fe_problem.converged())
74 for (
unsigned int qp = 0; qp < _qrule->n_points(); ++qp)
76 const Real rate =
_probability[qp] * _JxW[qp] * _coord[qp];
79 const Real random = getRandomReal();
86 if (random < rate * _fe_problem.dt() && random < (1.0 - std::exp(-rate * _fe_problem.dt())))
132 _communicator.allgather(comm_buffer);
135 unsigned int n = comm_buffer.size() / 4;
136 mooseAssert(comm_buffer.size() % 4 == 0,
137 "Communication buffer has an unexpected size (not divisible by 4)");
139 for (
unsigned i = 0; i < n; ++i)