REMORA
Energy Research and Forecasting: An Atmospheric Modeling Code
TracerPC.H
Go to the documentation of this file.
1 #ifndef TRACER_PC_H_
2 #define TRACER_PC_H_
3 
4 #include <AMReX_Particles.H>
5 
7 {
8  enum {
9  old_x = 0,
12  ncomps
13  };
14 };
15 
17 {
18  enum {
19  k = 0,
20  ncomps
21  };
22 };
23 
25 {
26  template <typename P>
27  AMREX_GPU_HOST_DEVICE
28  amrex::IntVect operator() (P const& p,
29  amrex::GpuArray<amrex::Real,AMREX_SPACEDIM> const& plo,
30  amrex::GpuArray<amrex::Real,AMREX_SPACEDIM> const& dxi,
31  const amrex::Box& domain) const noexcept
32  {
33  amrex::IntVect iv(
34  AMREX_D_DECL(int(amrex::Math::floor((p.pos(0)-plo[0])*dxi[0])),
35  int(amrex::Math::floor((p.pos(1)-plo[1])*dxi[1])),
36  p.idata(0)));
37  iv[0] += domain.smallEnd()[0];
38  iv[1] += domain.smallEnd()[1];
39  return iv;
40  }
41 };
42 
43 class TracerPC
44  : public amrex::ParticleContainer<TracerRealIdx::ncomps, TracerIntIdx::ncomps, 0, 0,
45  amrex::DefaultAllocator, TracerAssignor>
46 {
47 
48 public:
49 
50  TracerPC (amrex::ParGDBBase* gdb)
51  : amrex::ParticleContainer<TracerRealIdx::ncomps, TracerIntIdx::ncomps, 0, 0,
52  amrex::DefaultAllocator, TracerAssignor>(gdb)
53  {}
54 
55  TracerPC (const amrex::Geometry & geom,
56  const amrex::DistributionMapping & dmap,
57  const amrex::BoxArray & ba)
58  : amrex::ParticleContainer<TracerRealIdx::ncomps, TracerIntIdx::ncomps, 0, 0,
59  amrex::DefaultAllocator, TracerAssignor>(geom, dmap, ba)
60  {}
61 
62  void InitParticles (const amrex::MultiFab& a_z_height);
63 
64  void AdvectWithUmac (amrex::Array<amrex::MultiFab const*, AMREX_SPACEDIM> umac,
65  int level, amrex::Real dt, bool use_terrain,
66  amrex::MultiFab& a_z_height);
67 };
68 
69 #endif
Definition: TracerPC.H:46
void AdvectWithUmac(amrex::Array< amrex::MultiFab const *, AMREX_SPACEDIM > umac, int level, amrex::Real dt, bool use_terrain, amrex::MultiFab &a_z_height)
Definition: TracerPC.cpp:78
void InitParticles(const amrex::MultiFab &a_z_height)
Definition: TracerPC.cpp:9
TracerPC(const amrex::Geometry &geom, const amrex::DistributionMapping &dmap, const amrex::BoxArray &ba)
Definition: TracerPC.H:55
TracerPC(amrex::ParGDBBase *gdb)
Definition: TracerPC.H:50
Definition: TracerPC.H:25
AMREX_GPU_HOST_DEVICE amrex::IntVect operator()(P const &p, amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > const &plo, amrex::GpuArray< amrex::Real, AMREX_SPACEDIM > const &dxi, const amrex::Box &domain) const noexcept
Definition: TracerPC.H:28
Definition: TracerPC.H:17
@ k
Definition: TracerPC.H:19
@ ncomps
Definition: TracerPC.H:20
Definition: TracerPC.H:7
@ old_z
Definition: TracerPC.H:11
@ old_x
Definition: TracerPC.H:9
@ ncomps
Definition: TracerPC.H:12
@ old_y
Definition: TracerPC.H:10