28int main(
int argc,
char* argv[])
30 constexpr int mat_not_set = std::numeric_limits<int>::max();
33 "Marks all elements in a voxel grid (i.e. a structured hex grid, for "
34 "instance created with Layers2Grid or Vtu2Grid) that are intersected "
35 "by a triangulated 2D mesh representing a fault or some other "
36 "significant structure. The material group for those intersected "
37 "elements can be explicitly specified, otherwise the largest existing "
38 "MaterialID will be increased by one.\n\n"
39 "OpenGeoSys-6 software, version " +
42 "Copyright (c) 2012-2024, OpenGeoSys Community "
43 "(http://www.opengeosys.org)",
45 TCLAP::ValueArg<int> id_arg(
"m",
"material",
46 "material id for cells intersected by fault",
47 false, mat_not_set,
"non-negative integer");
50 TCLAP::ValueArg<std::string> output_arg(
51 "o",
"output",
"name of output mesh (*.vtu)",
true,
"",
"string");
54 TCLAP::ValueArg<std::string> fault_arg(
55 "f",
"fault",
"name of mesh representing fault (*.vtu)",
true,
"",
59 TCLAP::ValueArg<std::string> input_arg(
61 "name of the input file list containing the paths the all input layers "
62 "in correct order from top to bottom",
65 cmd.parse(argc, argv);
68 MPI_Init(&argc, &argv);
71 std::string
const input_name = input_arg.getValue();
72 std::string
const fault_name = fault_arg.getValue();
73 std::string
const output_name = output_arg.getValue();
77 std::unique_ptr<MeshLib::Mesh> mesh(
79 std::unique_ptr<MeshLib::Mesh> fault(
83 ERR(
"Input mesh not found...");
95 ERR(
"Input mesh has no material IDs");
98 int fault_id = id_arg.getValue();
101 auto it = std::max_element(mat_ids->cbegin(), mat_ids->cend());
104 if (addFaultToVoxelGrid(mesh.get(), fault.get(), fault_id))
111 INFO(
"The fault was successfully added.");
117 ERR(
"No fault could be added.");