From 94462a8f8a0a3c9bc6817389483d982ab46cbfb5 Mon Sep 17 00:00:00 2001 From: cgilet Date: Thu, 15 Feb 2024 15:19:31 -0500 Subject: [PATCH] more clean up --- ...ncflo_compute_MAC_projected_velocities.cpp | 22 +++++-------------- .../incflo_compute_advection_term.cpp | 3 --- src/diffusion/DiffusionScalarOp.cpp | 21 ++---------------- src/prob/prob_bc.cpp | 5 ++--- 4 files changed, 9 insertions(+), 42 deletions(-) diff --git a/src/convection/incflo_compute_MAC_projected_velocities.cpp b/src/convection/incflo_compute_MAC_projected_velocities.cpp index eb226338..fc9c74f9 100644 --- a/src/convection/incflo_compute_MAC_projected_velocities.cpp +++ b/src/convection/incflo_compute_MAC_projected_velocities.cpp @@ -127,7 +127,7 @@ incflo::compute_MAC_projected_velocities ( MultiFab robin_b (grids[lev],dmap[lev],1,nghost,MFInfo(),Factory(lev)); MultiFab robin_f (grids[lev],dmap[lev],1,nghost,MFInfo(),Factory(lev)); - // fixme - for vis, init robin MFs, although i don't know that this is generally needed + // fixme? - for vis, init robin MFs, although i don't know that this is generally needed robin_a = 0; robin_b = 0; robin_f = 0; @@ -145,7 +145,7 @@ incflo::compute_MAC_projected_velocities ( #ifdef _OPENMP #pragma omp parallel if (Gpu::notInLaunchRegion()) #endif - // FIXME - don't think we want tiling here... + // FIXME - do we want tiling here... for (MFIter mfi(robin_a,TilingIfNotGPU()); mfi.isValid(); ++mfi) { Box const& gbx = amrex::grow(mfi.validbox(),nghost); Box blo = gbx & dlo; @@ -197,19 +197,14 @@ incflo::compute_MAC_projected_velocities ( l_advection_type = "Godunov"; } -// FIXME - need to create the BC MF here. This is a iMF vs a Real MF, so can't use - // the robin BC info from MAC. This is because if we want this to be extensible to - // full position dependent BCs, would need the MF to hold the BCType, which are enums, -// so ints... +// FIXME? - need to create the BC MF here. This is a iMF vs a Real MF, so can't use + // the robin BC info from MAC. This is because we need this to hold the BCType, + // which are enums, so ints // std::unique_ptr BC_MF; if (m_has_mixedBC) { BC_MF = make_BC_MF(lev, m_bcrec_velocity_d, "velocity"); } -//fixme - VisMF::Write(*vel[0],"vin"); - //amrex::Write(*BC_MF,"bcmf"); -// // Predict normal velocity to faces -- note that the {u_mac, v_mac, w_mac} // returned from this call are on face CENTROIDS @@ -225,10 +220,6 @@ incflo::compute_MAC_projected_velocities ( l_advection_type, PPM::default_limiter, BC_MF.get()); } -//fixme - VisMF::Write(*u_mac[0],"umac"); - VisMF::Write(*v_mac[0],"vmac"); -// Vector > mac_vec(finest_level+1); for (int lev=0; lev <= finest_level; ++lev) { @@ -267,9 +258,6 @@ incflo::compute_MAC_projected_velocities ( } else { macproj->project(m_mac_mg_rtol,m_mac_mg_atol); } -//fixme - VisMF::Write(*u_mac[0],"umacp"); - VisMF::Write(*v_mac[0],"vmacp"); // Note that the macproj->project call above ensures that the MAC velocities are averaged down -- // we don't need to do that again here } diff --git a/src/convection/incflo_compute_advection_term.cpp b/src/convection/incflo_compute_advection_term.cpp index c6c1d38d..0f49c0c9 100644 --- a/src/convection/incflo_compute_advection_term.cpp +++ b/src/convection/incflo_compute_advection_term.cpp @@ -706,7 +706,4 @@ incflo::compute_convective_term (Vector const& conv_u, } // mfi #endif } // lev -//fixme - VisMF::Write(*conv_u[0],"conv"); - VisMF::Write(*conv_r[0],"conr"); } diff --git a/src/diffusion/DiffusionScalarOp.cpp b/src/diffusion/DiffusionScalarOp.cpp index 87fd49c9..4e3bfee4 100644 --- a/src/diffusion/DiffusionScalarOp.cpp +++ b/src/diffusion/DiffusionScalarOp.cpp @@ -223,10 +223,6 @@ DiffusionScalarOp::diffuse_scalar (Vector const& tracer, if ( m_incflo->m_has_mixedBC ) { auto const robin = m_incflo->make_diffusion_robinBC_MFs(lev, phi[lev]); - // VisMF::Write(robin_a, "dra"); - // VisMF::Write(robin_b, "drb"); - // VisMF::Write(robin_f, "drf"); - m_eb_scal_solve_op->setLevelBC(lev, &phi[lev], robin[0].get(), robin[1].get(), robin[2].get()); } @@ -382,10 +378,6 @@ DiffusionScalarOp::diffuse_vel_components (Vector const& vel, if ( m_incflo->m_has_mixedBC ) { auto const robin = m_incflo->make_diffusion_robinBC_MFs(lev, phi[lev]); - // VisMF::Write(robin_a, "dra"); - // VisMF::Write(robin_b, "drb"); - // VisMF::Write(robin_f, "drf"); - m_eb_vel_solve_op->setLevelBC(lev, &phi[lev], robin[0].get(), robin[1].get(), robin[2].get()); } @@ -493,11 +485,6 @@ void DiffusionScalarOp::compute_laps (Vector const& a_laps, if ( m_incflo->m_has_mixedBC ) { auto const robin = m_incflo->make_diffusion_robinBC_MFs(lev, scalar_comp[lev]); - // VisMF::Write(scalar_comp[0], "sc"); - // VisMF::Write(*robin[0], "dra"); - // VisMF::Write(*robin[1], "drb"); - // VisMF::Write(*robin[2], "drf"); - m_eb_scal_apply_op->setLevelBC(lev, &scalar_comp[lev], robin[0].get(), robin[1].get(), robin[2].get()); } @@ -620,10 +607,6 @@ void DiffusionScalarOp::compute_divtau (Vector const& a_divtau, if ( m_incflo->m_has_mixedBC ) { auto const robin = m_incflo->make_diffusion_robinBC_MFs(lev, vel_single[lev]); - // VisMF::Write(robin_a, "dra"); - // VisMF::Write(robin_b, "drb"); - // VisMF::Write(robin_f, "drf"); - m_eb_vel_apply_op->setLevelBC(lev, &vel_single[lev], robin[0].get(), robin[1].get(), robin[2].get()); } @@ -643,12 +626,12 @@ void DiffusionScalarOp::compute_divtau (Vector const& a_divtau, for(int lev = 0; lev <= finest_level; lev++) { - amrex::single_level_redistribute(divtau_tmp[lev], + amrex::single_level_redistribute(divtau_tmp[lev], *a_divtau[lev], 0, a_divtau[lev]->nComp(), m_incflo->Geom(lev)); // auto const& bc = m_incflo->get_velocity_bcrec_device_ptr(); // m_incflo->redistribute_term(*a_divtau[lev], divtau_tmp[lev], *a_vel[lev], - // bc, lev); + // bc, lev); } } else diff --git a/src/prob/prob_bc.cpp b/src/prob/prob_bc.cpp index 49d56646..1aa89989 100644 --- a/src/prob/prob_bc.cpp +++ b/src/prob/prob_bc.cpp @@ -88,9 +88,7 @@ void incflo::prob_set_BC_MF (Orientation ori, Box const& bx, } } -// FIXME - need one like this for diffusion, but then it really needs to be going to the PhysBCFunct -// Because we need the Dirichelet val, right? -// For MAC, the BC is on phi, so always 0 or 1, I think +// For MAC, the BC is on phi, so always 0 or 1 void incflo::prob_set_MAC_robinBCs (Orientation ori, Box const& bx, Array4 const& robin_a, Array4 const& robin_b, @@ -188,6 +186,7 @@ void incflo::prob_set_MAC_robinBCs (Orientation ori, Box const& bx, } } +// For diffusion, we also pass in the dirichlet bc void incflo::prob_set_diffusion_robinBCs (Orientation ori, Box const& bx, Array4 const& robin_a, Array4 const& robin_b,