26int main(
int argc,
char* argv[])
29 "Scales a property of a mesh.\n\n"
30 "OpenGeoSys-6 software, version " +
33 "Copyright (c) 2012-2025, OpenGeoSys Community "
34 "(http://www.opengeosys.org)",
37 TCLAP::ValueArg<std::string> out_mesh_arg(
40 "Output (.vtu). The output mesh is stored to a file of this name",
44 cmd.add(out_mesh_arg);
46 TCLAP::ValueArg<std::string> property_arg(
49 "the name of the property the values are stored for",
53 cmd.add(property_arg);
55 TCLAP::ValueArg<std::string> mesh_arg(
56 "m",
"mesh",
"Input (.vtu). The input mesh is read from this file",
57 true,
"",
"INPUT_FILE");
60 std::vector<std::string> allowed_units{
"mm/a",
"mm/month",
"m/s"};
61 TCLAP::ValuesConstraint<std::string> allowed_units_constraints{
63 TCLAP::ValueArg<std::string> unit_arg(
"u",
65 "input unit of the data",
68 &allowed_units_constraints);
71 cmd.parse(argc, argv);
75 std::unique_ptr<MeshLib::Mesh> mesh(
79 if (unit_arg.getValue() ==
"m/s")
83 else if (unit_arg.getValue() ==
"mm/a")
85 scale = 1e-3 / (365.25 * 86400);
87 else if (unit_arg.getValue() ==
"mm/month")
89 scale = 1e-3 * (12.0 / (365.25 * 86400));