28 auto const field_name =
34 if (range.size() != 2)
37 "The range needs to have two components, but {:d} were given.",
43 DBUG(
"Generating field {:s} with range {:g} to {:g} and seed {:d}.",
44 field_name, range[0], range[1], seed);
46 std::vector<double> values(mesh.
getElements().size());
48 std::mt19937 generator(seed);
49 std::uniform_real_distribution<> distr(range[0], range[1]);
50 auto gen = [&distr, &generator]() {
return distr(generator); };
51 generate(begin(values), end(values), gen);
56 auto const&
property =
61 OGS_FATAL(
"The mesh property `{:s}' is not an element property.",
65 return std::make_unique<RandomFieldMeshElementParameter<double>>(name, mesh,