Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
1cf9ff6
Add simpler version of ParticleTile using 2D array
AlexanderSinn Apr 7, 2025
aeb1ca0
fix
AlexanderSinn Apr 7, 2025
be36e1f
fix 2
AlexanderSinn Apr 7, 2025
8710b38
add some nodiscard
AlexanderSinn Apr 7, 2025
1626d2b
fix restrict
AlexanderSinn Apr 7, 2025
e10d6b2
Merge branch 'AMReX-Codes:development' into Add_simpler_version_of_Pa…
AlexanderSinn Apr 22, 2025
06112b4
add ArrayView
AlexanderSinn Apr 22, 2025
25709fd
add get_idx_from_str
AlexanderSinn Apr 22, 2025
7fd24ad
fix int static_cast
AlexanderSinn Apr 22, 2025
632028b
add ParticleContainerPureSoA2
AlexanderSinn Apr 22, 2025
7aade3c
add nodiscard
AlexanderSinn Apr 22, 2025
b202139
add fwd declaration
AlexanderSinn Apr 22, 2025
0a934c5
workaround windows compiler bug
AlexanderSinn Apr 22, 2025
8104fe7
update RedistributeCPU
AlexanderSinn Apr 24, 2025
89ae3bf
fix define
AlexanderSinn Apr 24, 2025
975516e
fix GetArrayOfStructs
AlexanderSinn Apr 24, 2025
2bf4c97
fix unused variable
AlexanderSinn Apr 24, 2025
c7e3033
fix nodiscard
AlexanderSinn Apr 24, 2025
1f92436
add more backwards compatibility
AlexanderSinn Apr 25, 2025
1736b19
Merge branch 'AMReX-Codes:development' into Add_simpler_version_of_Pa…
AlexanderSinn May 17, 2025
57152e6
Merge branch 'AMReX-Codes:development' into Add_simpler_version_of_Pa…
AlexanderSinn Jun 15, 2025
0b6e182
more compatibility
AlexanderSinn Jun 15, 2025
03520fb
add idcpu function
AlexanderSinn Jun 16, 2025
d288f38
fix warnings
AlexanderSinn Jun 16, 2025
16e48b8
remove some SuperParticleType
AlexanderSinn Jun 16, 2025
705da47
change SuperParticle type to Particle
AlexanderSinn Jun 27, 2025
d9e609e
merge dev
AlexanderSinn Jul 26, 2025
aa0b7bb
revert some changes
AlexanderSinn Jul 26, 2025
1b6ac3c
revert some more
AlexanderSinn Jul 26, 2025
bc0de8a
separate out ReorderParticles for ptile
AlexanderSinn Jul 26, 2025
cabc63f
change define
AlexanderSinn Jul 26, 2025
5a7a1e1
fix
AlexanderSinn Jul 26, 2025
d19a8cd
fix2
AlexanderSinn Jul 26, 2025
f354269
fix3
AlexanderSinn Jul 26, 2025
9069528
fix4
AlexanderSinn Jul 26, 2025
17a12af
fix5
AlexanderSinn Jul 26, 2025
3eee1d9
fix6
AlexanderSinn Jul 26, 2025
804e107
fix getSuperParticle
AlexanderSinn Jul 26, 2025
2a17251
change name to RTSoA
AlexanderSinn Jul 26, 2025
20c7269
change name to RTSoA
AlexanderSinn Jul 26, 2025
a635c59
add stream sync
AlexanderSinn Jul 26, 2025
85b2573
update WriteBinaryParticleData
AlexanderSinn Jul 26, 2025
47c0135
fix
AlexanderSinn Jul 26, 2025
004232e
Merge branch 'AMReX-Codes:development' into Add_simpler_version_of_Pa…
AlexanderSinn Aug 10, 2025
a2fd415
merge dev
AlexanderSinn Aug 13, 2025
ec7371d
Merge branch 'development' into Add_simpler_version_of_ParticleTile_u…
AlexanderSinn Oct 17, 2025
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
1 change: 1 addition & 0 deletions Src/Particle/AMReX_NeighborParticles.H
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <AMReX_NeighborList.H>
#include <AMReX_OpenMP.H>
#include <AMReX_ParticleTile.H>
#include <AMReX_ParticleTileRT.H>

