25int main(
int argc,
char* argv[])
28 "Tool extracts the boundary of the given mesh. The documentation is "
30 "https://docs.opengeosys.org/docs/tools/meshing-submeshes/"
31 "extract-boundary.\n\n"
32 "OpenGeoSys-6 software, version " +
35 "Copyright (c) 2012-2026, OpenGeoSys Community "
36 "(http://www.opengeosys.org)",
38 TCLAP::ValueArg<std::string> mesh_in(
39 "i",
"mesh-input-file",
40 "Input (.vtu). The name of the file containing the input mesh",
true,
43 TCLAP::ValueArg<std::string> mesh_out(
44 "o",
"mesh-output-file",
45 "Output (.vtu). The name of the file the surface mesh should be "
47 false,
"",
"OUTPUT_FILE");
50 TCLAP::SwitchArg use_ascii_arg(
"",
"ascii-output",
51 "If the switch is set use ascii instead of "
52 "binary format for data in the vtu output.",
54 cmd.add(use_ascii_arg);
57 cmd.add(log_level_arg);
58 cmd.parse(argc, argv);
64 mesh_in.getValue(),
true ));
71 INFO(
"Mesh read: {:d} nodes, {:d} elements.", mesh->getNumberOfNodes(),
72 mesh->getNumberOfElements());
75 std::unique_ptr<MeshLib::Mesh> surface_mesh(
82 INFO(
"Created surface mesh: {:d} nodes, {:d} elements.",
83 surface_mesh->getNumberOfNodes(), surface_mesh->getNumberOfElements());
85 std::string out_fname(mesh_out.getValue());
86 if (out_fname.empty())
91 auto const data_mode =
92 use_ascii_arg.getValue() ? vtkXMLWriter::Ascii : vtkXMLWriter::Binary;