28int main(
int argc,
char* argv[])
31 "Scales a property of a mesh.\n\n"
32 "OpenGeoSys-6 software, version " +
35 "Copyright (c) 2012-2025, OpenGeoSys Community "
36 "(http://www.opengeosys.org)",
39 TCLAP::ValueArg<std::string> out_mesh_arg(
42 "Output (.vtu). The output mesh is stored to a file of this name",
46 cmd.add(out_mesh_arg);
48 TCLAP::ValueArg<std::string> property_arg(
51 "the name of the property the values are stored for",
55 cmd.add(property_arg);
57 TCLAP::ValueArg<std::string> mesh_arg(
58 "m",
"mesh",
"Input (.vtu). The input mesh is read from this file",
59 true,
"",
"INPUT_FILE");
62 std::vector<std::string> allowed_units{
"mm/a",
"mm/month",
"m/s"};
63 TCLAP::ValuesConstraint<std::string> allowed_units_constraints{
65 TCLAP::ValueArg<std::string> unit_arg(
"u",
67 "input unit of the data",
70 &allowed_units_constraints);
74 cmd.add(log_level_arg);
75 cmd.parse(argc, argv);
80 std::unique_ptr<MeshLib::Mesh> mesh(
84 if (unit_arg.getValue() ==
"m/s")
88 else if (unit_arg.getValue() ==
"mm/a")
90 scale = 1e-3 / (365.25 * 86400);
92 else if (unit_arg.getValue() ==
"mm/month")
94 scale = 1e-3 * (12.0 / (365.25 * 86400));