31int main(
int argc,
char* argv[])
34 "Tool extracts the boundary of the given mesh. The documentation is "
36 "https://docs.opengeosys.org/docs/tools/meshing-submeshes/"
37 "extract-boundary.\n\n"
38 "OpenGeoSys-6 software, version " +
41 "Copyright (c) 2012-2024, OpenGeoSys Community "
42 "(http://www.opengeosys.org)",
44 TCLAP::ValueArg<std::string> mesh_in(
45 "i",
"mesh-input-file",
46 "the name of the file containing the input mesh",
true,
"",
47 "file name of input mesh");
49 TCLAP::ValueArg<std::string> mesh_out(
50 "o",
"mesh-output-file",
51 "the name of the file the surface mesh should be written to",
false,
"",
52 "file name of output mesh");
55 TCLAP::SwitchArg use_ascii_arg(
"",
"ascii-output",
56 "If the switch is set use ascii instead of "
57 "binary format for data in the vtu output.",
59 cmd.add(use_ascii_arg);
61 cmd.parse(argc, argv);
66 mesh_in.getValue(),
true ));
73 INFO(
"Mesh read: {:d} nodes, {:d} elements.", mesh->getNumberOfNodes(),
74 mesh->getNumberOfElements());
77 std::unique_ptr<MeshLib::Mesh> surface_mesh(
84 INFO(
"Created surface mesh: {:d} nodes, {:d} elements.",
85 surface_mesh->getNumberOfNodes(), surface_mesh->getNumberOfElements());
87 std::string out_fname(mesh_out.getValue());
88 if (out_fname.empty())
93 auto const data_mode =
94 use_ascii_arg.getValue() ? vtkXMLWriter::Ascii : vtkXMLWriter::Binary;