25int main(
int argc,
char* argv[])
28 "Moves the points of a geometry by a given displacement vector\n\n"
29 "OpenGeoSys-6 software, version " +
32 "Copyright (c) 2012-2024, OpenGeoSys Community "
33 "(http://www.opengeosys.org)",
35 TCLAP::ValueArg<double> z_arg(
"z",
"z",
"displacement in z direction",
36 false, 0.0,
"z-displacement");
38 TCLAP::ValueArg<double> y_arg(
"y",
"y",
"displacement in y direction",
39 false, 0.0,
"y-displacement");
41 TCLAP::ValueArg<double> x_arg(
"x",
"x",
"displacement in x direction",
42 false, 0.0,
"x-displacement");
44 TCLAP::ValueArg<std::string> geo_output_arg(
45 "o",
"output",
"output geometry file (*.gml)",
true,
"",
"output file");
46 cmd.add(geo_output_arg);
47 TCLAP::ValueArg<std::string> geo_input_arg(
48 "i",
"input",
"input geometry file (*.gml)",
true,
"",
"input file");
49 cmd.add(geo_input_arg);
50 cmd.parse(argc, argv);
53 MPI_Init(&argc, &argv);
60 if (!xml.
readFile(geo_input_arg.getValue()))
68 catch (std::runtime_error
const& err)
70 ERR(
"Failed to read file `{:s}'.", geo_input_arg.getValue());
71 ERR(
"{:s}", err.what());
78 Eigen::Vector3d displacement = Eigen::Vector3d::Zero();
81 displacement[0] = x_arg.getValue();
85 displacement[1] = y_arg.getValue();
89 displacement[2] = z_arg.getValue();
94 std::vector<GeoLib::Point*>
const* point_vec =
96 std::size_t
const n_points = point_vec->size();
97 for (std::size_t i = 0; i < n_points; ++i)
99 for (std::size_t c = 0; c < 3; ++c)
101 (*(*point_vec)[i])[c] += displacement[c];
107 geo_output_arg.getValue());