34int main(
int argc,
char* argv[])
37 "Tool extracts the boundary of the given mesh. The documentation is "
39 "https://docs.opengeosys.org/docs/tools/meshing-submeshes/"
40 "extract-boundary.\n\n"
41 "OpenGeoSys-6 software, version " +
44 "Copyright (c) 2012-2024, OpenGeoSys Community "
45 "(http://www.opengeosys.org)",
47 TCLAP::ValueArg<std::string> mesh_in(
48 "i",
"mesh-input-file",
49 "the name of the file containing the input mesh",
true,
"",
50 "file name of input mesh");
52 TCLAP::ValueArg<std::string> mesh_out(
53 "o",
"mesh-output-file",
54 "the name of the file the surface mesh should be written to",
false,
"",
55 "file name of output mesh");
58 TCLAP::SwitchArg use_ascii_arg(
"",
"ascii-output",
59 "If the switch is set use ascii instead of "
60 "binary format for data in the vtu output.",
62 cmd.add(use_ascii_arg);
64 cmd.parse(argc, argv);
67 MPI_Init(&argc, &argv);
71 mesh_in.getValue(),
true ));
81 INFO(
"Mesh read: {:d} nodes, {:d} elements.", mesh->getNumberOfNodes(),
82 mesh->getNumberOfElements());
85 std::unique_ptr<MeshLib::Mesh> surface_mesh(
92 INFO(
"Created surface mesh: {:d} nodes, {:d} elements.",
93 surface_mesh->getNumberOfNodes(), surface_mesh->getNumberOfElements());
95 std::string out_fname(mesh_out.getValue());
96 if (out_fname.empty())
101 auto const data_mode =
102 use_ascii_arg.getValue() ? vtkXMLWriter::Ascii : vtkXMLWriter::Binary;