Block-Structured AMR Software Framework
AMReX_EB_Redistribution.H
Go to the documentation of this file.
1 #ifndef AMREX_EB_REDIST_H_
2 #define AMREX_EB_REDIST_H_
3 #include <AMReX_Config.H>
4 
5 #include <AMReX.H>
6 #include <AMReX_BCRec.H>
7 #include <AMReX_MultiFab.H>
8 #include <AMReX_MultiFabUtil.H>
9 #include <AMReX_MultiCutFab.H>
10 #include <AMReX_EB2.H>
11 
12 namespace amrex {
13 
14 #ifdef AMREX_USE_FLOAT
15  static constexpr amrex::Real eb_covered_val = amrex::Real(1.e20);
16 #else
17  static constexpr amrex::Real eb_covered_val = amrex::Real(1.e40);
18 #endif
19 
21  int div_comp, int ncomp, const amrex::Geometry& geom);
22 
24  const amrex::MultiFab& weights,
25  int div_comp, int ncomp, const amrex::Geometry& geom,
26  bool use_wts_in_divnc);
27 
28  // Flux redistribution scheme for case where C/F interface does *not* cross EB
30  amrex::Array4<amrex::Real > const& div,
33  int icomp, int ncomp,
36  const amrex::Geometry & geom,
37  bool use_wts_in_divnc);
38 
39  // Flux redistribution scheme for case where C/F interface crosses EB
41  amrex::Array4<amrex::Real > const& dqdt,
46  int as_crse,
47  amrex::Array4<amrex::Real > const& rr_drho_crse,
48  amrex::Array4<int const> const& rr_flag_crse,
49  int as_fine,
50  amrex::Array4<amrex::Real > const& dm_as_fine,
51  amrex::Array4<int const> const& levmsk,
52  const amrex::Geometry & geom,
53  bool use_wts_in_divnc,
54  int level_mask_not_covered,
55  int icomp, int ncomp, amrex::Real dt);
56 
57  // Interface to redistribution schemes that only calls single-level routines
58  void ApplyRedistribution ( amrex::Box const& bx, int ncomp,
59  amrex::Array4<amrex::Real> const& dUdt_out,
60  amrex::Array4<amrex::Real> const& dUdt_in,
62  amrex::Array4<amrex::Real> const& scratch,
72  amrex::BCRec const* d_bcrec_ptr,
73  amrex::Geometry const& lev_geom,
74  amrex::Real dt, std::string const& redistribution_type,
75  bool use_wts_in_divnc = false,
76  int srd_max_order = 2,
77  amrex::Real target_volfrac = 0.5_rt,
78  amrex::Array4<amrex::Real const> const& update_scale={});
79 
80  // Interface to redistribution schemes that calls multi-level routines
82  amrex::Box const& bx, int ncomp,
83  amrex::Array4<amrex::Real > const& dUdt_out,
84  amrex::Array4<amrex::Real > const& dUdt_in,
86  amrex::Array4<amrex::Real > const& scratch,
96  amrex::BCRec const* d_bcrec_ptr,
97  amrex::Geometry const& lev_geom, amrex::Real dt,
98  std::string const& redistribution_type,
99  int as_crse,
100  amrex::Array4<amrex::Real > const& rr_drho_crse,
101  amrex::Array4<int const> const& rr_flag_crse,
102  int as_fine,
103  amrex::Array4<amrex::Real > const& dm_as_fine,
104  amrex::Array4<int const> const& levmsk,
105  int level_mask_not_covered,
106  amrex::Real fac_for_deltaR = 1.0_rt,
107  bool use_wts_in_divnc = false,
108  int icomp = 0,
109  int srd_max_order = 2,
110  amrex::Real target_volfrac = 0.5_rt,
111  amrex::Array4<amrex::Real const> const& update_scale={});
112 
114  amrex::Box const& bx, int ncomp,
115  amrex::Array4<amrex::Real > const& U_out,
116  amrex::Array4<amrex::Real > const& U_in,
126  amrex::BCRec const* d_bcrec_ptr,
127  amrex::Geometry const& geom, std::string const& redistribution_type,
128  int srd_max_order = 2,
129  amrex::Real target_volfrac = 0.5_rt);
130 
131  void StateRedistribute ( amrex::Box const& bx, int ncomp,
132  amrex::Array4<amrex::Real> const& U_out,
133  amrex::Array4<amrex::Real> const& U_in,
140  amrex::BCRec const* d_bcrec_ptr,
141  amrex::Array4<int const> const& itracker,
144  amrex::Array4<amrex::Real const> const& nbhd_vol,
145  amrex::Array4<amrex::Real const> const& cent_hat,
146  amrex::Geometry const& geom,
147  int max_order = 2);
148 
149  void MLStateRedistribute ( amrex::Box const& bx, int ncomp,
150  amrex::Array4<amrex::Real> const& U_out,
151  amrex::Array4<amrex::Real> const& U_in,
158  amrex::BCRec const* d_bcrec_ptr,
159  amrex::Array4<int const> const& itracker,
162  amrex::Array4<amrex::Real const> const& nbhd_vol,
163  amrex::Array4<amrex::Real const> const& cent_hat,
164  amrex::Geometry const& geom,
165  int as_crse,
166  Array4<Real > const& drho_as_crse,
167  Array4<int const> const& flag_as_crse,
168  int as_fine,
169  Array4<Real > const& dm_as_fine,
170  Array4<int const> const& levmsk,
171  int is_ghost_cell,
172  amrex::Real fac_for_deltaR,
173  int max_order = 2);
174 
175  void MakeITracker ( amrex::Box const& bx,
180  amrex::Array4<int> const& itracker,
181  amrex::Geometry const& geom,
182  amrex::Real target_volfrac);
183 
188  amrex::Array4< int const> const& itracker,
189  amrex::Array4<amrex::Real> const& nrs,
190  amrex::Array4<amrex::Real> const& alpha,
191  amrex::Array4<amrex::Real> const& nbhd_vol,
192  amrex::Array4<amrex::Real> const& cent_hat,
193  amrex::Geometry const& geom,
194  amrex::Real target_volfrac);
195 
196 }
197 
198 #endif
#define AMREX_D_DECL(a, b, c)
Definition: AMReX_SPACE.H:104
Boundary Condition Records. Necessary information and functions for computing boundary conditions.
Definition: AMReX_BCRec.H:17
Rectangular problem domain geometry.
Definition: AMReX_Geometry.H:73
A collection (stored as an array) of FArrayBox objects.
Definition: AMReX_MultiFab.H:38
Definition: AMReX_Amr.cpp:49
void single_level_redistribute(amrex::MultiFab &div_tmp_in, amrex::MultiFab &div_out, int div_comp, int ncomp, const amrex::Geometry &geom)
void MakeStateRedistUtils(amrex::Box const &bx, amrex::Array4< amrex::EBCellFlag const > const &flag, amrex::Array4< amrex::Real const > const &vfrac, amrex::Array4< amrex::Real const > const &ccent, amrex::Array4< int const > const &itracker, amrex::Array4< amrex::Real > const &nrs, amrex::Array4< amrex::Real > const &alpha, amrex::Array4< amrex::Real > const &nbhd_vol, amrex::Array4< amrex::Real > const &cent_hat, amrex::Geometry const &geom, amrex::Real target_volfrac)
void amrex_flux_redistribute(const amrex::Box &bx, amrex::Array4< amrex::Real > const &dqdt, amrex::Array4< amrex::Real const > const &divc, amrex::Array4< amrex::Real const > const &wt, amrex::Array4< amrex::Real const > const &vfrac, amrex::Array4< amrex::EBCellFlag const > const &flag, int as_crse, amrex::Array4< amrex::Real > const &rr_drho_crse, amrex::Array4< int const > const &rr_flag_crse, int as_fine, amrex::Array4< amrex::Real > const &dm_as_fine, amrex::Array4< int const > const &levmsk, const amrex::Geometry &geom, bool use_wts_in_divnc, int level_mask_not_covered, int icomp, int ncomp, amrex::Real dt)
void MLStateRedistribute(amrex::Box const &bx, int ncomp, amrex::Array4< amrex::Real > const &U_out, amrex::Array4< amrex::Real > const &U_in, amrex::Array4< amrex::EBCellFlag const > const &flag, amrex::Array4< amrex::Real const > const &vfrac, AMREX_D_DECL(amrex::Array4< amrex::Real const > const &fcx, amrex::Array4< amrex::Real const > const &fcy, amrex::Array4< amrex::Real const > const &fcz), amrex::Array4< amrex::Real const > const &ccent, amrex::BCRec const *d_bcrec_ptr, amrex::Array4< int const > const &itracker, amrex::Array4< amrex::Real const > const &nrs, amrex::Array4< amrex::Real const > const &alpha, amrex::Array4< amrex::Real const > const &nbhd_vol, amrex::Array4< amrex::Real const > const &cent_hat, amrex::Geometry const &geom, int as_crse, Array4< Real > const &drho_as_crse, Array4< int const > const &flag_as_crse, int as_fine, Array4< Real > const &dm_as_fine, Array4< int const > const &levmsk, int is_ghost_cell, amrex::Real fac_for_deltaR, int max_order=2)
void ApplyMLRedistribution(amrex::Box const &bx, int ncomp, amrex::Array4< amrex::Real > const &dUdt_out, amrex::Array4< amrex::Real > const &dUdt_in, amrex::Array4< amrex::Real const > const &U_in, amrex::Array4< amrex::Real > const &scratch, amrex::Array4< amrex::EBCellFlag const > const &flag, AMREX_D_DECL(amrex::Array4< amrex::Real const > const &apx, amrex::Array4< amrex::Real const > const &apy, amrex::Array4< amrex::Real const > const &apz), amrex::Array4< amrex::Real const > const &vfrac, AMREX_D_DECL(amrex::Array4< amrex::Real const > const &fcx, amrex::Array4< amrex::Real const > const &fcy, amrex::Array4< amrex::Real const > const &fcz), amrex::Array4< amrex::Real const > const &ccc, amrex::BCRec const *d_bcrec_ptr, amrex::Geometry const &lev_geom, amrex::Real dt, std::string const &redistribution_type, int as_crse, amrex::Array4< amrex::Real > const &rr_drho_crse, amrex::Array4< int const > const &rr_flag_crse, int as_fine, amrex::Array4< amrex::Real > const &dm_as_fine, amrex::Array4< int const > const &levmsk, int level_mask_not_covered, amrex::Real fac_for_deltaR=1.0_rt, bool use_wts_in_divnc=false, int icomp=0, int srd_max_order=2, amrex::Real target_volfrac=0.5_rt, amrex::Array4< amrex::Real const > const &update_scale={})
void MakeITracker(amrex::Box const &bx, AMREX_D_DECL(amrex::Array4< amrex::Real const > const &apx, amrex::Array4< amrex::Real const > const &apy, amrex::Array4< amrex::Real const > const &apz), amrex::Array4< amrex::Real const > const &vfrac, amrex::Array4< int > const &itracker, amrex::Geometry const &geom, amrex::Real target_volfrac)
void StateRedistribute(amrex::Box const &bx, int ncomp, amrex::Array4< amrex::Real > const &U_out, amrex::Array4< amrex::Real > const &U_in, amrex::Array4< amrex::EBCellFlag const > const &flag, amrex::Array4< amrex::Real const > const &vfrac, AMREX_D_DECL(amrex::Array4< amrex::Real const > const &fcx, amrex::Array4< amrex::Real const > const &fcy, amrex::Array4< amrex::Real const > const &fcz), amrex::Array4< amrex::Real const > const &ccent, amrex::BCRec const *d_bcrec_ptr, amrex::Array4< int const > const &itracker, amrex::Array4< amrex::Real const > const &nrs, amrex::Array4< amrex::Real const > const &alpha, amrex::Array4< amrex::Real const > const &nbhd_vol, amrex::Array4< amrex::Real const > const &cent_hat, amrex::Geometry const &geom, int max_order=2)
static constexpr amrex::Real eb_covered_val
Definition: AMReX_EB_Redistribution.H:17
void single_level_weighted_redistribute(amrex::MultiFab &div_tmp_in, amrex::MultiFab &div_out, const amrex::MultiFab &weights, int div_comp, int ncomp, const amrex::Geometry &geom, bool use_wts_in_divnc)
void ApplyRedistribution(amrex::Box const &bx, int ncomp, amrex::Array4< amrex::Real > const &dUdt_out, amrex::Array4< amrex::Real > const &dUdt_in, amrex::Array4< amrex::Real const > const &U_in, amrex::Array4< amrex::Real > const &scratch, amrex::Array4< amrex::EBCellFlag const > const &flag, AMREX_D_DECL(amrex::Array4< amrex::Real const > const &apx, amrex::Array4< amrex::Real const > const &apy, amrex::Array4< amrex::Real const > const &apz), amrex::Array4< amrex::Real const > const &vfrac, AMREX_D_DECL(amrex::Array4< amrex::Real const > const &fcx, amrex::Array4< amrex::Real const > const &fcy, amrex::Array4< amrex::Real const > const &fcz), amrex::Array4< amrex::Real const > const &ccc, amrex::BCRec const *d_bcrec_ptr, amrex::Geometry const &lev_geom, amrex::Real dt, std::string const &redistribution_type, bool use_wts_in_divnc=false, int srd_max_order=2, amrex::Real target_volfrac=0.5_rt, amrex::Array4< amrex::Real const > const &update_scale={})
void ApplyInitialRedistribution(amrex::Box const &bx, int ncomp, amrex::Array4< amrex::Real > const &U_out, amrex::Array4< amrex::Real > const &U_in, amrex::Array4< amrex::EBCellFlag const > const &flag, AMREX_D_DECL(amrex::Array4< amrex::Real const > const &apx, amrex::Array4< amrex::Real const > const &apy, amrex::Array4< amrex::Real const > const &apz), amrex::Array4< amrex::Real const > const &vfrac, AMREX_D_DECL(amrex::Array4< amrex::Real const > const &fcx, amrex::Array4< amrex::Real const > const &fcy, amrex::Array4< amrex::Real const > const &fcz), amrex::Array4< amrex::Real const > const &ccc, amrex::BCRec const *d_bcrec_ptr, amrex::Geometry const &geom, std::string const &redistribution_type, int srd_max_order=2, amrex::Real target_volfrac=0.5_rt)
void apply_flux_redistribution(const amrex::Box &bx, amrex::Array4< amrex::Real > const &div, amrex::Array4< amrex::Real const > const &divc, amrex::Array4< amrex::Real const > const &wt, int icomp, int ncomp, amrex::Array4< amrex::EBCellFlag const > const &flag_arr, amrex::Array4< amrex::Real const > const &vfrac, const amrex::Geometry &geom, bool use_wts_in_divnc)
Definition: AMReX_Array4.H:61