20int main(
int argc,
char* argv[])
23 "Scales a property of a mesh.\n\n"
24 "OpenGeoSys-6 software, version " +
27 "Copyright (c) 2012-2026, OpenGeoSys Community "
28 "(http://www.opengeosys.org)",
31 TCLAP::ValueArg<std::string> out_mesh_arg(
34 "Output (.vtu). The output mesh is stored to a file of this name",
38 cmd.add(out_mesh_arg);
40 TCLAP::ValueArg<std::string> property_arg(
43 "the name of the property the values are stored for",
47 cmd.add(property_arg);
49 TCLAP::ValueArg<std::string> mesh_arg(
50 "m",
"mesh",
"Input (.vtu). The input mesh is read from this file",
51 true,
"",
"INPUT_FILE");
54 std::vector<std::string> allowed_units{
"mm/a",
"mm/month",
"m/s"};
55 TCLAP::ValuesConstraint<std::string> allowed_units_constraints{
57 TCLAP::ValueArg<std::string> unit_arg(
"u",
59 "input unit of the data",
62 &allowed_units_constraints);
66 cmd.add(log_level_arg);
67 cmd.parse(argc, argv);
72 std::unique_ptr<MeshLib::Mesh> mesh(
76 if (unit_arg.getValue() ==
"m/s")
80 else if (unit_arg.getValue() ==
"mm/a")
82 scale = 1e-3 / (365.25 * 86400);
84 else if (unit_arg.getValue() ==
"mm/month")
86 scale = 1e-3 * (12.0 / (365.25 * 86400));