Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2d neighbors #755

Open
wants to merge 34 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
df7291a
2d LinkedCellStencil
streeve May 8, 2024
5921a82
2d LinkedCellList
streeve May 8, 2024
e4ff586
2d LinkedCellList NeighborList interface
streeve May 8, 2024
f2ee694
2d VerletList
streeve May 8, 2024
057fa5f
WIP 2d ArborX lists
streeve May 16, 2024
969520b
WIP partial range lcl neigh???
streeve May 17, 2024
c2c376f
fixup: use getParticle in LinkedCell Neighbor
streeve May 17, 2024
ffb9d76
fixup: get LinkedCellList memory space from positions
streeve May 20, 2024
775304c
fixup: propagate dimension in createLinkedCellList
streeve May 20, 2024
623f2a0
fixup: deduced and non-deduced createLCL
streeve May 21, 2024
3debc4e
fixup stencil and grid
streeve May 24, 2024
1a83083
Test 2d LinkedCellStencil and Grid
streeve May 24, 2024
b7ae722
WIP
streeve Jun 12, 2024
5057f73
fixup: LCL
streeve Jun 20, 2024
f2c0137
WIP LCL 2d tests
streeve Jun 20, 2024
f889e44
fix 2d_linked_list_test
kwitaechong Oct 3, 2024
4c493ff
fix linked_list_view_test and add 2d version
kwitaechong Oct 3, 2024
31ec054
fix compile errors for example and benchmark
kwitaechong Oct 3, 2024
1a5d083
fixup: bad rebase for ArborX list
streeve Oct 4, 2024
0a9c9a2
add template parameter of dimension for neighbor_unit_test and fix r…
kwitaechong Oct 4, 2024
f20e192
template createParticles on 2d/3d dimension
kwitaechong Oct 5, 2024
2d0c03a
add template on dimention for NeighborList/Verletlist and add 2d test…
kwitaechong Oct 6, 2024
df43864
WIP 3d only ArborX tests
streeve Oct 8, 2024
5d0830e
fixup: warning
streeve Oct 8, 2024
d6f1ee1
WIP automatically determine dimension
streeve Oct 10, 2024
87f65ff
fixup: 2d LCL neighbor check
streeve Oct 11, 2024
0af06ac
2d LinkedCellList parallel_for/reduce
streeve Oct 11, 2024
1611089
Add Verlet creation functions
streeve Oct 11, 2024
fbc5c3b
fixup: 2d discriminator
streeve Oct 11, 2024
e72aafc
fixup: use createVerletList
streeve Oct 11, 2024
cd70b7f
fixup: add dim to ArborX test - no 2d Point
streeve Oct 11, 2024
26a281c
fixup: initialize empty array
streeve Oct 14, 2024
a762117
Simplify LinkedCellList discriminator with SelfNeighborTag option
streeve Oct 14, 2024
a78ac22
fixup: LCL example/benchmarks
streeve Oct 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion benchmark/core/Cabana_LinkedCellPerformance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ void performanceTest( std::ostream& stream, const std::string& test_prefix,
double sort_delta[3] = { cutoff, cutoff, cutoff };
double grid_min[3] = { x_min[p], x_min[p], x_min[p] };
double grid_max[3] = { x_max[p], x_max[p], x_max[p] };
auto linked_cell_list = Cabana::createLinkedCellList<memory_space>(
auto linked_cell_list = Cabana::createLinkedCellList(
x, sort_delta, grid_min, grid_max );

// Setup for neighbor iteration.
Expand Down
2 changes: 1 addition & 1 deletion benchmark/core/Cabana_NeighborArborXPerformance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void performanceTest( std::ostream& stream, const std::string& test_prefix,
double cutoff = cutoff_ratios.front();
double sort_delta[3] = { cutoff, cutoff, cutoff };
auto x = Cabana::slice<0>( aosoas[p], "position" );
auto linked_cell_list = Cabana::createLinkedCellList<memory_space>(
auto linked_cell_list = Cabana::createLinkedCellList(
x, sort_delta, grid_min, grid_max );
Cabana::permute( linked_cell_list, aosoas[p] );
}
Expand Down
2 changes: 1 addition & 1 deletion benchmark/core/Cabana_NeighborVerletPerformance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void performanceTest( std::ostream& stream, const std::string& test_prefix,
// in cells the size of the smallest cutoff distance.
double cutoff = cutoff_ratios.front();
double sort_delta[3] = { cutoff, cutoff, cutoff };
auto linked_cell_list = Cabana::createLinkedCellList<memory_space>(
auto linked_cell_list = Cabana::createLinkedCellList(
x, sort_delta, grid_min, grid_max );
Cabana::permute( linked_cell_list, aosoas[p] );
}
Expand Down
18 changes: 17 additions & 1 deletion core/src/Cabana_Experimental_NeighborList.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,18 +114,34 @@ struct AccessTraits<Positions, PrimitivesTag,
using memory_space = typename Positions::memory_space;
//! Size type.
using size_type = typename Positions::size_type;
//! Position array data type.
using data_type = typename Positions::data_type;
//! Spatial dimension.
static constexpr std::size_t num_space_dim =
Cabana::arraySize( data_type{} );

//! Get number of particles.
static KOKKOS_FUNCTION size_type size( Positions const& x )
{
return Cabana::size( x );
}
//! Get the particle at the index.
static KOKKOS_FUNCTION Point get( Positions const& x, size_type i )
template <std::size_t NSD = num_space_dim>
static KOKKOS_FUNCTION std::enable_if_t<3 == NSD, Point>
get( Positions const& x, size_type i )
{
return { static_cast<float>( x( i, 0 ) ),
static_cast<float>( x( i, 1 ) ),
static_cast<float>( x( i, 2 ) ) };
}
//! Get the particle at the index.
template <std::size_t NSD = num_space_dim>
static KOKKOS_FUNCTION std::enable_if_t<2 == NSD, Point>
get( Positions const& x, size_type i )
{
return { static_cast<float>( x( i, 0 ) ),
static_cast<float>( x( i, 1 ) ) };
}
};
//! Neighbor access trait.
template <typename Positions>
Expand Down
Loading
Loading