From 8742a79c29b7db30c7287c8e33109c0d8be1277a Mon Sep 17 00:00:00 2001 From: ax3l Date: Thu, 10 Oct 2024 04:42:42 +0000 Subject: [PATCH] Update Stub Files --- .../space1d/amrex_1d_pybind/__init__.pyi | 90 +++++++++++++++++++ .../space2d/amrex_2d_pybind/__init__.pyi | 90 +++++++++++++++++++ .../space3d/amrex_3d_pybind/__init__.pyi | 90 +++++++++++++++++++ 3 files changed, 270 insertions(+) diff --git a/src/amrex/space1d/amrex_1d_pybind/__init__.pyi b/src/amrex/space1d/amrex_1d_pybind/__init__.pyi index ceadd558..862bf833 100644 --- a/src/amrex/space1d/amrex_1d_pybind/__init__.pyi +++ b/src/amrex/space1d/amrex_1d_pybind/__init__.pyi @@ -6276,6 +6276,30 @@ class MultiFab(FabArray_FArrayBox): """ dst = src + a*dst """ + def __getitem__(self, index): + """ + Returns slice of the MultiFab using global indexing, as a numpy array. + This uses numpy array indexing, with the indexing relative to the global array. + The slice ranges can cross multiple blocks and the result will be gathered into a single + array. + + In an MPI context, this is a global operation. An "allgather" is performed so that the full + result is returned on all processors. + + Note that the index is in fortran ordering and that 0 is the lower boundary of the whole domain. + + The default range of the indices includes only the valid cells. The ":" index will include all of + the valid cels and no ghost cells. The ghost cells can be accessed using imaginary numbers, with + negative imaginary numbers for the lower ghost cells, and positive for the upper ghost cells. + The index "[-1j]" for example refers to the first lower ghost cell, and "[1j]" to the first upper + ghost cell. To access all cells, ghosts and valid cells, use an empty tuple for the index, i.e. "[()]". + + Parameters + ---------- + index : the index using numpy style indexing + Index of the slice to return. + + """ @typing.overload def __init__(self) -> None: """ @@ -6479,6 +6503,32 @@ class MultiFab(FabArray_FArrayBox): FArrayBoxFactory for embedded boundaries """ def __repr__(self) -> str: ... + def __setitem__(self, index, value): + """ + Sets the slice of the MultiFab using global indexing. + This uses numpy array indexing, with the indexing relative to the global array. + The slice ranges can cross multiple blocks and the value will be distributed accordingly. + Note that this will apply the value to both valid and ghost cells. + + In an MPI context, this is a local operation. On each processor, the blocks within the slice + range will be set to the value. + + Note that the index is in fortran ordering and that 0 is the lower boundary of the whole domain. + + The default range of the indices includes only the valid cells. The ":" index will include all of + the valid cels and no ghost cells. The ghost cells can be accessed using imaginary numbers, with + negative imaginary numbers for the lower ghost cells, and positive for the upper ghost cells. + The index "[-1j]" for example refers to the first lower ghost cell, and "[1j]" to the first upper + ghost cell. To access all cells, ghosts and valid cells, use an empty tuple for the index, i.e. "[()]". + + Parameters + ---------- + index : the index using numpy style indexing + Index of the slice to return. + value : scalar or array + Input value to assign to the specified slice of the MultiFab + + """ def average_sync(self, arg0: Periodicity) -> None: ... def box_array(self: FabArrayBase) -> BoxArray: ... @typing.overload @@ -6531,6 +6581,22 @@ class MultiFab(FabArray_FArrayBox): against divide by zero. """ def dm(self: FabArrayBase) -> DistributionMapping: ... + def imesh(self, idir, include_ghosts=False): + """ + Returns the integer mesh along the specified direction with the appropriate centering. + This is the location of the data points in grid cell units. + + Parameters + ---------- + self : amrex.MultiFab + A MultiFab class in pyAMReX + direction : integer + Zero based direction number. + In a typical Cartesian case, 0 would be 'x' direction. + include_ghosts : bool, default=False + Whether or not ghost cells are included in the mesh. + + """ @typing.overload def invert(self, numerator: float, nghost: int) -> None: """ @@ -6868,6 +6934,30 @@ class MultiFab(FabArray_FArrayBox): def n_comp(self) -> int: ... @property def n_grow_vect(self) -> IntVect1D: ... + @property + def shape(self, include_ghosts=False): + """ + Returns the shape of the global array + + Parameters + ---------- + self : amrex.MultiFab + A MultiFab class in pyAMReX + include_ghosts : bool, default=False + Whether or not ghost cells are included + + """ + @property + def shape_with_ghosts(self): + """ + Returns the shape of the global array including ghost cells + + Parameters + ---------- + self : amrex.MultiFab + A MultiFab class in pyAMReX + + """ class PODVector_int_arena: def __getitem__(self, arg0: int) -> int: ... diff --git a/src/amrex/space2d/amrex_2d_pybind/__init__.pyi b/src/amrex/space2d/amrex_2d_pybind/__init__.pyi index 742634f1..6b26c72f 100644 --- a/src/amrex/space2d/amrex_2d_pybind/__init__.pyi +++ b/src/amrex/space2d/amrex_2d_pybind/__init__.pyi @@ -6304,6 +6304,30 @@ class MultiFab(FabArray_FArrayBox): """ dst = src + a*dst """ + def __getitem__(self, index): + """ + Returns slice of the MultiFab using global indexing, as a numpy array. + This uses numpy array indexing, with the indexing relative to the global array. + The slice ranges can cross multiple blocks and the result will be gathered into a single + array. + + In an MPI context, this is a global operation. An "allgather" is performed so that the full + result is returned on all processors. + + Note that the index is in fortran ordering and that 0 is the lower boundary of the whole domain. + + The default range of the indices includes only the valid cells. The ":" index will include all of + the valid cels and no ghost cells. The ghost cells can be accessed using imaginary numbers, with + negative imaginary numbers for the lower ghost cells, and positive for the upper ghost cells. + The index "[-1j]" for example refers to the first lower ghost cell, and "[1j]" to the first upper + ghost cell. To access all cells, ghosts and valid cells, use an empty tuple for the index, i.e. "[()]". + + Parameters + ---------- + index : the index using numpy style indexing + Index of the slice to return. + + """ @typing.overload def __init__(self) -> None: """ @@ -6507,6 +6531,32 @@ class MultiFab(FabArray_FArrayBox): FArrayBoxFactory for embedded boundaries """ def __repr__(self) -> str: ... + def __setitem__(self, index, value): + """ + Sets the slice of the MultiFab using global indexing. + This uses numpy array indexing, with the indexing relative to the global array. + The slice ranges can cross multiple blocks and the value will be distributed accordingly. + Note that this will apply the value to both valid and ghost cells. + + In an MPI context, this is a local operation. On each processor, the blocks within the slice + range will be set to the value. + + Note that the index is in fortran ordering and that 0 is the lower boundary of the whole domain. + + The default range of the indices includes only the valid cells. The ":" index will include all of + the valid cels and no ghost cells. The ghost cells can be accessed using imaginary numbers, with + negative imaginary numbers for the lower ghost cells, and positive for the upper ghost cells. + The index "[-1j]" for example refers to the first lower ghost cell, and "[1j]" to the first upper + ghost cell. To access all cells, ghosts and valid cells, use an empty tuple for the index, i.e. "[()]". + + Parameters + ---------- + index : the index using numpy style indexing + Index of the slice to return. + value : scalar or array + Input value to assign to the specified slice of the MultiFab + + """ def average_sync(self, arg0: Periodicity) -> None: ... def box_array(self: FabArrayBase) -> BoxArray: ... @typing.overload @@ -6559,6 +6609,22 @@ class MultiFab(FabArray_FArrayBox): against divide by zero. """ def dm(self: FabArrayBase) -> DistributionMapping: ... + def imesh(self, idir, include_ghosts=False): + """ + Returns the integer mesh along the specified direction with the appropriate centering. + This is the location of the data points in grid cell units. + + Parameters + ---------- + self : amrex.MultiFab + A MultiFab class in pyAMReX + direction : integer + Zero based direction number. + In a typical Cartesian case, 0 would be 'x' direction. + include_ghosts : bool, default=False + Whether or not ghost cells are included in the mesh. + + """ @typing.overload def invert(self, numerator: float, nghost: int) -> None: """ @@ -6896,6 +6962,30 @@ class MultiFab(FabArray_FArrayBox): def n_comp(self) -> int: ... @property def n_grow_vect(self) -> IntVect2D: ... + @property + def shape(self, include_ghosts=False): + """ + Returns the shape of the global array + + Parameters + ---------- + self : amrex.MultiFab + A MultiFab class in pyAMReX + include_ghosts : bool, default=False + Whether or not ghost cells are included + + """ + @property + def shape_with_ghosts(self): + """ + Returns the shape of the global array including ghost cells + + Parameters + ---------- + self : amrex.MultiFab + A MultiFab class in pyAMReX + + """ class PODVector_int_arena: def __getitem__(self, arg0: int) -> int: ... diff --git a/src/amrex/space3d/amrex_3d_pybind/__init__.pyi b/src/amrex/space3d/amrex_3d_pybind/__init__.pyi index af32604b..6241e711 100644 --- a/src/amrex/space3d/amrex_3d_pybind/__init__.pyi +++ b/src/amrex/space3d/amrex_3d_pybind/__init__.pyi @@ -6283,6 +6283,30 @@ class MultiFab(FabArray_FArrayBox): """ dst = src + a*dst """ + def __getitem__(self, index): + """ + Returns slice of the MultiFab using global indexing, as a numpy array. + This uses numpy array indexing, with the indexing relative to the global array. + The slice ranges can cross multiple blocks and the result will be gathered into a single + array. + + In an MPI context, this is a global operation. An "allgather" is performed so that the full + result is returned on all processors. + + Note that the index is in fortran ordering and that 0 is the lower boundary of the whole domain. + + The default range of the indices includes only the valid cells. The ":" index will include all of + the valid cels and no ghost cells. The ghost cells can be accessed using imaginary numbers, with + negative imaginary numbers for the lower ghost cells, and positive for the upper ghost cells. + The index "[-1j]" for example refers to the first lower ghost cell, and "[1j]" to the first upper + ghost cell. To access all cells, ghosts and valid cells, use an empty tuple for the index, i.e. "[()]". + + Parameters + ---------- + index : the index using numpy style indexing + Index of the slice to return. + + """ @typing.overload def __init__(self) -> None: """ @@ -6486,6 +6510,32 @@ class MultiFab(FabArray_FArrayBox): FArrayBoxFactory for embedded boundaries """ def __repr__(self) -> str: ... + def __setitem__(self, index, value): + """ + Sets the slice of the MultiFab using global indexing. + This uses numpy array indexing, with the indexing relative to the global array. + The slice ranges can cross multiple blocks and the value will be distributed accordingly. + Note that this will apply the value to both valid and ghost cells. + + In an MPI context, this is a local operation. On each processor, the blocks within the slice + range will be set to the value. + + Note that the index is in fortran ordering and that 0 is the lower boundary of the whole domain. + + The default range of the indices includes only the valid cells. The ":" index will include all of + the valid cels and no ghost cells. The ghost cells can be accessed using imaginary numbers, with + negative imaginary numbers for the lower ghost cells, and positive for the upper ghost cells. + The index "[-1j]" for example refers to the first lower ghost cell, and "[1j]" to the first upper + ghost cell. To access all cells, ghosts and valid cells, use an empty tuple for the index, i.e. "[()]". + + Parameters + ---------- + index : the index using numpy style indexing + Index of the slice to return. + value : scalar or array + Input value to assign to the specified slice of the MultiFab + + """ def average_sync(self, arg0: Periodicity) -> None: ... def box_array(self: FabArrayBase) -> BoxArray: ... @typing.overload @@ -6538,6 +6588,22 @@ class MultiFab(FabArray_FArrayBox): against divide by zero. """ def dm(self: FabArrayBase) -> DistributionMapping: ... + def imesh(self, idir, include_ghosts=False): + """ + Returns the integer mesh along the specified direction with the appropriate centering. + This is the location of the data points in grid cell units. + + Parameters + ---------- + self : amrex.MultiFab + A MultiFab class in pyAMReX + direction : integer + Zero based direction number. + In a typical Cartesian case, 0 would be 'x' direction. + include_ghosts : bool, default=False + Whether or not ghost cells are included in the mesh. + + """ @typing.overload def invert(self, numerator: float, nghost: int) -> None: """ @@ -6875,6 +6941,30 @@ class MultiFab(FabArray_FArrayBox): def n_comp(self) -> int: ... @property def n_grow_vect(self) -> IntVect3D: ... + @property + def shape(self, include_ghosts=False): + """ + Returns the shape of the global array + + Parameters + ---------- + self : amrex.MultiFab + A MultiFab class in pyAMReX + include_ghosts : bool, default=False + Whether or not ghost cells are included + + """ + @property + def shape_with_ghosts(self): + """ + Returns the shape of the global array including ghost cells + + Parameters + ---------- + self : amrex.MultiFab + A MultiFab class in pyAMReX + + """ class PODVector_int_arena: def __getitem__(self, arg0: int) -> int: ...