Boundary

These functions are responsible for providing boundary particles outside of a box, either using particle repetition when the data has periodic boundary conditions or random buffer particles. The MPI implementation, using slab decomposition, will pass boundary and internal buffer particles between slabs.

Randoms

fiesta.boundary.buffer_random_2D(npart: int, boxsize: float | List[float], buffer_length: float, origin: float | List[float] = 0.0) Tuple[ndarray, ndarray]

Generates random buffer particles around a 2D box.

Parameters:
  • npart (int) – Number of particles in the 2D box.

  • boxsize (float or list) – Box size.

  • buffer_length (float) – Length of the buffer region.

  • origin (float or list, optional) – Origin point.

Returns:

  • x (array) – Random x-values.

  • y (array) – Random y-values.

fiesta.boundary.buffer_random_3D(npart: int, boxsize: float | List[float], buffer_length: float, origin: float | List[float] = 0.0) Tuple[ndarray, ndarray, ndarray]

Generates random buffer particles around a 3D box.

Parameters:
  • npart (int) – Number of particles in the 3D box.

  • boxsize (float or list) – Box size.

  • buffer_length (float) – Length of the buffer region.

  • origin (float or list, optional) – Origin point.

Returns:

  • x (array) – Random x-values.

  • y (array) – Random y-values.

  • z (array) – Random z-values.

fiesta.boundary.mpi_buffer_random_2D(npart: int, boxsize: float | List[float], limits: List[float], buffer_length: float, MPI: object) Tuple[ndarray, ndarray]

Generates random buffer particles around a 2D box.

Parameters:
  • npart (int) – Number of particles in the 2D box.

  • boxsize (float or list) – Box size.

  • limits (list) – Ranges for each coordinate axis [xmin, xmax, ymin, ymax].

  • buffer_length (float) – Length of the buffer region.

  • MPI (class object) – MPIutils MPI class object.

Returns:

  • x (array) – Random x-values.

  • y (array) – Random y-values.

fiesta.boundary.mpi_buffer_random_3D(npart: int, boxsize: float | List[float], limits: List[float], buffer_length: float, MPI: object) Tuple[ndarray, ndarray, ndarray]

Generates random buffer particles around a 3D box.

Parameters:
  • npart (int) – Number of particles in the 3D box.

  • boxsize (float or list) – Box size.

  • limits (list) – Ranges for each coordinate axis [xmin, xmax, ymin, ymax, zmin, zmax].

  • buffer_length (float) – Length of the buffer region.

  • MPI (class object) – MPIutils MPI class object.

Returns:

  • x (array) – Random x-values.

  • y (array) – Random y-values.

  • z (array) – Random z-values.

fiesta.boundary.mpi_buffer_random_utils(data: ndarray, limits: List[float], buffer_length: float, MPI: object) ndarray

Generates random buffer particles around a 2D box.

Parameters:
  • data (array) – Where columns 0 and 1 are x and y.

  • limits (list) – Ranges for each coordinate axis [xmin, xmax, ymin, ymax].

  • buffer_length (float) – Length of the buffer region.

  • MPI (class object) – MPIutils MPI class object.

Returns:

datap – Periodic data values.

Return type:

array

Periodic

fiesta.boundary.buffer_periodic(data: ndarray, axis: int, boxsize: float, buffer_length: float, origin: float = 0.0) ndarray

Returns periodic boundary conditions.

Parameters:
  • data (array) – Data for which we want periodic boundaries.

  • axis (int) – The axis which we want periodic boundaries.

  • boxsize (float) – Box size.

  • buffer_length (float) – Length of the buffer region.

  • origin (float, optional) – Origin point.

Returns:

datap – Data with periodic buffer particles.

Return type:

array

fiesta.boundary.subbox_buffer_periodic(data: ndarray, axis: int, boxsize: float, buffer_length: float, subboxsize: float, origin: float = 0.0, subbox_origin: float = 0.0) ndarray

Returns periodic boundary conditions in a subbox.

Parameters:
  • data (array) – Data for which we want periodic boundaries.

  • axis (int) – The axis which we want periodic boundaries.

  • boxsize (float) – Box size.

  • buffer_length (float) – Length of the buffer region.

  • subboxsize (float) – Size of subbox.

  • origin (float, optional) – Origin point.

  • subbox_origin (float, optional) – Origin point for the subbox.

Returns:

datap – Data with periodic buffer particles.

Return type:

array

fiesta.boundary.buffer_periodic_2D(data: ndarray, boxsize: float | List[float], buffer_length: float, origin: float | List[float] = 0.0) ndarray

Generates random buffer particles around a 2D box.

Parameters:
  • data (array) – Where columns 0 and 1 are x and y.

  • boxsize (float or list) – Box size.

  • buffer_length (float) – Length of the buffer region.

  • origin (float or list, optional) – Origin point.

