ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_SuperDropletPCProcess.H
Go to the documentation of this file.
1 /*! \file ERF_SuperDropletPCProcess.H
2  * \brief Common data structures for SuperDroplet physical processes
3  *
4  * This file provides shared infrastructure for physical process implementations:
5  * 1. ParticlePointers - Bundle of particle attribute pointers for GPU kernels
6  * 2. ProcessContext - Non-pointer data (geometry, species info) shared across processes
7  */
8 
9 #ifndef ERF_SUPERDROPLET_PC_PROCESS_H_
10 #define ERF_SUPERDROPLET_PC_PROCESS_H_
11 
12 #ifdef ERF_USE_PARTICLES
13 
15 #include <AMReX_GpuContainers.H>
16 #include <AMReX_Particles.H>
17 
18 namespace SDProcess {
19 
20 using namespace amrex;
21 using namespace SDPCDefn;
22 
23 /*! \brief Bundle of all particle attribute pointers
24  *
25  * This struct holds pointers to particle data for use in GPU kernels.
26  * All pointers are populated by setupParticlePointers(); processes use
27  * only the pointers they need.
28  */
29 struct ParticlePointers {
30  // Number of particles in this tile
31  int num_particles{0};
32 
33  // Core SOA pointers
34  ParticleReal* mass_ptr{nullptr};
35  ParticleReal* radius_ptr{nullptr};
36  int* active_ptr{nullptr};
37 
38  // Velocity components
39  GpuArray<ParticleReal*, AMREX_SPACEDIM> v_ptr{nullptr, nullptr, nullptr};
40  ParticleReal* vterm_ptr{nullptr};
41  ParticleReal* mult_ptr{nullptr};
42 
43  // Species and aerosol mass arrays
44  SDSpeciesMassArr sp_mass_ptrs{};
45  SDAerosolMassArr ae_mass_ptrs{};
46 
47  // Material properties (read-only)
48  const ParticleReal* sp_rho_arr{nullptr};
49  const int* sp_sol_arr{nullptr};
50  const ParticleReal* sp_ion_arr{nullptr};
51  const ParticleReal* sp_mw_arr{nullptr};
52 
53  const ParticleReal* ae_rho_arr{nullptr};
54  const int* ae_sol_arr{nullptr};
55  const ParticleReal* ae_ion_arr{nullptr};
56  const ParticleReal* ae_mw_arr{nullptr};
57 };
58 
59 /*! \brief Context data that doesn't change per-tile */
60 struct ProcessContext {
61  // Geometry
62  GpuArray<Real, AMREX_SPACEDIM> plo;
63  GpuArray<Real, AMREX_SPACEDIM> phi;
64  GpuArray<Real, AMREX_SPACEDIM> dxi;
65  GpuArray<Real, AMREX_SPACEDIM> dx;
66  GpuArray<int, AMREX_SPACEDIM> is_periodic;
67  Box domain;
68  Real cell_volume{0.0};
69 
70  // Species/aerosol counts and indices
71  int num_species{0};
72  int num_aerosols{0};
73  int idx_water{-1};
74 
75  // Material densities (commonly used)
76  ParticleReal rho_water{0.0};
77 };
78 
79 } // namespace SDProcess
80 
81 #endif // ERF_USE_PARTICLES
82 #endif // ERF_SUPERDROPLET_PC_PROCESS_H_
const Real dx
Definition: ERF_InitCustomPert_ABL.H:23
amrex::Real Real
Definition: ERF_ShocInterface.H:19
Definition: ERF_ConsoleIO.cpp:12