From ee6537dde815ab67994f354e473e76d55ddf285a Mon Sep 17 00:00:00 2001 From: David Grote Date: Wed, 18 Oct 2023 22:05:41 -0700 Subject: [PATCH] Add grow_low and high to Box (#204) * Add grow_low and high to Box * Update Stub Files --------- Co-authored-by: ax3l --- src/Base/Box.cpp | 18 ++++++++++++++++-- src/amrex/space1d/amrex_1d_pybind/__init__.pyi | 8 ++++++++ src/amrex/space2d/amrex_2d_pybind/__init__.pyi | 8 ++++++++ src/amrex/space3d/amrex_3d_pybind/__init__.pyi | 8 ++++++++ 4 files changed, 40 insertions(+), 2 deletions(-) diff --git a/src/Base/Box.cpp b/src/Base/Box.cpp index 1164213a..b14f1d14 100644 --- a/src/Base/Box.cpp +++ b/src/Base/Box.cpp @@ -184,6 +184,22 @@ void init_Box(py::module &m) { py::overload_cast< Direction, int >(&Box::grow), py::arg("d"), py::arg("n_cell") ) + .def("grow_low", + py::overload_cast< int, int >(&Box::growLo), + py::arg("idir"), py::arg("n_cell") + ) + .def("grow_low", + py::overload_cast< Direction, int >(&Box::growLo), + py::arg("d"), py::arg("n_cell") + ) + .def("grow_high", + py::overload_cast< int, int >(&Box::growHi), + py::arg("idir"), py::arg("n_cell") + ) + .def("grow_high", + py::overload_cast< Direction, int >(&Box::growHi), + py::arg("d"), py::arg("n_cell") + ) .def("surrounding_nodes", py::overload_cast< >(&Box::surroundingNodes)) @@ -209,8 +225,6 @@ void init_Box(py::module &m) { // minBox // chop - // growLo - // growHi // refine // coarsen // next diff --git a/src/amrex/space1d/amrex_1d_pybind/__init__.pyi b/src/amrex/space1d/amrex_1d_pybind/__init__.pyi index f423db2c..11a12804 100644 --- a/src/amrex/space1d/amrex_1d_pybind/__init__.pyi +++ b/src/amrex/space1d/amrex_1d_pybind/__init__.pyi @@ -3459,6 +3459,14 @@ class Box: def grow(self, idir: int, n_cell: int) -> Box: ... @typing.overload def grow(self, d: Direction, n_cell: int) -> Box: ... + @typing.overload + def grow_high(self, idir: int, n_cell: int) -> Box: ... + @typing.overload + def grow_high(self, d: Direction, n_cell: int) -> Box: ... + @typing.overload + def grow_low(self, idir: int, n_cell: int) -> Box: ... + @typing.overload + def grow_low(self, d: Direction, n_cell: int) -> Box: ... def intersects(self, arg0: Box) -> bool: ... def lbound(self, arg0: Box) -> Dim3: ... @typing.overload diff --git a/src/amrex/space2d/amrex_2d_pybind/__init__.pyi b/src/amrex/space2d/amrex_2d_pybind/__init__.pyi index 1cbc6e67..16fa4337 100644 --- a/src/amrex/space2d/amrex_2d_pybind/__init__.pyi +++ b/src/amrex/space2d/amrex_2d_pybind/__init__.pyi @@ -3459,6 +3459,14 @@ class Box: def grow(self, idir: int, n_cell: int) -> Box: ... @typing.overload def grow(self, d: Direction, n_cell: int) -> Box: ... + @typing.overload + def grow_high(self, idir: int, n_cell: int) -> Box: ... + @typing.overload + def grow_high(self, d: Direction, n_cell: int) -> Box: ... + @typing.overload + def grow_low(self, idir: int, n_cell: int) -> Box: ... + @typing.overload + def grow_low(self, d: Direction, n_cell: int) -> Box: ... def intersects(self, arg0: Box) -> bool: ... def lbound(self, arg0: Box) -> Dim3: ... @typing.overload diff --git a/src/amrex/space3d/amrex_3d_pybind/__init__.pyi b/src/amrex/space3d/amrex_3d_pybind/__init__.pyi index 6b398d6b..269a4c92 100644 --- a/src/amrex/space3d/amrex_3d_pybind/__init__.pyi +++ b/src/amrex/space3d/amrex_3d_pybind/__init__.pyi @@ -3459,6 +3459,14 @@ class Box: def grow(self, idir: int, n_cell: int) -> Box: ... @typing.overload def grow(self, d: Direction, n_cell: int) -> Box: ... + @typing.overload + def grow_high(self, idir: int, n_cell: int) -> Box: ... + @typing.overload + def grow_high(self, d: Direction, n_cell: int) -> Box: ... + @typing.overload + def grow_low(self, idir: int, n_cell: int) -> Box: ... + @typing.overload + def grow_low(self, d: Direction, n_cell: int) -> Box: ... def intersects(self, arg0: Box) -> bool: ... def lbound(self, arg0: Box) -> Dim3: ... @typing.overload