|
3 | 3 | #include "flowy/include/config_parser.hpp" |
4 | 4 | #include "flowy/include/definitions.hpp" |
5 | 5 | #include "flowy/include/lobe.hpp" |
| 6 | +#include "flowy/include/models/mr_lava_loba.hpp" |
6 | 7 | #include "flowy/include/simulation.hpp" |
7 | 8 | #include "flowy/include/topography.hpp" |
8 | 9 | #include "flowy/include/topography_file.hpp" |
| 10 | +#include "pybind11/detail/common.h" |
9 | 11 | #include "pybind11/pytypes.h" |
10 | 12 |
|
11 | 13 | #ifdef WITH_NETCDF |
@@ -45,13 +47,13 @@ PYBIND11_MODULE( flowycpp, m ) |
45 | 47 | .def_readwrite( "y_min", &Flowy::TopographyCrop::y_min ) |
46 | 48 | .def_readwrite( "y_max", &Flowy::TopographyCrop::y_max ); |
47 | 49 |
|
48 | | - py::enum_<Flowy::OutputQuantitiy>( m, "OutputQuantitiy" ) |
49 | | - .value( "Hazard", Flowy::OutputQuantitiy::Hazard ) |
50 | | - .value( "Height", Flowy::OutputQuantitiy::Height ); |
| 50 | + py::enum_<Flowy::OutputQuantity>( m, "OutputQuantity" ) |
| 51 | + .value( "Hazard", Flowy::OutputQuantity::Hazard ) |
| 52 | + .value( "Height", Flowy::OutputQuantity::Height ); |
51 | 53 |
|
52 | 54 | py::class_<Flowy::AscFile>( m, "AscFile" ) |
53 | 55 | .def( py::init<>() ) |
54 | | - .def( py::init<Flowy::Topography, Flowy::OutputQuantitiy>() ) |
| 56 | + .def( py::init<Flowy::Topography, Flowy::OutputQuantity>() ) |
55 | 57 | .def( py::init<std::filesystem::path>(), "file_path"_a ) |
56 | 58 | .def( py::init<std::filesystem::path, Flowy::TopographyCrop>() ) |
57 | 59 | .def( "save", &Flowy::AscFile::save ) |
@@ -101,7 +103,8 @@ PYBIND11_MODULE( flowycpp, m ) |
101 | 103 | .def( "extent_xy", &Flowy::Lobe::extent_xy ) |
102 | 104 | .def( "line_segment_intersects", &Flowy::Lobe::line_segment_intersects ) |
103 | 105 | .def( "is_point_in_lobe", &Flowy::Lobe::is_point_in_lobe ) |
104 | | - .def( "point_at_angle", &Flowy::Lobe::point_at_angle ) |
| 106 | + // .def( "point_at_angle", py::overload_cast<const double>(&Flowy::Lobe::point_at_angle) ) |
| 107 | + // .def( "point_at_angle", py::overload_cast<const double, const double>(&Flowy::Lobe::point_at_angle) ) |
105 | 108 | .def( "rasterize_perimeter", &Flowy::Lobe::rasterize_perimeter ); |
106 | 109 |
|
107 | 110 | py::class_<Flowy::LobeCells>( m, "LobeCells" ) |
@@ -183,28 +186,29 @@ PYBIND11_MODULE( flowycpp, m ) |
183 | 186 |
|
184 | 187 | py::class_<Flowy::CommonLobeDimensions>( m, "CommonLobeDimensions" ) |
185 | 188 | .def( py::init<>() ) |
186 | | - .def( py::init<Flowy::Config::InputParams, Flowy::Topography>() ) |
| 189 | + .def( py::init<Flowy::Config::InputParams>() ) |
187 | 190 | .def_readwrite( "avg_lobe_thickness", &Flowy::CommonLobeDimensions::avg_lobe_thickness ) |
188 | 191 | .def_readwrite( "lobe_area", &Flowy::CommonLobeDimensions::lobe_area ) |
189 | 192 | .def_readwrite( "max_semiaxis", &Flowy::CommonLobeDimensions::max_semiaxis ) |
190 | | - .def_readwrite( "max_cells", &Flowy::CommonLobeDimensions::max_cells ) |
191 | 193 | .def_readwrite( "thickness_min", &Flowy::CommonLobeDimensions::thickness_min ); |
192 | 194 |
|
193 | 195 | py::class_<Flowy::Simulation>( m, "Simulation" ) |
194 | 196 | .def( py::init<Flowy::Config::InputParams, std::optional<int>>() ) |
195 | 197 | .def_readwrite( "input", &Flowy::Simulation::input ) |
196 | 198 | .def_readwrite( "topography", &Flowy::Simulation::topography ) |
197 | 199 | .def_readwrite( "lobes", &Flowy::Simulation::lobes ) |
198 | | - .def_readwrite( "lobe_dimensions", &Flowy::Simulation::lobe_dimensions ) |
199 | | - .def( "compute_initial_lobe_position", &Flowy::Simulation::compute_initial_lobe_position ) |
200 | | - .def( "compute_lobe_axes", &Flowy::Simulation::compute_lobe_axes ) |
201 | | - .def( "compute_descendent_lobe_position", &Flowy::Simulation::compute_descendent_lobe_position ) |
202 | | - .def( "perturb_lobe_angle", &Flowy::Simulation::perturb_lobe_angle ) |
203 | | - .def( "select_parent_lobe", &Flowy::Simulation::select_parent_lobe ) |
204 | | - .def( "add_inertial_contribution", &Flowy::Simulation::add_inertial_contribution ) |
205 | 200 | .def( "stop_condition", &Flowy::Simulation::stop_condition ) |
206 | 201 | .def( "run", &Flowy::Simulation::run ); |
207 | 202 |
|
| 203 | + py::class_<Flowy::MrLavaLoba>( m, "MrLavaLoba" ) |
| 204 | + .def_readwrite( "lobe_dimensions", &Flowy::MrLavaLoba::lobe_dimensions ) |
| 205 | + .def( "compute_initial_lobe_position", &Flowy::MrLavaLoba::compute_initial_lobe_position ) |
| 206 | + .def( "compute_lobe_axes", &Flowy::MrLavaLoba::compute_lobe_axes ) |
| 207 | + .def( "compute_descendent_lobe_position", &Flowy::MrLavaLoba::compute_descendent_lobe_position ) |
| 208 | + .def( "perturb_lobe_angle", &Flowy::MrLavaLoba::perturb_lobe_angle ) |
| 209 | + .def( "select_parent_lobe", &Flowy::MrLavaLoba::select_parent_lobe ) |
| 210 | + .def( "add_inertial_contribution", &Flowy::MrLavaLoba::add_inertial_contribution ); |
| 211 | + |
208 | 212 | m.def( |
209 | 213 | "parse_config", &Flowy::Config::parse_config, "A function to parse input settings from a TOML file.", |
210 | 214 | "config_path"_a ); |
|
0 commit comments