Skip to content

Commit

Permalink
more clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
cgilet committed Feb 15, 2024
1 parent cfd9897 commit 94462a8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 42 deletions.
22 changes: 5 additions & 17 deletions src/convection/incflo_compute_MAC_projected_velocities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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<iMultiFab> 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
Expand All @@ -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<Array<MultiFab*,AMREX_SPACEDIM> > mac_vec(finest_level+1);
for (int lev=0; lev <= finest_level; ++lev)
{
Expand Down Expand Up @@ -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
}
3 changes: 0 additions & 3 deletions src/convection/incflo_compute_advection_term.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -706,7 +706,4 @@ incflo::compute_convective_term (Vector<MultiFab*> const& conv_u,
} // mfi
#endif
} // lev
//fixme
VisMF::Write(*conv_u[0],"conv");
VisMF::Write(*conv_r[0],"conr");
}
21 changes: 2 additions & 19 deletions src/diffusion/DiffusionScalarOp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,6 @@ DiffusionScalarOp::diffuse_scalar (Vector<MultiFab*> 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());
}
Expand Down Expand Up @@ -382,10 +378,6 @@ DiffusionScalarOp::diffuse_vel_components (Vector<MultiFab*> 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());
}
Expand Down Expand Up @@ -493,11 +485,6 @@ void DiffusionScalarOp::compute_laps (Vector<MultiFab*> 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());
}
Expand Down Expand Up @@ -620,10 +607,6 @@ void DiffusionScalarOp::compute_divtau (Vector<MultiFab*> 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());
}
Expand All @@ -643,12 +626,12 @@ void DiffusionScalarOp::compute_divtau (Vector<MultiFab*> 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
Expand Down
5 changes: 2 additions & 3 deletions src/prob/prob_bc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Real> const& robin_a,
Array4<Real> const& robin_b,
Expand Down Expand Up @@ -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<Real> const& robin_a,
Array4<Real> const& robin_b,
Expand Down

0 comments on commit 94462a8

Please sign in to comment.