namespace amrex {

Expand Down
15 changes: 12 additions & 3 deletions Src/Particle/AMReX_ParIter.H
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ struct Particle;
template <int NArrayReal, int NArrayInt>
struct SoAParticle;

template <class RType, class IType>
struct RTSoAParticle;

struct DefaultAssignor;

// for backwards compatibility
Expand Down Expand Up @@ -87,11 +90,11 @@ public:

[[nodiscard]] SoARef GetStructOfArrays () const { return GetParticleTile().GetStructOfArrays(); }

[[nodiscard]] int numParticles () const { return GetParticleTile().numParticles(); }
[[nodiscard]] auto numParticles () const { return GetParticleTile().numParticles(); }

[[nodiscard]] int numRealParticles () const { return GetParticleTile().numRealParticles(); }
[[nodiscard]] auto numRealParticles () const { return GetParticleTile().numRealParticles(); }

[[nodiscard]] int numNeighborParticles () const { return GetParticleTile().numNeighborParticles(); }
[[nodiscard]] auto numNeighborParticles () const { return GetParticleTile().numNeighborParticles(); }

[[nodiscard]] Long capacity () const { return GetParticleTile().capacity(); }

Expand Down Expand Up @@ -226,13 +229,19 @@ using ParConstIter = ParConstIter_impl<Particle<T_NStructReal, T_NStructInt>, T_
template <int T_NArrayReal, int T_NArrayInt, template<class> class Allocator=DefaultAllocator, class CellAssignor=DefaultAssignor>
using ParConstIterSoA = ParConstIter_impl<SoAParticle<T_NArrayReal, T_NArrayInt>, T_NArrayReal, T_NArrayInt, Allocator, CellAssignor>;

template <class RType=ParticleReal, class IType=int, class CellAssignor=DefaultAssignor>
using ParConstIterRTSoA = ParConstIter_impl<RTSoAParticle<RType, IType>, 0, 0, PolymorphicArenaAllocator, CellAssignor>;

template <int T_NStructReal, int T_NStructInt=0, int T_NArrayReal=0, int T_NArrayInt=0,
template<class> class Allocator=DefaultAllocator, class CellAssignor=DefaultAssignor>
using ParIter = ParIter_impl<Particle<T_NStructReal, T_NStructInt>, T_NArrayReal, T_NArrayInt, Allocator, CellAssignor>;

template <int T_NArrayReal, int T_NArrayInt, template<class> class Allocator=DefaultAllocator, class CellAssignor=DefaultAssignor>
using ParIterSoA = ParIter_impl<SoAParticle<T_NArrayReal, T_NArrayInt>, T_NArrayReal, T_NArrayInt, Allocator, CellAssignor>;

template <class RType=ParticleReal, class IType=int, class CellAssignor=DefaultAssignor>
using ParIterRTSoA = ParIter_impl<RTSoAParticle<RType, IType>, 0, 0, PolymorphicArenaAllocator, CellAssignor>;

}

#endif
2 changes: 2 additions & 0 deletions Src/Particle/AMReX_Particle.H
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ struct SoAParticleBase
static constexpr int NReal=0;
static constexpr int NInt=0;
static constexpr bool is_soa_particle = true;
static constexpr bool is_rtsoa_particle = false;
};

/** \brief The struct used to store particles.
Expand All @@ -401,6 +402,7 @@ struct alignas(sizeof(double)) Particle
: ParticleBase<ParticleReal,T_NReal,T_NInt>
{
static constexpr bool is_soa_particle = false;
static constexpr bool is_rtsoa_particle = false;
using StorageParticleType = Particle;
using ConstType = Particle const;

Expand Down
16 changes: 14 additions & 2 deletions Src/Particle/AMReX_ParticleContainer.H
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <AMReX_ArrayOfStructs.H>
#include <AMReX_Particle.H>
#include <AMReX_ParticleTile.H>
#include <AMReX_ParticleTileRT.H>
#include <AMReX_TypeTraits.H>
#include <AMReX_GpuContainers.H>
#include <AMReX_ParticleUtil.H>
Expand Down Expand Up @@ -179,8 +180,14 @@ public:
RealDescriptor ParticleRealDescriptor = FPC::Native64RealDescriptor();
#endif

static constexpr bool is_rtsoa_pc = ParticleType::is_rtsoa_particle;

using ParticleContainerType = ParticleContainer_impl<ParticleType, NArrayReal, NArrayInt, Allocator, CellAssignor>;
using ParticleTileType = ParticleTile<ParticleType, NArrayReal, NArrayInt, Allocator>;
using ParticleTileType = std::conditional_t<
is_rtsoa_pc,
ParticleTileRT<typename ParticleType::RealType, typename ParticleType::IntType>,
ParticleTile<ParticleType, NArrayReal, NArrayInt, Allocator>
>;
using ParticleInitData = ParticleInitType<NStructReal, NStructInt, NArrayReal, NArrayInt>;

//! A single level worth of particles is indexed (grid id, tile id)
Expand Down Expand Up @@ -1461,11 +1468,13 @@ protected:
int lev_min = 0, int lev_max = -1, int local_grid=-1) const;

public:
using FlagsVector = PODVector<int, Allocator<int>>;

void
WriteParticles (int level, std::ofstream& ofs, int fnum,
Vector<int>& which, Vector<int>& count, Vector<Long>& where,
const Vector<int>& write_real_comp, const Vector<int>& write_int_comp,
const Vector<std::map<std::pair<int, int>,IntVector>>& particle_io_flags, bool is_checkpoint) const;
const Vector<std::map<std::pair<int, int>,FlagsVector>>& particle_io_flags, bool is_checkpoint) const;
#ifdef AMREX_USE_HDF5
#include "AMReX_ParticlesHDF5.H"
#endif
Expand Down Expand Up @@ -1555,6 +1564,9 @@ using ParticleContainer = ParticleContainer_impl<Particle<T_NStructReal, T_NStru
template <int T_NArrayReal, int T_NArrayInt, template<class> class Allocator=DefaultAllocator, class CellAssignor=DefaultAssignor>
using ParticleContainerPureSoA = ParticleContainer_impl<SoAParticle<T_NArrayReal, T_NArrayInt>, T_NArrayReal, T_NArrayInt, Allocator, CellAssignor>;

template <class RType=ParticleReal, class IType=int, class CellAssignor=DefaultAssignor>
using ParticleContainerRTSoA = ParticleContainer_impl<RTSoAParticle<RType, IType>, 0, 0, PolymorphicArenaAllocator, CellAssignor>;

}

#include "AMReX_ParticleInit.H"
Expand Down
Loading
Loading