33 std::vector<std::unique_ptr<MeshLib::Mesh>>& meshes)
35 auto const mesh_name = output_mesh_config.
getValue<std::string>();
38 auto material_id_string =
43 if (!material_id_string)
48 auto const material_ids_for_output =
53 mesh, material_ids_for_output,
55 auto const* bulk_mesh =
58 bulk_mesh, subdomain_mesh.get()));
61 mesh, material_ids_for_output,
65 return meshes.back()->
getName();
72 std::vector<std::unique_ptr<MeshLib::Mesh>>& meshes)
80 const std::map<std::string, OutputType> outputType_to_enum = {
82 auto type = outputType_to_enum.at(output_type);
86 catch (std::out_of_range&)
89 "No supported file type provided. Read `{:s}' from <output><type> \
90 in prj File. Supported: VTK, XDMF.",
103 "_ts_{:timestep}_t_{:time}");
118 return hdf->getConfigParameter<
unsigned int>(
"number_of_files");
127 return hdf->getConfigParameter<
unsigned int>(
"chunk_size_bytes");
149 "fixed_output_times_from_file",
"no_file");
151 if (filename !=
"no_file")
167 for (
auto pair : timesteps->getConfigSubtreeList(
"pair"))
170 auto repeat = pair.getConfigParameter<
unsigned>(
"repeat");
172 auto each_steps = pair.getConfigParameter<
unsigned>(
"each_steps");
174 assert(repeat != 0 && each_steps != 0);
175 repeats_each_steps.emplace_back(repeat, each_steps);
178 if (repeats_each_steps.empty())
181 "You have not given any pair (<repeat/>, <each_steps/>) that "
182 "defines at which timesteps output shall be written. "
191 repeats_each_steps.emplace_back(1, 1);
200 out_vars.getConfigParameterList<std::string>(
"variable"))
202 if (output_variables.find(out_var) != output_variables.cend())
204 OGS_FATAL(
"output variable `{:s}' specified more than once.",
208 DBUG(
"adding output variable `{:s}'", out_var);
209 output_variables.insert(out_var);
221 if (output_config.
prefix.find(
"{:meshname}") == std::string::npos)
224 "There are multiple meshes defined in the output section of "
225 "the project file, but the prefix doesn't contain "
226 "'{{:meshname}}'. Thus the names for the files, the simulation "
227 "results should be written to, would not be distinguishable "
228 "for different meshes.");
231 for (
auto mesh_config : meshes_config->getConfigParameterList(
"mesh"))
233 mesh_names_for_output.push_back(
235 INFO(
"Configure mesh '{:s}' for output.",
236 mesh_names_for_output.back());
240 if (
auto const geometrical_sets_config =
245 auto geometrical_set_config :
247 geometrical_sets_config->getConfigSubtreeList(
"geometrical_set"))
249 auto const geometrical_set_name =
251 geometrical_set_config.getConfigParameter<std::string>(
"name",
253 auto const geometry_name =
255 geometrical_set_config.getConfigParameter<std::string>(
257 mesh_names_for_output.push_back(geometrical_set_name +
"_" +
266 return output_config;