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  // Ice properties
44  ParticleReal* Tfz_ptr{nullptr};
45  ParticleReal* a_ptr{nullptr}; // equatorial radius
46  ParticleReal* c_ptr{nullptr}; // polar radius
47  ParticleReal* mrime_ptr{nullptr};
48  ParticleReal* nmono_ptr{nullptr};
49 
50  // Species and aerosol mass arrays
51  SDSpeciesMassArr sp_mass_ptrs{};
52  SDAerosolMassArr ae_mass_ptrs{};
53 
54  // Material properties (read-only)
55  const ParticleReal* sp_rho_arr{nullptr};
56  const int* sp_sol_arr{nullptr};
57  const ParticleReal* sp_ion_arr{nullptr};
58  const ParticleReal* sp_mw_arr{nullptr};
59  const int* sp_INP_arr{nullptr};
60 
61  const ParticleReal* ae_rho_arr{nullptr};
62  const int* ae_sol_arr{nullptr};
63  const ParticleReal* ae_ion_arr{nullptr};
64  const ParticleReal* ae_mw_arr{nullptr};
65  const int* ae_INP_arr{nullptr};
66 };
67 
68 /*! \brief Context data that doesn't change per-tile */
69 struct ProcessContext {
70  // Geometry
71  GpuArray<Real, AMREX_SPACEDIM> plo;
72  GpuArray<Real, AMREX_SPACEDIM> phi;
73  GpuArray<Real, AMREX_SPACEDIM> dxi;
74  GpuArray<Real, AMREX_SPACEDIM> dx;
75  GpuArray<int, AMREX_SPACEDIM> is_periodic;
76  Box domain;
77  Real cell_volume{0.0};
78 
79  // Species/aerosol counts and indices
80  int num_species{0};
81  int num_aerosols{0};
82  int idx_water{-1};
83  int idx_ice{-1};
84 
85  // Material densities (commonly used)
86  ParticleReal rho_water{0.0};
87  ParticleReal rho_ice{0.0};
88 };
89 
90 } // namespace SDProcess
91 
92 #endif // ERF_USE_PARTICLES
93 #endif // ERF_SUPERDROPLET_PC_PROCESS_H_
const Real dx
Definition: ERF_InitCustomPert_ABL.H:44
amrex::Real Real
Definition: ERF_ShocInterface.H:19
Definition: ERF_ConsoleIO.cpp:15