21int main(
int argc,
char* argv[])
23 constexpr int mat_not_set = std::numeric_limits<int>::max();
26 "Marks all elements in a voxel grid (i.e. a structured hex grid, for "
27 "instance created with Layers2Grid or Vtu2Grid) that are intersected "
28 "by a triangulated 2D mesh representing a fault or some other "
29 "significant structure. The material group for those intersected "
30 "elements can be explicitly specified, otherwise the largest existing "
31 "MaterialID will be increased by one.\n\n"
32 "OpenGeoSys-6 software, version " +
35 "Copyright (c) 2012-2026, OpenGeoSys Community "
36 "(http://www.opengeosys.org)",
38 TCLAP::ValueArg<int> id_arg(
40 "material id for cells intersected by fault, (min = 0)",
false,
41 mat_not_set,
"MATERIAL_ID");
44 TCLAP::ValueArg<std::string> output_arg(
45 "o",
"output",
"Output (.vtu). Name of output mesh file",
true,
"",
49 TCLAP::ValueArg<std::string> fault_arg(
50 "f",
"fault",
"Input (.vtu). Name of mesh file representing fault",
51 true,
"",
"INPUT_FILE");
54 TCLAP::ValueArg<std::string> input_arg(
56 "Input (.vtu). Name of the input file containing the paths the "
58 "in correct order from top to bottom",
59 true,
"",
"INPUT_FILE");
63 cmd.add(log_level_arg);
64 cmd.parse(argc, argv);
69 std::string
const input_name = input_arg.getValue();
70 std::string
const fault_name = fault_arg.getValue();
71 std::string
const output_name = output_arg.getValue();
75 std::unique_ptr<MeshLib::Mesh> mesh(
77 std::unique_ptr<MeshLib::Mesh> fault(
81 ERR(
"Input mesh not found...");
87 ERR(
"Input mesh has no material IDs");
90 int fault_id = id_arg.getValue();
93 auto it = std::max_element(mat_ids->cbegin(), mat_ids->cend());
100 INFO(
"The fault was successfully added.");
103 ERR(
"No fault could be added.");