diff --git a/src/CICParticles.hpp b/src/CICParticles.hpp index a2523629e..6e4eaa500 100644 --- a/src/CICParticles.hpp +++ b/src/CICParticles.hpp @@ -19,14 +19,11 @@ namespace quokka { -constexpr int CICParticleReals = 4; // mass vx vy vz -constexpr int CICParticleInts = 0; - enum ParticleDataIdx { ParticleMassIdx = 0, ParticleVxIdx, ParticleVyIdx, ParticleVzIdx }; +constexpr int CICParticleRealComps = 4; // mass vx vy vz -// TODO(bwibking): switch to using struct-of-arrays (SOA) particles -using CICParticleContainer = amrex::AmrParticleContainer; -using CICParticleIterator = amrex::ParIter; +using CICParticleContainer = amrex::AmrParticleContainer; +using CICParticleIterator = amrex::ParIter; struct CICDeposition { amrex::Real Gconst{}; diff --git a/src/SphericalCollapse/spherical_collapse.cpp b/src/SphericalCollapse/spherical_collapse.cpp index 36b1b5094..904d70f7b 100644 --- a/src/SphericalCollapse/spherical_collapse.cpp +++ b/src/SphericalCollapse/spherical_collapse.cpp @@ -93,7 +93,7 @@ template <> void RadhydroSimulation::createInitialParticles() int num_particles = 1000; double particle_mass = 0.5 / static_cast(num_particles); - quokka::CICParticleContainer::ParticleInitData pdata = {{particle_mass}, {0}, {0}, {0}}; // mass vx vy vz + quokka::CICParticleContainer::ParticleInitData pdata = {{particle_mass, 0, 0, 0}, {}, {}, {}}; // {mass vx vy vz}, empty, empty, empty CICParticles->InitRandom(num_particles, iseed, pdata, generate_on_root_rank); } @@ -122,11 +122,9 @@ template <> void RadhydroSimulation::ComputeDerivedVar(int lev, // compute derived variables and save in 'mf' if (dname == "gpot") { const int ncomp = ncomp_cc_in; - auto const &state = state_new_cc_[lev].const_arrays(); - auto const &phi_data_ref = phi[lev].const_arrays(); + auto const &phi_arr = phi[lev].const_arrays(); auto output = mf.arrays(); - - amrex::ParallelFor(mf, [=] AMREX_GPU_DEVICE(int bx, int i, int j, int k) noexcept { output[bx](i, j, k, ncomp) = phi_data_ref[bx](i, j, k); }); + amrex::ParallelFor(mf, [=] AMREX_GPU_DEVICE(int bx, int i, int j, int k) noexcept { output[bx](i, j, k, ncomp) = phi_arr[bx](i, j, k); }); } }