29int main(
int argc,
char* argv[])
32 "Scales a property of a mesh.\n\n"
33 "OpenGeoSys-6 software, version " +
36 "Copyright (c) 2012-2024, OpenGeoSys Community "
37 "(http://www.opengeosys.org)",
40 TCLAP::ValueArg<std::string> out_mesh_arg(
43 "the mesh is stored to a file of this name",
46 "filename for mesh output");
47 cmd.add(out_mesh_arg);
49 TCLAP::ValueArg<std::string> property_arg(
52 "the name of the property the values are stored for",
55 "property name as string");
56 cmd.add(property_arg);
58 TCLAP::ValueArg<std::string> mesh_arg(
59 "m",
"mesh",
"the mesh is read from this file",
true,
"",
"file name");
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);
73 cmd.parse(argc, argv);
76 MPI_Init(&argc, &argv);
79 std::unique_ptr<MeshLib::Mesh> mesh(
83 if (unit_arg.getValue() ==
"m/s")
87 else if (unit_arg.getValue() ==
"mm/a")
89 scale = 1e-3 / (365.25 * 86400);
91 else if (unit_arg.getValue() ==
"mm/month")
93 scale = 1e-3 * (12.0 / (365.25 * 86400));