Skip to content

Core Linked Cell List

Sam Reeve edited this page May 18, 2023 · 2 revisions

Overview

A linked cell list bins particles based on their location over a Cartesian grid.

Implementation

Header File: Cabana_LinkedCellList.hpp

Usage: To bin particles in a Cartesian grid.

Interface

template<class DeviceType>
class LinkedCellList

Template Parameters

  • DeviceType: The device type for which the halo data will be allocated and where parallel execution will occur.

Examples

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

Clone this wiki locally