11#include "libmesh/parallel_algebra.h"
14#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.");
25 "probability",
"Probability density for inserting a discrete nucleus");
26 params.
addRequiredParam<Real>(
"hold_time",
"Time to keep each nucleus active");
27 params.
addParam<MaterialPropertyName>(
"radius",
29 "variable radius material property name, supply a value if "
30 "radius is constant in the simulation");
31 params.
addParam<
bool>(
"time_dependent_statistics",
33 "flag if time-dependent or time-independent statistics are used");
40 _probability(getMaterialProperty<Real>(
"probability")),
41 _hold_time(getParam<Real>(
"hold_time")),
42 _local_nucleus_list(declareRestartableData<
NucleusList>(
"local_nucleus_list", 0)),
43 _local_radius(getMaterialProperty<Real>(
"radius")),
44 _time_dep_stats(getParam<bool>(
"time_dependent_statistics"))
84 for (
unsigned int qp = 0; qp <
_qrule->n_points(); ++qp)
156 unsigned int n = comm_buffer.size() / 5;
157 mooseAssert(comm_buffer.size() % 5 == 0,
158 "Communication buffer has an unexpected size (not divisible by 5)");
161 for (
unsigned i = 0; i < n; ++i)
registerMooseObject("PhaseFieldApp", DiscreteNucleationInserter)
const std::vector< double > y
This UserObject manages the insertion and expiration of nuclei in the simulation domain it manages a ...
bool _update_required
is a map update required
NucleusChanges _changes_made
count the number of nucleus insertions and deletions
static InputParameters validParams()
NucleusList & _global_nucleus_list
the global list of all nuclei over all processors
std::vector< NucleusLocation > NucleusList
Every MPI task should keep a full list of nuclei (in case they cross domains with their finite radii)
This UserObject manages the insertion and expiration of nuclei in the simulation domain it manages a ...
const MaterialProperty< Real > & _local_radius
store the local nucleus radius
Real _hold_time
Duration of time each nucleus is kept active after insertion.
DiscreteNucleationInserter(const InputParameters ¶meters)
virtual void initialize()
static InputParameters validParams()
const MaterialProperty< Real > & _probability
Nucleation rate density (should be a material property implementing nucleation theory)
const bool _time_dep_stats
indicates whether time-dependent statistics are used or not
virtual void threadJoin(const UserObject &y)
virtual void addNucleus(unsigned int &qp)
Adds a nucleus to the list containing nucleus information.
NucleusList & _local_nucleus_list
the local nucleus list of nuclei centered in the domain of the current processor
Real _nucleation_rate
Total nucleation rate.
const QBase *const & _qrule
const MooseArray< Real > & _coord
const MooseArray< Real > & _JxW
const MooseArray< Point > & _q_point
virtual Real & dt() const
virtual Real & time() const
Real getRandomReal() const
virtual bool converged(const unsigned int sys_num)
unsigned int number() const
void allgather(const T &send_data, std::vector< T, A > &recv_data) const
FEProblemBase & _fe_problem
const Parallel::Communicator & _communicator
A nucleus has an expiration time, a location, and a size.