Particle creation utilities based on uniform grids. More...
#include <Cabana_Grid_Parallel.hpp>
#include <Cabana_Grid_ParticleList.hpp>
#include <Cabana_ParticleInit.hpp>
#include <Cabana_Slice.hpp>
#include <Kokkos_Core.hpp>
#include <Kokkos_Random.hpp>
#include <exception>
Go to the source code of this file.
Namespaces | |
namespace | Cabana |
Core: particle data structures and algorithms. | |
Functions | |
template<class ExecutionSpace, class InitFunctor, class ParticleListType, class LocalGridType> | |
int | Cabana::Grid::createParticles (Cabana::InitRandom, const ExecutionSpace &exec_space, const InitFunctor &create_functor, ParticleListType &particle_list, const int particles_per_cell, LocalGridType &local_grid, const std::size_t previous_num_particles=0, const bool shrink_to_fit=true, const uint64_t seed=123456, typename std::enable_if< is_particle_list< ParticleListType >::value, int >::type *=0) |
Initialize a random number of particles in each cell given an initialization functor. | |
template<class InitFunctor, class ParticleListType, class LocalGridType> | |
int | Cabana::Grid::createParticles (Cabana::InitRandom tag, const InitFunctor &create_functor, ParticleListType &particle_list, const int particles_per_cell, LocalGridType &local_grid, const std::size_t previous_num_particles=0, const bool shrink_to_fit=true, const uint64_t seed=123456, typename std::enable_if< is_particle_list< ParticleListType >::value, int >::type *=0) |
Initialize random particles per cell given an initialization functor. | |
template<class ExecutionSpace, class PositionType, class LocalGridType> | |
void | Cabana::Grid::createParticles (Cabana::InitRandom, const ExecutionSpace &exec_space, PositionType &positions, const int particles_per_cell, LocalGridType &local_grid, const std::size_t previous_num_particles=0, const uint64_t seed=123456, typename std::enable_if<(Cabana::is_slice< PositionType >::value||Kokkos::is_view< PositionType >::value), int >::type *=0) |
Initialize a random number of particles in each cell. | |
template<class PositionType, class LocalGridType> | |
void | Cabana::Grid::createParticles (Cabana::InitRandom tag, PositionType &positions, const int particles_per_cell, LocalGridType &local_grid, const std::size_t previous_num_particles=0, const uint64_t seed=123456, typename std::enable_if<(Cabana::is_slice< PositionType >::value||Kokkos::is_view< PositionType >::value), int >::type *=0) |
Initialize a random number of particles in each cell. | |
template<class ExecutionSpace, class InitFunctor, class ParticleListType, class LocalGridType> | |
int | Cabana::Grid::createParticles (Cabana::InitUniform, const ExecutionSpace &exec_space, const InitFunctor &create_functor, ParticleListType &particle_list, const int particles_per_cell_dim, LocalGridType &local_grid, const std::size_t previous_num_particles=0, const bool shrink_to_fit=true, typename std::enable_if< is_particle_list< ParticleListType >::value, int >::type *=0) |
Initialize uniform particles per cell given an initialization functor. | |
template<class InitFunctor, class ParticleListType, class LocalGridType> | |
int | Cabana::Grid::createParticles (Cabana::InitUniform tag, const InitFunctor &create_functor, ParticleListType &particle_list, const int particles_per_cell_dim, LocalGridType &local_grid, const std::size_t previous_num_particles=0, const bool shrink_to_fit=true, typename std::enable_if< is_particle_list< ParticleListType >::value, int >::type *=0) |
Initialize uniform particles per cell given an initialization functor. | |
template<class ExecutionSpace, class PositionType, class LocalGridType> | |
void | Cabana::Grid::createParticles (Cabana::InitUniform, const ExecutionSpace &exec_space, PositionType &positions, const int particles_per_cell_dim, LocalGridType &local_grid, const std::size_t previous_num_particles=0, typename std::enable_if<(Cabana::is_slice< PositionType >::value||Kokkos::is_view< PositionType >::value), int >::type *=0) |
Initialize a uniform number of particles in each cell. | |
template<class PositionType, class LocalGridType> | |
void | Cabana::Grid::createParticles (Cabana::InitUniform tag, PositionType &positions, const int particles_per_cell_dim, LocalGridType &local_grid, const std::size_t previous_num_particles=0, typename std::enable_if<(Cabana::is_slice< PositionType >::value||Kokkos::is_view< PositionType >::value), int >::type *=0) |
Initialize a uniform number of particles in each cell. | |
Particle creation utilities based on uniform grids.
int Cabana::Grid::createParticles | ( | Cabana::InitRandom | tag, |
const InitFunctor & | create_functor, | ||
ParticleListType & | particle_list, | ||
const int | particles_per_cell, | ||
LocalGridType & | local_grid, | ||
const std::size_t | previous_num_particles = 0, | ||
const bool | shrink_to_fit = true, | ||
const uint64_t | seed = 123456, | ||
typename std::enable_if< is_particle_list< ParticleListType >::value, int >::type * | = 0 ) |
Initialize random particles per cell given an initialization functor.
tag | Initialization type tag. |
create_functor | A functor which populates a particle given the logical position of a particle. This functor returns true if a particle was created and false if it was not giving the signature: bool createFunctor( const double pid, const double px[3], const double pv, typename ParticleAoSoA::tuple_type& particle ); |
particle_list | The ParticleList to populate. This will be filled with particles and resized to a size equal to the number of particles created. |
particles_per_cell | The number of particles to sample each cell with. |
local_grid | The LocalGrid over which particles will be created. |
previous_num_particles | Optionally specify how many particles are already in the container (and should be unchanged). |
shrink_to_fit | Optionally remove unused allocated space after creation. |
seed | Optional random seed for generating particles. |
void Cabana::Grid::createParticles | ( | Cabana::InitRandom | tag, |
PositionType & | positions, | ||
const int | particles_per_cell, | ||
LocalGridType & | local_grid, | ||
const std::size_t | previous_num_particles = 0, | ||
const uint64_t | seed = 123456, | ||
typename std::enable_if<(Cabana::is_slice< PositionType >::value||Kokkos::is_view< PositionType >::value), int >::type * | = 0 ) |
Initialize a random number of particles in each cell.
tag | Initialization type tag. |
positions | Particle positions slice. This should be already the size of the number of grid cells times particles_per_cell.s |
particles_per_cell | The number of particles to sample each cell with. |
local_grid | The LocalGrid over which particles will be created. |
previous_num_particles | Optionally specify how many particles are already in the container (and should be unchanged). |
seed | Optional random seed for generating particles. |
int Cabana::Grid::createParticles | ( | Cabana::InitRandom | , |
const ExecutionSpace & | exec_space, | ||
const InitFunctor & | create_functor, | ||
ParticleListType & | particle_list, | ||
const int | particles_per_cell, | ||
LocalGridType & | local_grid, | ||
const std::size_t | previous_num_particles = 0, | ||
const bool | shrink_to_fit = true, | ||
const uint64_t | seed = 123456, | ||
typename std::enable_if< is_particle_list< ParticleListType >::value, int >::type * | = 0 ) |
Initialize a random number of particles in each cell given an initialization functor.
exec_space | Kokkos execution space. |
create_functor | A functor which populates a particle given the logical position of a particle. This functor returns true if a particle was created and false if it was not giving the signature: bool createFunctor( const double pid, const double px[3], const double pv, typename ParticleAoSoA::tuple_type& particle ); |
particle_list | The ParticleList to populate. This will be filled with particles and resized to a size equal to the number of particles created. |
particles_per_cell | The number of particles to sample each cell with. |
local_grid | The LocalGrid over which particles will be created. |
previous_num_particles | Optionally specify how many particles are already in the container (and should be unchanged). |
shrink_to_fit | Optionally remove unused allocated space after creation. |
seed | Optional random seed for generating particles. |
void Cabana::Grid::createParticles | ( | Cabana::InitRandom | , |
const ExecutionSpace & | exec_space, | ||
PositionType & | positions, | ||
const int | particles_per_cell, | ||
LocalGridType & | local_grid, | ||
const std::size_t | previous_num_particles = 0, | ||
const uint64_t | seed = 123456, | ||
typename std::enable_if<(Cabana::is_slice< PositionType >::value||Kokkos::is_view< PositionType >::value), int >::type * | = 0 ) |
Initialize a random number of particles in each cell.
exec_space | Kokkos execution space. |
positions | Particle positions slice. This should be already the size of the number of grid cells times particles_per_cell.s |
particles_per_cell | The number of particles to sample each cell with. |
local_grid | The LocalGrid over which particles will be created. |
previous_num_particles | Optionally specify how many particles are already in the container (and should be unchanged). |
seed | Optional random seed for generating particles. |
int Cabana::Grid::createParticles | ( | Cabana::InitUniform | tag, |
const InitFunctor & | create_functor, | ||
ParticleListType & | particle_list, | ||
const int | particles_per_cell_dim, | ||
LocalGridType & | local_grid, | ||
const std::size_t | previous_num_particles = 0, | ||
const bool | shrink_to_fit = true, | ||
typename std::enable_if< is_particle_list< ParticleListType >::value, int >::type * | = 0 ) |
Initialize uniform particles per cell given an initialization functor.
tag | Initialization type tag. |
create_functor | A functor which populates a particle given the logical position of a particle. This functor returns true if a particle was created and false if it was not giving the signature: bool createFunctor( const double pid, const double px[3], const double pv, typename ParticleAoSoA::tuple_type& particle ); |
particle_list | The ParticleList to populate. This will be filled with particles and resized to a size equal to the number of particles created. |
particles_per_cell_dim | The number of particles to populate each cell dimension with. |
local_grid | The LocalGrid over which particles will be created. |
previous_num_particles | Optionally specify how many particles are already in the container (and should be unchanged). |
shrink_to_fit | Optionally remove unused allocated space after creation. |
void Cabana::Grid::createParticles | ( | Cabana::InitUniform | tag, |
PositionType & | positions, | ||
const int | particles_per_cell_dim, | ||
LocalGridType & | local_grid, | ||
const std::size_t | previous_num_particles = 0, | ||
typename std::enable_if<(Cabana::is_slice< PositionType >::value||Kokkos::is_view< PositionType >::value), int >::type * | = 0 ) |
Initialize a uniform number of particles in each cell.
tag | Initialization type tag. |
positions | Particle positions slice. This should be already the size of the number of grid cells times particles_per_cell.s |
particles_per_cell_dim | The number of particles to populate each cell dimension with. |
local_grid | The LocalGrid over which particles will be created. |
previous_num_particles | Optionally specify how many particles are already in the container (and should be unchanged). |
int Cabana::Grid::createParticles | ( | Cabana::InitUniform | , |
const ExecutionSpace & | exec_space, | ||
const InitFunctor & | create_functor, | ||
ParticleListType & | particle_list, | ||
const int | particles_per_cell_dim, | ||
LocalGridType & | local_grid, | ||
const std::size_t | previous_num_particles = 0, | ||
const bool | shrink_to_fit = true, | ||
typename std::enable_if< is_particle_list< ParticleListType >::value, int >::type * | = 0 ) |
Initialize uniform particles per cell given an initialization functor.
exec_space | Kokkos execution space. |
create_functor | A functor which populates a particle given the logical position of a particle. This functor returns true if a particle was created and false if it was not giving the signature: bool createFunctor( const double px[3], typename ParticleAoSoA::tuple_type& particle ); |
particle_list | The ParticleList to populate. This will be filled with particles and resized to a size equal to the number of particles created. |
particles_per_cell_dim | The number of particles to populate each cell dimension with. |
local_grid | The LocalGrid over which particles will be created. |
previous_num_particles | Optionally specify how many particles are already in the container (and should be unchanged). |
shrink_to_fit | Optionally remove unused allocated space after creation. |
void Cabana::Grid::createParticles | ( | Cabana::InitUniform | , |
const ExecutionSpace & | exec_space, | ||
PositionType & | positions, | ||
const int | particles_per_cell_dim, | ||
LocalGridType & | local_grid, | ||
const std::size_t | previous_num_particles = 0, | ||
typename std::enable_if<(Cabana::is_slice< PositionType >::value||Kokkos::is_view< PositionType >::value), int >::type * | = 0 ) |
Initialize a uniform number of particles in each cell.
exec_space | Kokkos execution space. |
positions | Particle positions slice. This should be already the size of the number of grid cells times particles_per_cell.s |
particles_per_cell_dim | The number of particles to populate each cell dimension with. |
local_grid | The LocalGrid over which particles will be created. |
previous_num_particles | Optionally specify how many particles are already in the container (and should be unchanged). |