diff --git a/src/incflo.H b/src/incflo.H index 3e229738..ebc0610c 100644 --- a/src/incflo.H +++ b/src/incflo.H @@ -570,9 +570,9 @@ private: /*! Initialize tracer particles */ void initializeTracerParticles (amrex::ParGDBBase* gdb #ifdef AMREX_USE_EB - ,amrex::EBFArrayBoxFactory const& ebfact + ,amrex::EBFArrayBoxFactory const& ebfact #endif - ); + ); /*! Evolve tracers and hydro particles */ void evolveTracerParticles (AMREX_D_DECL(amrex::Vector const& u_mac, @@ -586,9 +586,7 @@ private: LevelData (amrex::BoxArray const& ba, amrex::DistributionMapping const& dm, amrex::FabFactory const& fact, - int ntrac, int ng_state, - const std::string& advection_type, bool implicit_diffusion, - bool use_tensor_correction, bool advect_tracer); + incflo* my_incflo); // cell-centered multifabs amrex::MultiFab velocity; amrex::MultiFab velocity_o; diff --git a/src/incflo.cpp b/src/incflo.cpp index 8f4c5906..1bf9a392 100644 --- a/src/incflo.cpp +++ b/src/incflo.cpp @@ -229,11 +229,7 @@ void incflo::MakeNewLevelFromScratch (int lev, Real time, const BoxArray& new_gr #endif m_leveldata[lev] = std::make_unique(grids[lev], dmap[lev], *m_factory[lev], - m_ntrac, nghost_state(), - m_advection_type, - m_diff_type==DiffusionType::Implicit, - use_tensor_correction, - m_advect_tracer); + this); m_t_new[lev] = time; m_t_old[lev] = time - Real(1.e200); diff --git a/src/incflo_regrid.cpp b/src/incflo_regrid.cpp index 4e912df5..afaf5f86 100644 --- a/src/incflo_regrid.cpp +++ b/src/incflo_regrid.cpp @@ -27,11 +27,7 @@ void incflo::MakeNewLevelFromCoarse (int lev, std::unique_ptr > new_fact(new FArrayBoxFactory()); #endif std::unique_ptr new_leveldata - (new LevelData(ba, dm, *new_fact, m_ntrac, nghost_state(), - m_advection_type, - m_diff_type==DiffusionType::Implicit, - use_tensor_correction, - m_advect_tracer)); + (new LevelData(ba, dm, *new_fact, this)); fillcoarsepatch_velocity(lev, time, new_leveldata->velocity, 0); fillcoarsepatch_density(lev, time, new_leveldata->density, 0); if (m_ntrac > 0) { @@ -79,11 +75,7 @@ void incflo::RemakeLevel (int lev, Real time, const BoxArray& ba, std::unique_ptr > new_fact(new FArrayBoxFactory()); #endif std::unique_ptr new_leveldata - (new LevelData(ba, dm, *new_fact, m_ntrac, nghost_state(), - m_advection_type, - m_diff_type==DiffusionType::Implicit, - use_tensor_correction, - m_advect_tracer)); + (new LevelData(ba, dm, *new_fact, this)); fillpatch_velocity(lev, time, new_leveldata->velocity, 0); fillpatch_density(lev, time, new_leveldata->density, 0); if (m_ntrac > 0) { diff --git a/src/setup/incflo_arrays.cpp b/src/setup/incflo_arrays.cpp index d903c7e8..031f295a 100644 --- a/src/setup/incflo_arrays.cpp +++ b/src/setup/incflo_arrays.cpp @@ -5,50 +5,49 @@ using namespace amrex; incflo::LevelData::LevelData (amrex::BoxArray const& ba, amrex::DistributionMapping const& dm, amrex::FabFactory const& fact, - int ntrac, int ng_state, - const std::string& advection_type, bool implicit_diffusion, - bool use_tensor_correction, bool advect_tracer) - : velocity (ba, dm, AMREX_SPACEDIM, ng_state, MFInfo(), fact), - velocity_o (ba, dm, AMREX_SPACEDIM, ng_state, MFInfo(), fact), - velocity_eb (ba, dm, AMREX_SPACEDIM, ng_state, MFInfo(), fact), + incflo* my_incflo) + : velocity (ba, dm, AMREX_SPACEDIM, my_incflo->nghost_state(), MFInfo(), fact), + velocity_o (ba, dm, AMREX_SPACEDIM, my_incflo->nghost_state(), MFInfo(), fact), + velocity_eb (ba, dm, AMREX_SPACEDIM, my_incflo->nghost_state(), MFInfo(), fact), - density (ba, dm, 1 , ng_state, MFInfo(), fact), - density_eb (ba, dm, 1 , ng_state, MFInfo(), fact), - density_o (ba, dm, 1 , ng_state, MFInfo(), fact), - density_nph (ba, dm, 1 , ng_state, MFInfo(), fact), + density (ba, dm, 1 , my_incflo->nghost_state(), MFInfo(), fact), + density_eb (ba, dm, 1 , my_incflo->nghost_state(), MFInfo(), fact), + density_o (ba, dm, 1 , my_incflo->nghost_state(), MFInfo(), fact), + density_nph (ba, dm, 1 , my_incflo->nghost_state(), MFInfo(), fact), - tracer (ba, dm, ntrac , ng_state, MFInfo(), fact), - tracer_eb (ba, dm, ntrac , ng_state, MFInfo(), fact), - tracer_o (ba, dm, ntrac , ng_state, MFInfo(), fact), + tracer (ba, dm, my_incflo->m_ntrac, my_incflo->nghost_state(), MFInfo(), fact), + tracer_eb (ba, dm, my_incflo->m_ntrac, my_incflo->nghost_state(), MFInfo(), fact), + tracer_o (ba, dm, my_incflo->m_ntrac, my_incflo->nghost_state(), MFInfo(), fact), - mac_phi (ba, dm, 1 , 1 , MFInfo(), fact), - p_nd (amrex::convert(ba,IntVect::TheNodeVector()), + mac_phi (ba, dm, 1 , 1 , MFInfo(), fact), + p_nd (amrex::convert(ba,IntVect::TheNodeVector()), dm, 1 , 0 , MFInfo(), fact), - gp (ba, dm, AMREX_SPACEDIM, 0 , MFInfo(), fact), + gp (ba, dm, AMREX_SPACEDIM, 0 , MFInfo(), fact), - conv_velocity_o(ba, dm, AMREX_SPACEDIM, 0, MFInfo(), fact), - conv_density_o (ba, dm, 1 , 0, MFInfo(), fact), - conv_tracer_o (ba, dm, ntrac , 0, MFInfo(), fact) + conv_velocity_o (ba, dm, AMREX_SPACEDIM , 0, MFInfo(), fact), + conv_density_o (ba, dm, 1 , 0, MFInfo(), fact), + conv_tracer_o (ba, dm, my_incflo->m_ntrac, 0, MFInfo(), fact) { - if (advection_type != "MOL") { + if (my_incflo->m_advection_type != "MOL") { divtau_o.define(ba, dm, AMREX_SPACEDIM, 0, MFInfo(), fact); - if (advect_tracer) { - laps_o.define(ba, dm, ntrac, 0, MFInfo(), fact); + if (my_incflo->m_advect_tracer) { + laps_o.define(ba, dm, my_incflo->m_ntrac, 0, MFInfo(), fact); } } else { - conv_velocity.define(ba, dm, AMREX_SPACEDIM, 0, MFInfo(), fact); - conv_density.define (ba, dm, 1 , 0, MFInfo(), fact); - conv_tracer.define (ba, dm, ntrac , 0, MFInfo(), fact); + conv_velocity.define(ba, dm, AMREX_SPACEDIM , 0, MFInfo(), fact); + conv_density.define (ba, dm, 1 , 0, MFInfo(), fact); + conv_tracer.define (ba, dm, my_incflo->m_ntrac, 0, MFInfo(), fact); - if (!implicit_diffusion || use_tensor_correction) + bool implicit_diffusion = my_incflo->m_diff_type == DiffusionType::Implicit; + if (!implicit_diffusion || my_incflo->use_tensor_correction) { divtau.define (ba, dm, AMREX_SPACEDIM, 0, MFInfo(), fact); divtau_o.define(ba, dm, AMREX_SPACEDIM, 0, MFInfo(), fact); } - if (!implicit_diffusion && advect_tracer) + if (!implicit_diffusion && my_incflo->m_advect_tracer) { - laps.define (ba, dm, ntrac, 0, MFInfo(), fact); - laps_o.define(ba, dm, ntrac, 0, MFInfo(), fact); + laps.define (ba, dm, my_incflo->m_ntrac, 0, MFInfo(), fact); + laps_o.define(ba, dm, my_incflo->m_ntrac, 0, MFInfo(), fact); } } }