From 4c2d637c54077915eac0c960321d8c9bdb51ea7d Mon Sep 17 00:00:00 2001 From: Henry <henry.korb@geo.uu.se> Date: Tue, 6 Dec 2022 17:16:55 +0100 Subject: [PATCH] update python bindings and AL app --- apps/gpu/LBM/ActuatorLine/ActuatorLine.cpp | 38 ++++++++++++-------- pythonbindings/src/gpu/submodules/probes.cpp | 6 ++-- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/apps/gpu/LBM/ActuatorLine/ActuatorLine.cpp b/apps/gpu/LBM/ActuatorLine/ActuatorLine.cpp index de83ea55c..017395349 100644 --- a/apps/gpu/LBM/ActuatorLine/ActuatorLine.cpp +++ b/apps/gpu/LBM/ActuatorLine/ActuatorLine.cpp @@ -212,21 +212,29 @@ void multipleLevel(const std::string& configPath) para->addActuator( actuator_farm ); - // SPtr<PointProbe> pointProbe = std::make_shared<PointProbe>("pointProbe", para->getOutputPath(), 100, 1, 500, 100); - // std::vector<real> probeCoordsX = {reference_diameter,2*reference_diameter,5*reference_diameter}; - // std::vector<real> probeCoordsY = {3*reference_diameter,3*reference_diameter,3*reference_diameter}; - // std::vector<real> probeCoordsZ = {3*reference_diameter,3*reference_diameter,3*reference_diameter}; - // pointProbe->addProbePointsFromList(probeCoordsX, probeCoordsY, probeCoordsZ); - // // pointProbe->addProbePointsFromXNormalPlane(2*D, 0.0, 0.0, L_y, L_z, (uint)L_y/dx, (uint)L_z/dx); - - // pointProbe->addStatistic(Statistic::Means); - // pointProbe->addStatistic(Statistic::Variances); - // para->addProbe( pointProbe ); - - // SPtr<PlaneProbe> planeProbe = std::make_shared<PlaneProbe>("planeProbe", para->getOutputPath(), 100, 500, 100, 100); - // planeProbe->setProbePlane(5*reference_diameter, 0, 0, dx, L_y, L_z); - // planeProbe->addStatistic(Statistic::Means); - // para->addProbe( planeProbe ); + SPtr<PointProbe> pointProbe = std::make_shared<PointProbe>("pointProbe", para->getOutputPath(), 100, 1, 500, 100, false); + std::vector<real> probeCoordsX = {reference_diameter,2*reference_diameter,5*reference_diameter}; + std::vector<real> probeCoordsY = {3*reference_diameter,3*reference_diameter,3*reference_diameter}; + std::vector<real> probeCoordsZ = {3*reference_diameter,3*reference_diameter,3*reference_diameter}; + pointProbe->addProbePointsFromList(probeCoordsX, probeCoordsY, probeCoordsZ); + // pointProbe->addProbePointsFromXNormalPlane(2*D, 0.0, 0.0, L_y, L_z, (uint)L_y/dx, (uint)L_z/dx); + + pointProbe->addStatistic(Statistic::Means); + pointProbe->addStatistic(Statistic::Variances); + para->addProbe( pointProbe ); + + SPtr<PointProbe> timeseriesProbe = std::make_shared<PointProbe>("timeProbe", para->getOutputPath(), 100, 1, 500, 100, true); + + timeseriesProbe->addProbePointsFromList(probeCoordsX, probeCoordsY, probeCoordsZ); + // pointProbe->addProbePointsFromXNormalPlane(2*D, 0.0, 0.0, L_y, L_z, (uint)L_y/dx, (uint)L_z/dx); + + timeseriesProbe->addStatistic(Statistic::Instantaneous); + para->addProbe( timeseriesProbe ); + + SPtr<PlaneProbe> planeProbe = std::make_shared<PlaneProbe>("planeProbe", para->getOutputPath(), 100, 500, 100, 100); + planeProbe->setProbePlane(5*reference_diameter, 0, 0, dx, L_y, L_z); + planeProbe->addStatistic(Statistic::Means); + para->addProbe( planeProbe ); auto cudaMemoryManager = std::make_shared<CudaMemoryManager>(para); diff --git a/pythonbindings/src/gpu/submodules/probes.cpp b/pythonbindings/src/gpu/submodules/probes.cpp index 79ee11705..d6bbf9f93 100644 --- a/pythonbindings/src/gpu/submodules/probes.cpp +++ b/pythonbindings/src/gpu/submodules/probes.cpp @@ -40,13 +40,15 @@ namespace probes uint, uint, uint, - uint>(), + uint, + bool>(), py::arg("probe_name"), py::arg("output_path"), py::arg("t_start_avg"), py::arg("t_avg"), py::arg("t_start_out"), - py::arg("t_out")) + py::arg("t_out"), + py::arg("output_timeseries")) .def("add_probe_points_from_list", &PointProbe::addProbePointsFromList, py::arg("point_coords_x"), py::arg("point_coords_y"), py::arg("point_coords_z")) .def("add_probe_points_from_x_normal_plane", &PointProbe::addProbePointsFromXNormalPlane, py::arg("pos_x"), py::arg("pos0_y"), py::arg("pos0_z"), py::arg("pos1_y"), py::arg("pos1_z"), py::arg("n_y"), py::arg("n_z")); -- GitLab