-
Notifications
You must be signed in to change notification settings - Fork 50
Core Linked Cell List
Sam Reeve edited this page May 18, 2023
·
2 revisions
A linked cell list bins particles based on their location over a Cartesian grid.
Header File: Cabana_LinkedCellList.hpp
Usage: To bin particles in a Cartesian grid.
template<class DeviceType>
class LinkedCellList
-
DeviceType
: The device type for which the halo data will be allocated and where parallel execution will occur.
Example: Linked Cell List Tutorial
Example: Linked Cell List Unit Test
// Create data including a member for particle coordinates.
using DataTypes = Cabana::MemberTypes<double[3],int>;
using DeviceType = Kokkos::Device<Kokkos::Serial, Kokkos::HostSpace>;
Cabana::AoSoA<DataTypes,DeviceType> aosoa( num_tuple );
auto positions = slice<0>( aosoa );
double grid_min[3] = {0.0,0.0,0.0};
double grid_max[3] = {3.0,3.0,3.0};
double grid_delta[3] = {1.0,1.0,1.0};
// Create the list
Cabana::LinkedCellList<DeviceType> cell_list(
positions, grid_delta, grid_min, grid_max );
// Permute the particles to be ordered by grid cell
Cabana::permute( cell_list, aosoa );
This is part of the Programming Guide series
Cabana - A Co-Designed Library for Exascale Particle Simulations