Returns:

datap – Periodic data values.

Return type:

array

fiesta.boundary.subbox_buffer_periodic_2D(data: ndarray, boxsize: float | List[float], buffer_length: float, subboxsize: float | List[float], origin: float | List[float] = 0.0, subbox_origin: float | List[float] = 0.0) ndarray

Generates random buffer particles around a 2D box.

Parameters:
  • data (array) – Data for which we want periodic boundaries.

  • axis (int) – The axis which we want periodic boundaries.

  • boxsize (float or list) – Box size.

  • buffer_length (float) – Length of the buffer region.

  • subboxsize (float or list) – Size of subbox.

  • origin (float or list, optional) – Origin point.

  • subbox_origin (float or list, optional) – Origin point for the subbox.

Returns:

datap – Periodic data values.

Return type:

array

fiesta.boundary.buffer_periodic_3D(data: ndarray, boxsize: float | List[float], buffer_length: float, origin: float | List[float] = 0.0) ndarray

Generates random buffer particles around a 3D box.

Parameters:
  • data (array) – Where columns 0, 1 and 2 correspond to the x, y and z coordinates.

  • boxsize (float or list) – Box size.

  • buffer_length (float) – Length of the buffer region.

  • origin (float or list, optional) – Origin point.

Returns:

datap – Periodic data values.

Return type:

array

fiesta.boundary.subbox_buffer_periodic_3D(data: ndarray, boxsize: float | List[float], buffer_length: float, subboxsize: float | List[float], origin: float | List[float] = 0.0, subbox_origin: float | List[float] = 0.0) ndarray

Generates random buffer particles around a 3D box.

Parameters:
  • data (array) – Data for which we want periodic boundaries.

  • axis (int) – The axis which we want periodic boundaries.

  • boxsize (float or list) – Box size.

  • buffer_length (float) – Length of the buffer region.

  • subboxsize (float or list) – Size of subbox.

  • origin (float or list, optional) – Origin point.

  • subbox_origin (float or list, optional) – Origin point for the subbox.

Returns:

datap – Periodic data values.

Return type:

array

fiesta.boundary.mpi_buffer_internal_2D(data: ndarray, boxsize: float, buffer_length: float, MPI: object, origin: float = 0.0) ndarray

Internal buffer particles between partitions are moved up and down.

Parameters:
  • data (array) – Where columns 0 and 1 correspond to the x and y coordinates.

  • xboxsize (float) – Boxsize along x-axis.

  • buffer_length (float) – Length of the buffer region.

  • MPI (class object) – MPIutils MPI class object.

  • origin (float, optional) – Origin point.

Returns:

datap – Periodic data values.

Return type:

array

fiesta.boundary.mpi_buffer_internal_3D(data: ndarray, boxsize: float, buffer_length: float, MPI: object, origin: float = 0.0) ndarray

Internal buffer particles between partitions are moved up and down.

Parameters:
  • data (array) – Where columns 0, 1 and 2 correspond to the x, y and z coordinates.

  • xboxsize (float) – Boxsize along x-axis.

  • buffer_length (float) – Length of the buffer region.

  • MPI (class object) – MPIutils MPI class object.

  • origin (float, optional) – Origin point.

Returns:

datap – Periodic data values.

Return type:

array

fiesta.boundary.mpi_buffer_periodic_2D(data: ndarray, boxsize: float | List[float], buffer_length: float, MPI: object, origin: float | List[float] = 0.0, include_internal: bool = True) ndarray

Generates random buffer particles around a 2D box.

Parameters:
  • data (array) – Where columns 0 and 1 are x and y.

  • boxsize (float or list) – Boxsize.

  • buffer_length (float) – Length of the buffer region.

  • MPI (class object) – MPIutils MPI class object.

  • origin (float or list, optional) – Origin point.

  • include_internal (bool, optional) – Whether to include internal buffer particles.

Returns:

datap – Periodic data values.

Return type:

array

fiesta.boundary.mpi_buffer_periodic_3D(data: ndarray, boxsize: float | List[float], buffer_length: float, MPI: object, origin: float | List[float] = 0.0, include_internal: bool = True) ndarray

Generates random buffer particles around a 3D box.

Parameters:
  • data (array) – Where columns 0, 1 and 2 correspond to the x, y and z coordinates.

  • xboxsize (float or list) – Boxsize along x-axis.

  • buffer_length (float) – Length of the buffer region.

  • MPI (class object) – MPIutils MPI class object.

  • origin (float or list, optional) – Origin point.

  • include_internal (bool, optional) – Whether to include internal buffer particles.

Returns:

datap – Periodic data values.

Return type:

array