23 "Manages the list of currently active nucleation sites and adds new " 24 "sites according to a predetermined list from a CSV file (use this with sync_times).");
27 "CSV file with (time, x, y, z) coordinates for nucleation events and optionally radius.");
29 params.
addParam<
Real>(
"tolerance", 1e-9,
"Tolerance for determining insertion time");
37 _hold_time(getParam<
Real>(
"hold_time")),
38 _reader(getParam<FileName>(
"file")),
40 _tol(getParam<
Real>(
"tolerance")),
41 _nucleation_rate(0.0),
42 _fixed_radius(isParamValid(
"radius")),
43 _radius(_fixed_radius ? getParam<
Real>(
"radius") : 0)
50 const std::size_t rows = data[0].size();
53 bool found_time =
false;
59 for (std::size_t i = 0; i < names.size(); ++i)
62 if (data[i].size() != rows)
63 paramError(
"file",
"Mismatching column lengths in file");
65 if (names[i] ==
"time")
67 for (std::size_t
j = 0;
j < rows; ++
j)
71 else if (names[i] ==
"x")
73 for (std::size_t
j = 0;
j < rows; ++
j)
77 else if (names[i] ==
"y")
79 for (std::size_t
j = 0;
j < rows; ++
j)
83 else if (names[i] ==
"z")
85 for (std::size_t
j = 0;
j < rows; ++
j)
89 else if (names[i] ==
"r")
91 for (std::size_t
j = 0;
j < rows; ++
j)
96 for (std::size_t
j = 0;
j < rows; ++
j)
102 paramError(
"file",
"Missing 'time' column in file");
104 paramError(
"file",
"Missing 'x' column in file");
106 paramError(
"file",
"Missing 'y' column in file");
108 paramError(
"file",
"Missing 'z' column in file");
110 paramError(
"file",
"Missing 'r' column in file");
registerMooseObject("PhaseFieldApp", DiscreteNucleationFromFile)
NucleusChanges _changes_made
count the number of nucleus insertions and deletions
This UserObject manages the insertion and expiration of nuclei in the simulation domain.
void initialize() override
virtual Real & time() const
static InputParameters validParams()
virtual bool converged(const unsigned int nl_sys_num)
const std::vector< std::vector< double > > & getData() const
NucleusList _nucleation_history
Total nucleation history read from file.
MooseUtils::DelimitedFileReader _reader
CSV file to read.
static InputParameters validParams()
A nucleus has an expiration time, a location, and a size.
This UserObject manages the insertion and expiration of nuclei in the simulation domain it manages a ...
virtual unsigned int dimension() const
void paramError(const std::string ¶m, Args... args) const
unsigned int number() const
const std::vector< std::string > & getNames() const
bool _fixed_radius
Is a fixed radius or variable radius used?
bool _update_required
is a map update required
DiscreteNucleationFromFile(const InputParameters ¶meters)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
FEProblemBase & _fe_problem
const Real _radius
hold the radius of the nucleus
NucleusList & _global_nucleus_list
the global list of all nuclei over all processors
const Real _hold_time
Duration of time each nucleus is kept active after insertion.
std::size_t _history_pointer
pointer to the next nucleation event in the history
const Real _tol
tolerance for determining insertion time
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
static const std::string center