25int main(
int argc,
char* argv[])
27 constexpr int mat_not_set = std::numeric_limits<int>::max();
30 "Marks all elements in a voxel grid (i.e. a structured hex grid, for "
31 "instance created with Layers2Grid or Vtu2Grid) that are intersected "
32 "by a triangulated 2D mesh representing a fault or some other "
33 "significant structure. The material group for those intersected "
34 "elements can be explicitly specified, otherwise the largest existing "
35 "MaterialID will be increased by one.\n\n"
36 "OpenGeoSys-6 software, version " +
39 "Copyright (c) 2012-2024, OpenGeoSys Community "
40 "(http://www.opengeosys.org)",
42 TCLAP::ValueArg<int> id_arg(
"m",
"material",
43 "material id for cells intersected by fault",
44 false, mat_not_set,
"non-negative integer");
47 TCLAP::ValueArg<std::string> output_arg(
48 "o",
"output",
"name of output mesh (*.vtu)",
true,
"",
"string");
51 TCLAP::ValueArg<std::string> fault_arg(
52 "f",
"fault",
"name of mesh representing fault (*.vtu)",
true,
"",
56 TCLAP::ValueArg<std::string> input_arg(
58 "name of the input file list containing the paths the all input layers "
59 "in correct order from top to bottom",
62 cmd.parse(argc, argv);
66 std::string
const input_name = input_arg.getValue();
67 std::string
const fault_name = fault_arg.getValue();
68 std::string
const output_name = output_arg.getValue();
72 std::unique_ptr<MeshLib::Mesh> mesh(
74 std::unique_ptr<MeshLib::Mesh> fault(
78 ERR(
"Input mesh not found...");
84 ERR(
"Input mesh has no material IDs");
87 int fault_id = id_arg.getValue();
90 auto it = std::max_element(mat_ids->cbegin(), mat_ids->cend());
93 if (addFaultToVoxelGrid(mesh.get(), fault.get(), fault_id))
97 INFO(
"The fault was successfully added.");
100 ERR(
"No fault could be added.");