11 #include "MooseMesh.h"
22 params.addClassDescription(
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).");
25 params.addRequiredParam<FileName>(
26 "file",
"CSV file with (time, x, y, z) coordinates for nucleation events.");
27 params.addRequiredParam<Real>(
"hold_time",
"Time to keep each nucleus active");
28 params.addParam<Real>(
"tolerance", 1e-9,
"Tolerance for determining insertion time");
34 _hold_time(getParam<Real>(
"hold_time")),
35 _reader(getParam<FileName>(
"file")),
37 _tol(getParam<Real>(
"tolerance")),
42 auto & names =
_reader.getNames();
43 auto & data =
_reader.getData();
45 const std::size_t rows = data[0].size();
48 bool found_time =
false;
53 for (std::size_t i = 0; i < names.size(); ++i)
56 if (data[i].size() != rows)
57 paramError(
"file",
"Mismatching column lengths in file");
59 if (names[i] ==
"time")
61 for (std::size_t j = 0; j < rows; ++j)
65 else if (names[i] ==
"x")
67 for (std::size_t j = 0; j < rows; ++j)
71 else if (names[i] ==
"y")
73 for (std::size_t j = 0; j < rows; ++j)
77 else if (names[i] ==
"z")
79 for (std::size_t j = 0; j < rows; ++j)
87 paramError(
"file",
"Missing 'time' column in file");
89 paramError(
"file",
"Missing 'x' column in file");
90 if (!found_y && _mesh.dimension() >= 2)
91 paramError(
"file",
"Missing 'y' column in file");
92 if (!found_z && _mesh.dimension() >= 3)
93 paramError(
"file",
"Missing 'z' column in file");
106 if (_fe_problem.converged())