26{
27 TCLAP::CmdLine cmd(
28 "Add element quality as a mesh property.\n\n"
29 "OpenGeoSys-6 software, version " +
31 ".\n"
32 "Copyright (c) 2012-2025, OpenGeoSys Community "
33 "(http://www.opengeosys.org)",
35
36 TCLAP::ValueArg<std::string> mesh_out_arg("o", "output_mesh_file",
37 "Output (.vtu | .msh) mesh file ",
38 true, "", "OUTPUT_FILE");
39 cmd.add(mesh_out_arg);
40 std::vector<std::string> allowed_element_criterions{
41 "ElementSize", "EdgeRatio", "EquiAngleSkew", "RadiusEdgeRatio",
42 "SizeDifference"};
43 TCLAP::ValuesConstraint<std::string> element_criterions{
44 allowed_element_criterions};
45 TCLAP::ValueArg<std::string> criterion_arg{
46 "c", "quality_criterion", "quality criterion", true,
47 "", &element_criterions};
48 cmd.add(criterion_arg);
49 TCLAP::ValueArg<std::string> mesh_in_arg("i", "input_mesh_file",
50 "Input (.vtu | .msh) mesh file",
51 true, "", "INPUT_FILE");
52 cmd.add(mesh_in_arg);
53 cmd.parse(argc, argv);
54
56
57
61 mesh_in_arg.getValue(), true ));
62 if (!mesh)
63 {
64 return EXIT_FAILURE;
65 }
66 INFO(
"Time for reading: {:g} s", run_time.
elapsed());
67
68
72 auto const element_quality_vector = element_quality.getQualityVector();
75 {element_quality_vector});
76 INFO(
"Writing mesh '{:s}' ... ", mesh_out_arg.getValue());
79 return EXIT_SUCCESS;
80}
void INFO(fmt::format_string< Args... > fmt, Args &&... args)
double elapsed() const
Get the elapsed time in seconds.
void start()
Start the timer.
GITINFOLIB_EXPORT const std::string ogs_version
MeshLib::Mesh * readMeshFromFile(const std::string &file_name, bool const compute_element_neighbors)
int writeMeshToFile(const MeshLib::Mesh &mesh, std::filesystem::path const &file_path, std::set< std::string > variable_output_names)
MeshLib::MeshQualityType String2MeshQualityType(std::string const &s)
void addPropertyToMesh(Mesh &mesh, std::string_view name, MeshItemType item_type, std::size_t number_of_components, std::span< T const > values)
MeshQualityType
Describes a mesh quality metric.