src/incflo_regrid.cpp
// Make a new level using provided BoxArray and DistributionMapping and
// fill with interpolated coarse level data.
// overrides the pure virtual function in AmrCore
Make a new level using provided BoxArray and DistributionMapping and
fill with interpolated coarse level data.
overrides the pure virtual function in AmrCore
Make a new level using provided BoxArray and DistributionMapping and fill with interpolated coarse level data . overrides the pure virtual function in AmrCore
void incflo::MakeNewLevelFromCoarse (int lev,
                                     Real time,
                                     const BoxArray& ba,
                                     const DistributionMapping& dm)
{
    BL_PROFILE("incflo::MakeNewLevelFromCoarse()");
    if (m_verbose > 0) {
        amrex::Print() << "Making new level " << lev << " from coarse" << std::endl;
    }
#ifdef AMREX_USE_EB
    std::unique_ptr<FabFactory<FArrayBox> > new_fact = makeEBFabFactory(geom[lev], ba, dm,
                                                                        {nghost_eb_basic(),
                                                                         nghost_eb_volume(),
                                                                         nghost_eb_full()},
                                                                        EBSupport::full);
#else
    std::unique_ptr<FabFactory<FArrayBox> > new_fact(new FArrayBoxFactory());
#endif
    std::unique_ptr<LevelData> 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));
    fillcoarsepatch_velocity(lev, time, new_leveldata->velocity, 0);
    fillcoarsepatch_density(lev, time, new_leveldata->density, 0);
    if (m_ntrac > 0) {
        fillcoarsepatch_tracer(lev, time, new_leveldata->tracer, 0);
    }
    fillcoarsepatch_gradp(lev, time, new_leveldata->gp, 0);
    new_leveldata->p_nd.setVal(0.0);
    new_leveldata->p_cc.setVal(0.0);
    m_leveldata[lev] = std::move(new_leveldata);
    m_factory[lev] = std::move(new_fact);
    m_diffusion_tensor_op.reset();
    m_diffusion_scalar_op.reset();
#ifdef AMREX_USE_EB
    macproj.reset(new Hydro::MacProjector(Geom(0,finest_level),
                      MLMG::Location::FaceCentroid,  
                      MLMG::Location::FaceCentroid,  
                      MLMG::Location::CellCenter  ) ); 
#else
    macproj.reset(new Hydro::MacProjector(Geom(0,finest_level)));
#endif
}
void incflo :: MakeNewLevelFromCoarse ( int lev , Real time , const BoxArray & ba , const DistributionMapping & dm ) { BL_PROFILE ( " " ) ; if ( m_verbose > 0 ) { amrex :: Print ( ) << " " << lev << " " << std :: endl ; } #ifdef AMREX_USE_EB std :: unique_ptr < FabFactory < FArrayBox > > new_fact = makeEBFabFactory ( geom [ lev ] , ba , dm , { nghost_eb_basic ( ) , nghost_eb_volume ( ) , nghost_eb_full ( ) } , EBSupport :: full ) ; #else std :: unique_ptr < FabFactory < FArrayBox > > new_fact ( new FArrayBoxFactory ( ) ) ; #endif std :: unique_ptr < LevelData > 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 ) ) ; fillcoarsepatch_velocity ( lev , time , new_leveldata -> velocity , 0 ) ; fillcoarsepatch_density ( lev , time , new_leveldata -> density , 0 ) ; if ( m_ntrac > 0 ) { fillcoarsepatch_tracer ( lev , time , new_leveldata -> tracer , 0 ) ; } fillcoarsepatch_gradp ( lev , time , new_leveldata -> gp , 0 ) ; new_leveldata -> p_nd . setVal ( 0.0 ) ; new_leveldata -> p_cc . setVal ( 0.0 ) ; m_leveldata [ lev ] = std :: move ( new_leveldata ) ; m_factory [ lev ] = std :: move ( new_fact ) ; m_diffusion_tensor_op . reset ( ) ; m_diffusion_scalar_op . reset ( ) ; #ifdef AMREX_USE_EB macproj . reset ( new Hydro :: MacProjector ( Geom ( 0 , finest_level ) , MLMG :: Location :: FaceCentroid , MLMG :: Location :: FaceCentroid , MLMG :: Location :: CellCenter ) ) ; #else macproj . reset ( new Hydro :: MacProjector ( Geom ( 0 , finest_level ) ) ) ; #endif }
Make a new level using provided BoxArray and DistributionMapping and
fill with interpolated coarse level data.
Make a new level using provided BoxArray and DistributionMapping and fill with interpolated coarse level data .
// Location of mac_vec // Location of beta // Location of solution variable phi