ERF
Energy Research and Forecasting: An Atmospheric Modeling Code
ERF_TI_fast_headers.H
Go to the documentation of this file.
1 #ifndef ERF_FAST_INTEGRATION_H_
2 #define ERF_FAST_INTEGRATION_H_
3 
4 #include <AMReX_MultiFab.H>
5 #include <AMReX_BCRec.H>
6 #include <AMReX_YAFluxRegister.H>
7 #include "ERF_DataStruct.H"
8 #include "ERF_IndexDefines.H"
9 #include <ERF_TerrainMetrics.H>
10 
11 #include <ERF_TileNoZ.H>
12 #include <ERF_ProbCommon.H>
13 
14 #ifdef ERF_USE_EB
15 #include <AMReX_EBMultiFabUtil.H>
16 #endif
17 
18 /**
19  * Function for computing the fast RHS with no terrain
20  *
21  */
22 void erf_fast_rhs_N (int step, int nrk, int level, int finest_level,
23  amrex::Vector<amrex::MultiFab >& S_slow_rhs,
24  const amrex::Vector<amrex::MultiFab >& S_prev,
25  amrex::Vector<amrex::MultiFab >& S_stage_data,
26  const amrex::MultiFab& S_stage_prim,
27  const amrex::MultiFab& pi_stage,
28  const amrex::MultiFab& fast_coeffs,
29  amrex::Vector<amrex::MultiFab >& S_data,
30  amrex::Vector<amrex::MultiFab >& S_scratch,
31  const amrex::Geometry geom,
32  const amrex::Real gravity,
33  const amrex::Real dtau, const amrex::Real beta_s,
34  const amrex::Real facinv,
35  std::unique_ptr<amrex::MultiFab>& mapfac_m,
36  std::unique_ptr<amrex::MultiFab>& mapfac_u,
37  std::unique_ptr<amrex::MultiFab>& mapfac_v,
38  amrex::YAFluxRegister* fr_as_crse,
39  amrex::YAFluxRegister* fr_as_fine,
40  bool l_use_moisture, bool l_reflux,
41  bool l_implicit_substepping);
42 
43 /**
44  * Function for computing the fast RHS with fixed terrain
45  *
46  */
47 void erf_fast_rhs_T (int step, int nrk, int level, int finest_level,
48  amrex::Vector<amrex::MultiFab >& S_slow_rhs,
49  const amrex::Vector<amrex::MultiFab >& S_prev,
50  amrex::Vector<amrex::MultiFab >& S_stage_data,
51  const amrex::MultiFab& S_stage_prim,
52  const amrex::MultiFab& pi_stage,
53  const amrex::MultiFab& fast_coeffs,
54  amrex::Vector<amrex::MultiFab >& S_data,
55  amrex::Vector<amrex::MultiFab >& S_scratch,
56  const amrex::Geometry geom,
57  const amrex::Real gravity,
58  std::unique_ptr<amrex::MultiFab>& z_phys_nd,
59  std::unique_ptr<amrex::MultiFab>& detJ_cc,
60  const amrex::Real dtau, const amrex::Real beta_s,
61  const amrex::Real facinv,
62  std::unique_ptr<amrex::MultiFab>& mapfac_m,
63  std::unique_ptr<amrex::MultiFab>& mapfac_u,
64  std::unique_ptr<amrex::MultiFab>& mapfac_v,
65  amrex::YAFluxRegister* fr_as_crse,
66  amrex::YAFluxRegister* fr_as_fine,
67  bool l_use_moisture, bool l_reflux,
68  bool l_implicit_substepping);
69 
70 /**
71  * Function for computing the fast RHS with moving terrain
72  *
73  */
74 void erf_fast_rhs_MT (int step, int nrk, int level, int finest_level,
75  amrex::Vector<amrex::MultiFab >& S_slow_rhs,
76  const amrex::Vector<amrex::MultiFab >& S_prev,
77  amrex::Vector<amrex::MultiFab >& S_stg_data,
78  const amrex::MultiFab& S_stg_prim,
79  const amrex::MultiFab& pi_stage,
80  const amrex::MultiFab& fast_coeffs,
81  amrex::Vector<amrex::MultiFab >& S_data,
82  amrex::Vector<amrex::MultiFab >& S_scratch,
83  const amrex::Geometry geom,
84  const amrex::Real gravity,
85  const bool use_lagged_delta_rt,
86  std::unique_ptr<amrex::MultiFab>& z_t_rk,
87  const amrex::MultiFab* z_t_pert,
88  std::unique_ptr<amrex::MultiFab>& z_phys_nd_old,
89  std::unique_ptr<amrex::MultiFab>& z_phys_nd_new,
90  std::unique_ptr<amrex::MultiFab>& z_phys_nd_stg,
91  std::unique_ptr<amrex::MultiFab>& detJ_cc_old,
92  std::unique_ptr<amrex::MultiFab>& detJ_cc_new,
93  std::unique_ptr<amrex::MultiFab>& detJ_cc_stg,
94  const amrex::Real dtau, const amrex::Real beta_s,
95  const amrex::Real facinv,
96  std::unique_ptr<amrex::MultiFab>& mapfac_m,
97  std::unique_ptr<amrex::MultiFab>& mapfac_u,
98  std::unique_ptr<amrex::MultiFab>& mapfac_v,
99  amrex::YAFluxRegister* fr_as_crse,
100  amrex::YAFluxRegister* fr_as_fine,
101  bool l_use_moisture, bool l_reflux,
102  bool l_implicit_substepping);
103 
104 /**
105  * Function for computing the coefficients for the tridiagonal solver used in the fast
106  * integrator (the acoustic substepping).
107  */
108 void make_fast_coeffs (int level,
109  amrex::MultiFab& fast_coeffs,
110  amrex::Vector<amrex::MultiFab >& S_stage_data,
111  const amrex::MultiFab& S_stage_prim,
112  const amrex::MultiFab& pi_stage,
113  const amrex::Geometry geom,
114  const bool use_moisture,
115  const MeshType mesh_type,
116  const amrex::Real gravity,
117  const amrex::Real c_p,
118  std::unique_ptr<amrex::MultiFab>& detJ_cc,
119  const amrex::MultiFab* r0,
120  const amrex::MultiFab* pi0,
121  const amrex::Real dtau,
122  const amrex::Real beta_s,
123  amrex::GpuArray<ERF_BC, AMREX_SPACEDIM*2> &phys_bc_type);
124 
125 #endif
void erf_fast_rhs_N(int step, int nrk, int level, int finest_level, amrex::Vector< amrex::MultiFab > &S_slow_rhs, const amrex::Vector< amrex::MultiFab > &S_prev, amrex::Vector< amrex::MultiFab > &S_stage_data, const amrex::MultiFab &S_stage_prim, const amrex::MultiFab &pi_stage, const amrex::MultiFab &fast_coeffs, amrex::Vector< amrex::MultiFab > &S_data, amrex::Vector< amrex::MultiFab > &S_scratch, const amrex::Geometry geom, const amrex::Real gravity, const amrex::Real dtau, const amrex::Real beta_s, const amrex::Real facinv, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux, bool l_implicit_substepping)
void make_fast_coeffs(int level, amrex::MultiFab &fast_coeffs, amrex::Vector< amrex::MultiFab > &S_stage_data, const amrex::MultiFab &S_stage_prim, const amrex::MultiFab &pi_stage, const amrex::Geometry geom, const bool use_moisture, const MeshType mesh_type, const amrex::Real gravity, const amrex::Real c_p, std::unique_ptr< amrex::MultiFab > &detJ_cc, const amrex::MultiFab *r0, const amrex::MultiFab *pi0, const amrex::Real dtau, const amrex::Real beta_s, amrex::GpuArray< ERF_BC, AMREX_SPACEDIM *2 > &phys_bc_type)
void erf_fast_rhs_T(int step, int nrk, int level, int finest_level, amrex::Vector< amrex::MultiFab > &S_slow_rhs, const amrex::Vector< amrex::MultiFab > &S_prev, amrex::Vector< amrex::MultiFab > &S_stage_data, const amrex::MultiFab &S_stage_prim, const amrex::MultiFab &pi_stage, const amrex::MultiFab &fast_coeffs, amrex::Vector< amrex::MultiFab > &S_data, amrex::Vector< amrex::MultiFab > &S_scratch, const amrex::Geometry geom, const amrex::Real gravity, std::unique_ptr< amrex::MultiFab > &z_phys_nd, std::unique_ptr< amrex::MultiFab > &detJ_cc, const amrex::Real dtau, const amrex::Real beta_s, const amrex::Real facinv, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux, bool l_implicit_substepping)
void erf_fast_rhs_MT(int step, int nrk, int level, int finest_level, amrex::Vector< amrex::MultiFab > &S_slow_rhs, const amrex::Vector< amrex::MultiFab > &S_prev, amrex::Vector< amrex::MultiFab > &S_stg_data, const amrex::MultiFab &S_stg_prim, const amrex::MultiFab &pi_stage, const amrex::MultiFab &fast_coeffs, amrex::Vector< amrex::MultiFab > &S_data, amrex::Vector< amrex::MultiFab > &S_scratch, const amrex::Geometry geom, const amrex::Real gravity, const bool use_lagged_delta_rt, std::unique_ptr< amrex::MultiFab > &z_t_rk, const amrex::MultiFab *z_t_pert, std::unique_ptr< amrex::MultiFab > &z_phys_nd_old, std::unique_ptr< amrex::MultiFab > &z_phys_nd_new, std::unique_ptr< amrex::MultiFab > &z_phys_nd_stg, std::unique_ptr< amrex::MultiFab > &detJ_cc_old, std::unique_ptr< amrex::MultiFab > &detJ_cc_new, std::unique_ptr< amrex::MultiFab > &detJ_cc_stg, const amrex::Real dtau, const amrex::Real beta_s, const amrex::Real facinv, std::unique_ptr< amrex::MultiFab > &mapfac_m, std::unique_ptr< amrex::MultiFab > &mapfac_u, std::unique_ptr< amrex::MultiFab > &mapfac_v, amrex::YAFluxRegister *fr_as_crse, amrex::YAFluxRegister *fr_as_fine, bool l_use_moisture, bool l_reflux, bool l_implicit_substepping)