23 "Tool to create gmsh geometry (geo-file) out of a gml geometry.\n\n"
24 "OpenGeoSys-6 software, version " +
27 "Copyright (c) 2012-2021, OpenGeoSys Community "
28 "(http://www.opengeosys.org)",
30 TCLAP::ValueArg<std::string> geo_output_arg(
31 "o",
"output",
"output gmsh geometry file (*.geo)",
true,
"",
33 cmd.add(geo_output_arg);
34 TCLAP::MultiArg<std::string> geo_input_arg(
35 "i",
"input",
"input geometry file (*.gml)",
true,
"input file name");
36 cmd.add(geo_input_arg);
37 TCLAP::ValueArg<unsigned> max_number_of_points_in_quadtree_leaf_arg(
38 "",
"max_points_in_quadtree_leaf",
"positive number",
false, 2,
39 "max points in a quadtree leaf before the leaf is split");
40 cmd.add(max_number_of_points_in_quadtree_leaf_arg);
41 TCLAP::ValueArg<double> mesh_density_scaling_points_arg(
42 "",
"mesh_density_scaling_at_points",
"positive floating point number",
43 false, 0.2,
"desired mesh density at points");
44 cmd.add(mesh_density_scaling_points_arg);
45 TCLAP::ValueArg<double> mesh_density_scaling_stations_arg(
46 "",
"mesh_density_scaling_at_stations",
47 "positive floating point number",
false, 0.05,
48 "desired mesh density at stations");
49 cmd.add(mesh_density_scaling_stations_arg);
50 TCLAP::ValueArg<double> average_point_density_arg(
51 "a",
"average_point_density",
52 "average point density / average edge length as a positive floating "
55 "desired point density / edge length in homogeneous meshing approach");
56 cmd.add(average_point_density_arg);
57 TCLAP::SwitchArg homogeneous_flag(
58 "",
"homogeneous",
"Use Gmsh homogeneous meshing method.",
false);
59 cmd.add(homogeneous_flag);
61 cmd.parse(argc, argv);
64 for (
auto const& geometry_name : geo_input_arg.getValue())
69 if (!xml.readFile(geometry_name))
74 catch (std::runtime_error
const& err)
76 ERR(
"Failed to read file '{:s}'.", geometry_name);
77 ERR(
"{:s}", err.what());
80 INFO(
"Successfully read file '{:s}'.", geometry_name);
85 bool const rotate =
false;
86 bool const keep_preprocessed_geometry =
false;
88 if (homogeneous_flag.getValue())
90 double const average_mesh_density =
91 average_point_density_arg.getValue();
95 average_mesh_density, 0.0, 0, geo_names, rotate,
96 keep_preprocessed_geometry);
98 geo_output_arg.getValue());
102 unsigned const max_number_of_points_in_quadtree_leaf =
103 max_number_of_points_in_quadtree_leaf_arg.getValue();
104 double const mesh_density_scaling_points =
105 mesh_density_scaling_points_arg.getValue();
106 double const mesh_density_scaling_stations =
107 mesh_density_scaling_stations_arg.getValue();
111 mesh_density_scaling_points, mesh_density_scaling_stations,
112 max_number_of_points_in_quadtree_leaf, geo_names, rotate,
113 keep_preprocessed_geometry);
115 geo_output_arg.getValue());
void INFO(char const *fmt, Args const &... args)
void ERR(char const *fmt, Args const &... args)
Reads and writes GMSH-files to and from OGS data structures.
Container class for geometric objects.
std::vector< std::string > getGeometryNames() const
Returns the names of all geometry vectors.
int writeStringToFile(std::string content, std::filesystem::path const &file_path)
@ AdaptiveMeshDensity
computing the mesh density employing a QuadTree
@ FixedMeshDensity
set the parameter with a fixed value
GITINFOLIB_EXPORT const std::string ogs_version