1 #ifndef ERF_FILLPATCHER_H_
2 #define ERF_FILLPATCHER_H_
4 #include <AMReX_FillPatchUtil.H>
5 #include <AMReX_Interp_C.H>
6 #include <AMReX_MFInterp_C.H>
12 ERFFillPatcher (amrex::BoxArray
const& fba, amrex::DistributionMapping
const& fdm,
13 amrex::Geometry
const& fgeom,
14 amrex::BoxArray
const& cba, amrex::DistributionMapping
const& cdm,
15 amrex::Geometry
const& cgeom,
16 int nghost,
int nghost_set,
int ncomp, amrex::InterpBase* interp);
18 void Define (amrex::BoxArray
const& fba, amrex::DistributionMapping
const& fdm,
19 amrex::Geometry
const& fgeom,
20 amrex::BoxArray
const& cba, amrex::DistributionMapping
const& cdm,
21 amrex::Geometry
const& cgeom,
22 int nghost,
int nghost_set,
int ncomp,
23 amrex::InterpBase* interp);
25 void BuildMask (amrex::BoxArray
const& fba,
int nghost,
int nghost_set);
28 amrex::Vector<amrex::Real>
const& crse_time);
31 amrex::MultiFab
const& crse,
35 amrex::MultiFab
const& crse,
36 amrex::Vector<amrex::BCRec>
const& bcr,
45 template <
typename BC>
46 void FillSet (amrex::MultiFab& mf, amrex::Real time,
47 BC& cbc, amrex::Vector<amrex::BCRec>
const& bcs);
49 template <
typename BC>
50 void FillRelax (amrex::MultiFab& mf, amrex::Real time,
51 BC& cbc, amrex::Vector<amrex::BCRec>
const& bcs);
53 template <
typename BC>
54 void Fill (amrex::MultiFab& mf, amrex::Real time,
55 BC& cbc, amrex::Vector<amrex::BCRec>
const& bcs,
int mask_val);
61 amrex::DistributionMapping
m_fdm;
62 amrex::DistributionMapping
m_cdm;
87 template <
typename BC>
90 BC& cbc, amrex::Vector<amrex::BCRec>
const& bcs)
103 template <
typename BC>
106 BC& cbc, amrex::Vector<amrex::BCRec>
const& bcs)
120 template <
typename BC>
123 BC& cbc, amrex::Vector<amrex::BCRec>
const& bcs,
int mask_val)
125 constexpr amrex::Real eps = std::numeric_limits<float>::epsilon();
131 amrex::Real fac_old = 1.0 - fac_new;
142 amrex::MultiFab::LinComb(crse_data_time_interp,
145 0,
m_ncomp, amrex::IntVect{0});
148 amrex::IndexType m_ixt = mf.boxArray().ixType();
149 int ixt_sum = m_ixt[0]+m_ixt[1]+m_ixt[2];
151 InterpCell(mf,crse_data_time_interp,bcs,mask_val);
152 }
else if (ixt_sum == 1) {
153 InterpFace(mf,crse_data_time_interp,mask_val);
155 amrex::Abort(
"ERF_FillPatcher only supports face linear and cell cons linear interp!");
Definition: ERF_FillPatcher.H:9
void Fill(amrex::MultiFab &mf, amrex::Real time, BC &cbc, amrex::Vector< amrex::BCRec > const &bcs, int mask_val)
Definition: ERF_FillPatcher.H:122
amrex::Geometry m_fgeom
Definition: ERF_FillPatcher.H:63
amrex::BoxArray m_fba
Definition: ERF_FillPatcher.H:59
amrex::iMultiFab * GetMask()
Definition: ERF_FillPatcher.H:43
amrex::InterpBase * m_interp
Definition: ERF_FillPatcher.H:68
amrex::BoxArray m_cba
Definition: ERF_FillPatcher.H:60
void Define(amrex::BoxArray const &fba, amrex::DistributionMapping const &fdm, amrex::Geometry const &fgeom, amrex::BoxArray const &cba, amrex::DistributionMapping const &cdm, amrex::Geometry const &cgeom, int nghost, int nghost_set, int ncomp, amrex::InterpBase *interp)
Definition: ERF_FillPatcher.cpp:57
ERFFillPatcher(amrex::BoxArray const &fba, amrex::DistributionMapping const &fdm, amrex::Geometry const &fgeom, amrex::BoxArray const &cba, amrex::DistributionMapping const &cdm, amrex::Geometry const &cgeom, int nghost, int nghost_set, int ncomp, amrex::InterpBase *interp)
Definition: ERF_FillPatcher.cpp:21
amrex::DistributionMapping m_cdm
Definition: ERF_FillPatcher.H:62
amrex::Vector< amrex::Real > m_crse_times
Definition: ERF_FillPatcher.H:73
void RegisterCoarseData(amrex::Vector< amrex::MultiFab const * > const &crse_data, amrex::Vector< amrex::Real > const &crse_time)
Definition: ERF_FillPatcher.cpp:186
amrex::Geometry m_cgeom
Definition: ERF_FillPatcher.H:64
int m_ncomp
Definition: ERF_FillPatcher.H:67
void FillRelax(amrex::MultiFab &mf, amrex::Real time, BC &cbc, amrex::Vector< amrex::BCRec > const &bcs)
Definition: ERF_FillPatcher.H:105
void InterpFace(amrex::MultiFab &fine, amrex::MultiFab const &crse, int mask_val)
Definition: ERF_FillPatcher.cpp:210
int m_nghost_subset
Definition: ERF_FillPatcher.H:66
std::unique_ptr< amrex::iMultiFab > m_cf_mask
Definition: ERF_FillPatcher.H:72
std::unique_ptr< amrex::MultiFab > m_cf_crse_data_new
Definition: ERF_FillPatcher.H:71
int m_set_mask
Definition: ERF_FillPatcher.H:75
int GetSetMaskVal()
Definition: ERF_FillPatcher.H:39
void InterpCell(amrex::MultiFab &fine, amrex::MultiFab const &crse, amrex::Vector< amrex::BCRec > const &bcr, int mask_val)
Definition: ERF_FillPatcher.cpp:328
amrex::IntVect m_ratio
Definition: ERF_FillPatcher.H:69
int m_relax_mask
Definition: ERF_FillPatcher.H:76
void BuildMask(amrex::BoxArray const &fba, int nghost, int nghost_set)
Definition: ERF_FillPatcher.cpp:119
std::unique_ptr< amrex::MultiFab > m_cf_crse_data_old
Definition: ERF_FillPatcher.H:70
int GetRelaxMaskVal()
Definition: ERF_FillPatcher.H:41
void FillSet(amrex::MultiFab &mf, amrex::Real time, BC &cbc, amrex::Vector< amrex::BCRec > const &bcs)
Definition: ERF_FillPatcher.H:89
amrex::Real m_dt_crse
Definition: ERF_FillPatcher.H:74
int m_nghost
Definition: ERF_FillPatcher.H:65
amrex::DistributionMapping m_fdm
Definition: ERF_FillPatcher.H:61