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