1#ifdef REMORA_USE_PARTICLES
4#include <AMReX_ParmParse.H>
8void REMORAPC::readInputs ()
51void REMORAPC::InitializeParticles (
const std::unique_ptr<MultiFab>&
a_height_ptr)
59 <<
" is not a valid initialization for "
60 <<
m_name <<
" particle species.\n";
61 Error(
"See error message!");
68void REMORAPC::initializeParticlesUniformDistributionInBox (
const std::unique_ptr<MultiFab>&
a_height_ptr,
71 BL_PROFILE(
"REMORAPC::initializeParticlesUniformDistributionInBox");
74 const auto dx =
Geom(
lev).CellSizeArray();
84#pragma omp parallel if (Gpu::notInLaunchRegion())
93 Real
x =
plo[0] + (
i + Real(0.5))*
dx[0];
94 Real
y =
plo[1] + (
j + Real(0.5))*
dx[1];
107 Real
x =
plo[0] + (
i + Real(0.5))*
dx[0];
108 Real
y =
plo[1] + (
j + Real(0.5))*
dx[1];
109 Real
z =
plo[2] + (
k + Real(0.5))*
dx[2];
129#pragma omp parallel if (Gpu::notInLaunchRegion())
144 const int np = Scan::PrefixSum<int>(
static_cast<int>(
tile_box.numPts()),
151 Scan::Type::exclusive,
160 if (
np == 0) {
continue; }
164 auto*
vx_ptr =
soa.GetRealData(REMORAParticlesRealIdxSoA::vx).data();
165 auto*
vy_ptr =
soa.GetRealData(REMORAParticlesRealIdxSoA::vy).data();
166 auto*
vz_ptr =
soa.GetRealData(REMORAParticlesRealIdxSoA::vz).data();
167 auto*
mass_ptr =
soa.GetRealData(REMORAParticlesRealIdxSoA::mass).data();
169 auto my_proc = ParallelDescriptor::MyProc();
172#pragma omp critical (remora_particle_nextid)
175 pid = ParticleType::NextID();
176 ParticleType::NextID(
pid+
np);
179 "Error: overflow on particle id numbers!" );
196 Real
sx[] = {
one -
r[0],
r[0]};
197 Real
sy[] = {
one -
r[1],
r[1]};
200 for (
int ii = 0;
ii < 2; ++
ii) {
201 for (
int jj = 0;
jj < 2; ++
jj) {
206 for (
int ii = 0;
ii < 2; ++
ii) {
207 for (
int jj = 0;
jj < 2; ++
jj) {
218 p.pos(0) =
x;
p.pos(1) =
y;
p.pos(2) =
z;
220 p.idata(REMORAParticlesIntIdxAoS::k) =
k;
236 Real
r[3] = {Real(0.3), Real(0.7), Real(0.25)};
242 Real
sx[] = {
one -
r[0],
r[0]};
243 Real
sy[] = {
one -
r[1],
r[1]};
246 for (
int ii = 0;
ii < 2; ++
ii) {
247 for (
int jj = 0;
jj < 2; ++
jj) {
252 for (
int ii = 0;
ii < 2; ++
ii) {
253 for (
int jj = 0;
jj < 2; ++
jj) {
264 p.pos(0) =
x;
p.pos(1) =
y;
p.pos(2) =
z;
266 p.idata(REMORAParticlesIntIdxAoS::k) =
k;
292 p.pos(0) =
x;
p.pos(1) =
y;
p.pos(2) =
z;
294 p.idata(REMORAParticlesIntIdxAoS::k) =
k;
308 Real
r[3] = {Real(0.3), Real(0.7), Real(0.25)};
319 p.pos(0) =
x;
p.pos(1) =
y;
p.pos(2) =
z;
321 p.idata(REMORAParticlesIntIdxAoS::k) =
k;
constexpr amrex::Real one
constexpr amrex::Real zero
mf_h setVal(geomdata.ProbHi(2))
integer, dimension(ngrids) n