Hipace
src
particles
sorting
BoxSort.H
Go to the documentation of this file.
1
/* Copyright 2021
2
*
3
* This file is part of HiPACE++.
4
*
5
* Authors: MaxThevenet
6
* License: BSD-3-Clause-LBNL
7
*/
8
#ifndef HIPACE_BoxSort_H_
9
#define HIPACE_BoxSort_H_
10
11
#include <
AMReX_MultiFab.H
>
12
#include <
AMReX_AmrParticles.H
>
13
#include <
AMReX_Particles.H
>
14
#include <
AMReX_AmrCore.H
>
15
16
class
BeamParticleContainer
;
17
18
class
BoxSorter
19
{
20
public
:
21
using
index_type
=
unsigned
long
long;
22
23
void
sortParticlesByBox
(
const
amrex::Real * z_array,
24
const
index_type
num_particles,
25
const
bool
init_on_cpu,
26
const
amrex::Geometry
& a_geom);
27
29
index_type
*
boxCountsPtr
() noexcept {
return
m_box_counts_cpu
.
dataPtr
(); }
30
32
index_type
*
boxOffsetsPtr
() noexcept {
return
m_box_offsets_cpu
.
dataPtr
(); }
33
35
const
index_type
*
boxCountsPtr
() const noexcept {
return
m_box_counts_cpu
.
dataPtr
(); }
36
38
const
index_type
*
boxOffsetsPtr
() const noexcept {
return
m_box_offsets_cpu
.
dataPtr
(); }
39
40
42
amrex::Vector<index_type>
m_box_counts_cpu
;
44
amrex::Vector<index_type>
m_box_offsets_cpu
;
47
amrex::PODVector<index_type, amrex::PolymorphicArenaAllocator<index_type>
>
m_box_permutations
;
48
};
49
50
#endif
// HIPACE_BoxSort_H_
AMReX_AmrCore.H
AMReX_AmrParticles.H
AMReX_MultiFab.H
AMReX_Particles.H
BeamParticleContainer
Container for particles of 1 beam species.
Definition:
BeamParticleContainer.H:68
BoxSorter
Definition:
BoxSort.H:19
BoxSorter::boxOffsetsPtr
const index_type * boxOffsetsPtr() const noexcept
returns the pointer to the offsets array
Definition:
BoxSort.H:38
BoxSorter::m_box_counts_cpu
amrex::Vector< index_type > m_box_counts_cpu
Definition:
BoxSort.H:42
BoxSorter::boxCountsPtr
index_type * boxCountsPtr() noexcept
returns the pointer to the permutation array
Definition:
BoxSort.H:29
BoxSorter::boxCountsPtr
const index_type * boxCountsPtr() const noexcept
returns the pointer to the permutation array
Definition:
BoxSort.H:35
BoxSorter::sortParticlesByBox
void sortParticlesByBox(const amrex::Real *z_array, const index_type num_particles, const bool init_on_cpu, const amrex::Geometry &a_geom)
Definition:
BoxSort.cpp:14
BoxSorter::index_type
unsigned long long index_type
Definition:
BoxSort.H:21
BoxSorter::m_box_offsets_cpu
amrex::Vector< index_type > m_box_offsets_cpu
Definition:
BoxSort.H:44
BoxSorter::boxOffsetsPtr
index_type * boxOffsetsPtr() noexcept
returns the pointer to the offsets array
Definition:
BoxSort.H:32
BoxSorter::m_box_permutations
amrex::PODVector< index_type, amrex::PolymorphicArenaAllocator< index_type > > m_box_permutations
Definition:
BoxSort.H:47
amrex::Geometry
amrex::PODVector
amrex::Vector< index_type >
amrex::Vector::dataPtr
T * dataPtr() noexcept
Generated by
1.9.1