26 "Scales a property of a mesh.\n\n"
27 "OpenGeoSys-6 software, version " +
30 "Copyright (c) 2012-2021, OpenGeoSys Community "
31 "(http://www.opengeosys.org)",
34 TCLAP::ValueArg<std::string> out_mesh_arg(
37 "the mesh is stored to a file of this name",
40 "filename for mesh output");
41 cmd.add(out_mesh_arg);
43 TCLAP::ValueArg<std::string> property_arg(
46 "the name of the property the values are stored for",
49 "property name as string");
50 cmd.add(property_arg);
52 TCLAP::ValueArg<std::string> mesh_arg(
53 "m",
"mesh",
"the mesh is read from this file",
true,
"",
"file name");
56 std::vector<std::string> allowed_units{
"mm/a",
"mm/month",
"m/s"};
57 TCLAP::ValuesConstraint<std::string> allowed_units_constraints{
59 TCLAP::ValueArg<std::string> unit_arg(
"u",
61 "input unit of the data",
64 &allowed_units_constraints);
67 cmd.parse(argc, argv);
69 std::unique_ptr<MeshLib::Mesh> mesh(
73 if (unit_arg.getValue() ==
"m/s")
77 else if (unit_arg.getValue() ==
"mm/a")
79 scale = 1e-3 / (365.25 * 86400);
81 else if (unit_arg.getValue() ==
"mm/month")
83 scale = 1e-3 * (12.0 / (365.25 * 86400));
GITINFOLIB_EXPORT const std::string ogs_version
void scale(PETScVector &x, double const a)
MeshLib::Mesh * readMeshFromFile(const std::string &file_name)
int writeMeshToFile(const MeshLib::Mesh &mesh, std::filesystem::path const &file_path, [[maybe_unused]] std::set< std::string > variable_output_names)
void scaleMeshPropertyVector(MeshLib::Mesh &mesh, std::string const &property_name, double factor)