WarpX
Classes | Functions
SortingUtils.H File Reference
#include "Particles/WarpXParticleContainer.H"
#include <AMReX_Gpu.H>
#include <AMReX_Partition.H>
#include <AMReX_ParticleUtil.H>

Go to the source code of this file.

Classes

class  fillBufferFlag
 Functor that fills the elements of the particle array inexflag with the value of the spatial array bmasks, at the corresponding particle position. More...
 
class  fillBufferFlagRemainingParticles
 Functor that fills the elements of the particle array inexflag with the value of the spatial array bmasks, at the corresponding particle position. More...
 
class  copyAndReorder< T >
 Functor that copies the elements of src into dst, while reordering them according to indices More...
 

Functions

void fillWithConsecutiveIntegers (amrex::Gpu::DeviceVector< int > &v)
 Fill the elements of the input vector with consecutive integer, starting from 0. More...
 
template<typename ForwardIterator >
ForwardIterator stablePartition (ForwardIterator const index_begin, ForwardIterator const index_end, amrex::Gpu::DeviceVector< int > const &predicate)
 Find the indices that would reorder the elements of predicate so that the elements with non-zero value precede the other elements. More...
 
template<typename ForwardIterator >
int iteratorDistance (ForwardIterator const first, ForwardIterator const last)
 Return the number of elements between first and last More...
 

Function Documentation

◆ fillWithConsecutiveIntegers()

void fillWithConsecutiveIntegers ( amrex::Gpu::DeviceVector< int > &  v)

Fill the elements of the input vector with consecutive integer, starting from 0.

Parameters
[in,out]vVector of integers, to be filled by this routine

◆ iteratorDistance()

template<typename ForwardIterator >
int iteratorDistance ( ForwardIterator const  first,
ForwardIterator const  last 
)

Return the number of elements between first and last

Template Parameters
ForwardIteratorAn iterator that supports std::distance
Parameters
[in]firstPoints to a position in a vector
[in]lastPoints to another position in a vector
Returns
The number of elements between first and last

◆ stablePartition()

template<typename ForwardIterator >
ForwardIterator stablePartition ( ForwardIterator const  index_begin,
ForwardIterator const  index_end,
amrex::Gpu::DeviceVector< int > const &  predicate 
)

Find the indices that would reorder the elements of predicate so that the elements with non-zero value precede the other elements.

Template Parameters
ForwardIteratorAn iterator that supports std::advance
Parameters
[in,out]index_beginPoint to the beginning of the vector which is to be filled with these indices
[in,out]index_endPoint to the end of the vector which is to be filled with these indices
[in]predicatethat indicates the elements that need to be reordered first