Skip to content

Commit

Permalink
Identify locations
Browse files Browse the repository at this point in the history
  • Loading branch information
marchdf committed Sep 11, 2024
1 parent e10f5eb commit 8c85df2
Show file tree
Hide file tree
Showing 84 changed files with 165 additions and 4 deletions.
3 changes: 3 additions & 0 deletions amr-wind/diffusion/incflo_diffusion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ void viscosity_to_uniform_space(
repo.get_mesh_mapping_det_j(amr_wind::FieldLoc::ZFACE);

// beta accounted for mesh mapping (x-face) = J/fac^2 * mu
// needs openmp pragma?
for (amrex::MFIter mfi(b[0]); mfi.isValid(); ++mfi) {
amrex::Array4<amrex::Real> const& mu = b[0].array(mfi);
amrex::Array4<amrex::Real const> const& fac =
Expand All @@ -237,6 +238,7 @@ void viscosity_to_uniform_space(
});
}
// beta accounted for mesh mapping (y-face) = J/fac^2 * mu
// needs openmp pragma?
for (amrex::MFIter mfi(b[1]); mfi.isValid(); ++mfi) {
amrex::Array4<amrex::Real> const& mu = b[1].array(mfi);
amrex::Array4<amrex::Real const> const& fac =
Expand All @@ -251,6 +253,7 @@ void viscosity_to_uniform_space(
});
}
// beta accounted for mesh mapping (z-face) = J/fac^2 * mu
// needs openmp pragma?
for (amrex::MFIter mfi(b[2]); mfi.isValid(); ++mfi) {
amrex::Array4<amrex::Real> const& mu = b[2].array(mfi);
amrex::Array4<amrex::Real const> const& fac =
Expand Down
2 changes: 2 additions & 0 deletions amr-wind/equation_systems/CompRHSOps.H
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ struct ComputeRHSOp
#ifdef AMREX_USE_OMP
#pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
#endif
// this one
for (amrex::MFIter mfi(field(lev)); mfi.isValid(); ++mfi) {
const auto& bx = mfi.tilebox();
auto fld = field(lev).array(mfi);
Expand Down Expand Up @@ -197,6 +198,7 @@ struct ComputeRHSOp
#ifdef AMREX_USE_OMP
#pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
#endif
// this one
for (amrex::MFIter mfi(field(lev)); mfi.isValid(); ++mfi) {
const auto& bx = mfi.tilebox();
auto fld = field(lev).array(mfi);
Expand Down
1 change: 1 addition & 0 deletions amr-wind/equation_systems/DiffusionOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ void DiffSolverIface<LinOp>::linsys_solve_impl()
#ifdef AMREX_USE_OMP
#pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
#endif
// this one
for (amrex::MFIter mfi(rhs, amrex::TilingIfNotGPU()); mfi.isValid();
++mfi) {
const auto& bx = mfi.tilebox();
Expand Down
1 change: 1 addition & 0 deletions amr-wind/equation_systems/PDEOps.H
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ struct SrcTermOpBase
#ifdef AMREX_USE_OMP
#pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
#endif
// this one
for (amrex::MFIter mfi(src_term, amrex::TilingIfNotGPU());
mfi.isValid(); ++mfi) {
const auto& bx = mfi.tilebox();
Expand Down
2 changes: 2 additions & 0 deletions amr-wind/equation_systems/density/density_ops.H
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ struct ComputeRHSOp<Density, Scheme>
#ifdef AMREX_USE_OMP
#pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
#endif
// this one
for (amrex::MFIter mfi(field(lev)); mfi.isValid(); ++mfi) {
const auto& bx = mfi.tilebox();
auto rho = field(lev).array(mfi);
Expand Down Expand Up @@ -62,6 +63,7 @@ struct ComputeRHSOp<Density, Scheme>
#ifdef AMREX_USE_OMP
#pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
#endif
// this one
for (amrex::MFIter mfi(field(lev)); mfi.isValid(); ++mfi) {
const auto& bx = mfi.tilebox();
auto rho = field(lev).array(mfi);
Expand Down
6 changes: 6 additions & 0 deletions amr-wind/equation_systems/icns/icns_advection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,8 @@ void MacProjOp::mac_proj_to_uniform_space(
// scale U^mac to accommodate for mesh mapping -> U^bar = J/fac *
// U^mac beta accounted for mesh mapping = J/fac^2 * 1/rho construct
// rho and mesh map u_mac on x-face
// this one
// needs openmp pragma?
for (amrex::MFIter mfi(*(rho_face[0])); mfi.isValid(); ++mfi) {
amrex::Array4<amrex::Real> const& u = u_mac(lev).array(mfi);
amrex::Array4<amrex::Real> const& rho = rho_face[0]->array(mfi);
Expand All @@ -353,6 +355,8 @@ void MacProjOp::mac_proj_to_uniform_space(
});
}
// construct rho on y-face
// this one
// needs openmp pragma?
for (amrex::MFIter mfi(*(rho_face[1])); mfi.isValid(); ++mfi) {
amrex::Array4<amrex::Real> const& v = v_mac(lev).array(mfi);
amrex::Array4<amrex::Real> const& rho = rho_face[1]->array(mfi);
Expand All @@ -369,6 +373,8 @@ void MacProjOp::mac_proj_to_uniform_space(
});
}
// construct rho on z-face
// this one
// needs openmp pragma?
for (amrex::MFIter mfi(*(rho_face[2])); mfi.isValid(); ++mfi) {
amrex::Array4<amrex::Real> const& w = w_mac(lev).array(mfi);
amrex::Array4<amrex::Real> const& rho = rho_face[2]->array(mfi);
Expand Down
4 changes: 4 additions & 0 deletions amr-wind/equation_systems/icns/icns_diffusion.H
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ public:
#ifdef AMREX_USE_OMP
#pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
#endif
// this one
for (amrex::MFIter mfi(divtau(lev), amrex::TilingIfNotGPU());
mfi.isValid(); ++mfi) {
const auto& bx = mfi.tilebox();
Expand Down Expand Up @@ -240,6 +241,7 @@ public:
#ifdef AMREX_USE_OMP
#pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
#endif
// this one
for (amrex::MFIter mfi(rhs, amrex::TilingIfNotGPU()); mfi.isValid();
++mfi) {
const auto& bx = mfi.tilebox();
Expand Down Expand Up @@ -401,6 +403,7 @@ public:
#ifdef AMREX_USE_OMP
#pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
#endif
// this one
for (amrex::MFIter mfi(divtau(lev), amrex::TilingIfNotGPU());
mfi.isValid(); ++mfi) {
const auto& bx = mfi.tilebox();
Expand Down Expand Up @@ -483,6 +486,7 @@ public:
#ifdef AMREX_USE_OMP
#pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
#endif
// this one
for (amrex::MFIter mfi(rhs, amrex::TilingIfNotGPU()); mfi.isValid();
++mfi) {
const auto& bx = mfi.tilebox();
Expand Down
1 change: 1 addition & 0 deletions amr-wind/equation_systems/icns/icns_ops.H
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ struct SrcTermOp<ICNS> : SrcTermOpBase<ICNS>
#ifdef AMREX_USE_OMP
#pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
#endif
// this one
for (amrex::MFIter mfi(src_term, amrex::TilingIfNotGPU());
mfi.isValid(); ++mfi) {
const auto& bx = mfi.tilebox();
Expand Down
2 changes: 2 additions & 0 deletions amr-wind/equation_systems/levelset/levelset_ops.H
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ struct ComputeRHSOp<Levelset, Scheme>
#ifdef AMREX_USE_OMP
#pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
#endif
// this one
for (amrex::MFIter mfi(field(lev)); mfi.isValid(); ++mfi) {
const auto& bx = mfi.tilebox();
auto phi = field(lev).array(mfi);
Expand Down Expand Up @@ -101,6 +102,7 @@ struct ComputeRHSOp<Levelset, Scheme>
#ifdef AMREX_USE_OMP
#pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
#endif
// this one
for (amrex::MFIter mfi(field(lev)); mfi.isValid(); ++mfi) {
const auto& bx = mfi.tilebox();
auto phi = field(lev).array(mfi);
Expand Down
1 change: 1 addition & 0 deletions amr-wind/equation_systems/tke/tke_ops.H
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ struct PostSolveOp<TKE>
const int nlevels = repo.num_active_levels();
const auto clip_value = m_clip_value;
for (int lev = 0; lev < nlevels; ++lev) {
// this one
for (amrex::MFIter mfi(field(lev)); mfi.isValid(); ++mfi) {
const auto& bx = mfi.tilebox();
const auto& field_arr = field(lev).array(mfi);
Expand Down
1 change: 1 addition & 0 deletions amr-wind/equation_systems/vof/vof_hybridsolver_ops.H
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ static void replace_masked_vof(
auto& vof = f_vof(lev);
const auto& vof_new = f_vof_new(lev);

// this one
for (amrex::MFIter mfi(iblank); mfi.isValid(); ++mfi) {
const auto& gbx = mfi.growntilebox();
const amrex::Array4<const int>& native_flag =
Expand Down
2 changes: 2 additions & 0 deletions amr-wind/immersed_boundary/bluff_body/bluff_body_ops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ void apply_mms_vel(CFDSim& sim)
const auto& dx = geom[lev].CellSizeArray();
const auto& problo = geom[lev].ProbLoArray();

// this one
for (amrex::MFIter mfi(levelset(lev)); mfi.isValid(); ++mfi) {
const auto& bx = mfi.growntilebox();
const auto& phi = levelset(lev).const_array(mfi);
Expand Down Expand Up @@ -90,6 +91,7 @@ void apply_dirichlet_vel(CFDSim& sim, const amrex::Vector<amrex::Real>& vel_bc)
// Defining the "ghost-cell" band distance
amrex::Real phi_b = std::cbrt(dx[0] * dx[1] * dx[2]);

// this one
for (amrex::MFIter mfi(levelset(lev)); mfi.isValid(); ++mfi) {
const auto& bx = mfi.tilebox();
const auto& varr = velocity(lev).array(mfi);
Expand Down
1 change: 1 addition & 0 deletions amr-wind/immersed_boundary/bluff_body/box_ops.H
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ struct InitDataOp<Box>
for (int lev = 0; lev < nlevels; ++lev) {
const auto& problo = geom[lev].ProbLoArray();
const auto& dx = geom[lev].CellSizeArray();
// this one
for (amrex::MFIter mfi(levelset(lev)); mfi.isValid(); ++mfi) {
const auto& bx = mfi.growntilebox();
const auto& epsilon_node = mask_node(lev).array(mfi);
Expand Down
1 change: 1 addition & 0 deletions amr-wind/immersed_boundary/bluff_body/cylinder_ops.H
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ struct InitDataOp<Cylinder>
const auto& problo = geom[lev].ProbLoArray();
const auto& dx = geom[lev].CellSizeArray();

// this one
for (amrex::MFIter mfi(levelset(lev)); mfi.isValid(); ++mfi) {
const auto& phi = levelset(lev).array(mfi);

Expand Down
1 change: 1 addition & 0 deletions amr-wind/immersed_boundary/bluff_body/sphere_ops.H
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ struct InitDataOp<Sphere>
const auto& problo = geom[lev].ProbLoArray();
const auto& dx = geom[lev].CellSizeArray();

// this one
for (amrex::MFIter mfi(levelset(lev)); mfi.isValid(); ++mfi) {
const auto& bx = mfi.growntilebox();
const auto& phi = levelset(lev).array(mfi);
Expand Down
5 changes: 5 additions & 0 deletions amr-wind/mesh_mapping_models/ChannelFlowMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ void ChannelFlowMap::create_cell_node_map(int lev, const amrex::Geometry& geom)
prob_hi[0] - prob_lo[0], prob_hi[1] - prob_lo[1],
prob_hi[2] - prob_lo[2]};

// this one
for (amrex::MFIter mfi((*m_mesh_scale_fac_cc)(lev)); mfi.isValid(); ++mfi) {

const auto& bx = mfi.growntilebox();
Expand Down Expand Up @@ -149,6 +150,7 @@ void ChannelFlowMap::create_face_map(int lev, const amrex::Geometry& geom)
prob_hi[0] - prob_lo[0], prob_hi[1] - prob_lo[1],
prob_hi[2] - prob_lo[2]};

// this one
for (amrex::MFIter mfi((*m_mesh_scale_fac_xf)(lev)); mfi.isValid(); ++mfi) {

const auto& bx = mfi.growntilebox();
Expand Down Expand Up @@ -181,6 +183,7 @@ void ChannelFlowMap::create_face_map(int lev, const amrex::Geometry& geom)
});
}

// this one
for (amrex::MFIter mfi((*m_mesh_scale_fac_yf)(lev)); mfi.isValid(); ++mfi) {

const auto& bx = mfi.growntilebox();
Expand Down Expand Up @@ -213,6 +216,7 @@ void ChannelFlowMap::create_face_map(int lev, const amrex::Geometry& geom)
});
}

// this one
for (amrex::MFIter mfi((*m_mesh_scale_fac_zf)(lev)); mfi.isValid(); ++mfi) {

const auto& bx = mfi.growntilebox();
Expand Down Expand Up @@ -277,6 +281,7 @@ void ChannelFlowMap::create_non_uniform_mesh(
probhi_physical[0] - prob_lo[0], probhi_physical[1] - prob_lo[1],
probhi_physical[2] - prob_lo[2]};

// this one
for (amrex::MFIter mfi((*m_non_uniform_coord_cc)(lev)); mfi.isValid();
++mfi) {

Expand Down
5 changes: 5 additions & 0 deletions amr-wind/mesh_mapping_models/ConstantMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ void ConstantMap::create_cell_node_map(int lev)
amrex::Real fac_y = m_fac[1];
amrex::Real fac_z = m_fac[2];

// this one
for (amrex::MFIter mfi((*m_mesh_scale_fac_cc)(lev)); mfi.isValid(); ++mfi) {

const auto& bx = mfi.growntilebox();
Expand Down Expand Up @@ -69,6 +70,7 @@ void ConstantMap::create_face_map(int lev)
amrex::Real fac_y = m_fac[1];
amrex::Real fac_z = m_fac[2];

// this one
for (amrex::MFIter mfi((*m_mesh_scale_fac_xf)(lev)); mfi.isValid(); ++mfi) {
const auto& bx = mfi.growntilebox();
amrex::Array4<amrex::Real> const& scale_fac_xf =
Expand All @@ -86,6 +88,7 @@ void ConstantMap::create_face_map(int lev)
});
}

// this one
for (amrex::MFIter mfi((*m_mesh_scale_fac_yf)(lev)); mfi.isValid(); ++mfi) {
const auto& bx = mfi.growntilebox();
amrex::Array4<amrex::Real> const& scale_fac_yf =
Expand All @@ -103,6 +106,7 @@ void ConstantMap::create_face_map(int lev)
});
}

// this one
for (amrex::MFIter mfi((*m_mesh_scale_fac_zf)(lev)); mfi.isValid(); ++mfi) {
const auto& bx = mfi.growntilebox();
amrex::Array4<amrex::Real> const& scale_fac_zf =
Expand All @@ -129,6 +133,7 @@ void ConstantMap::create_non_uniform_mesh(int lev, const amrex::Geometry& geom)
const auto& problo = geom.ProbLoArray();
const auto& dx = geom.CellSizeArray();

// this one
for (amrex::MFIter mfi((*m_non_uniform_coord_cc)(lev)); mfi.isValid();
++mfi) {

Expand Down
2 changes: 2 additions & 0 deletions amr-wind/ocean_waves/relaxation_zones/linear_waves_ops.H
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ struct InitDataOp<LinearWaves>

const auto& problo = geom.ProbLoArray();
const auto& dx = geom.CellSizeArray();
// this one
for (amrex::MFIter mfi(m_levelset(level)); mfi.isValid(); ++mfi) {

const auto& phi = m_levelset(level).array(mfi);
Expand Down Expand Up @@ -128,6 +129,7 @@ struct UpdateRelaxZonesOp<LinearWaves>
const auto& problo = geom[lev].ProbLoArray();
const auto& dx = geom[lev].CellSizeArray();

// this one
for (amrex::MFIter mfi(m_ow_levelset(lev)); mfi.isValid(); ++mfi) {
const auto& phi = m_ow_levelset(lev).array(mfi);
const auto& vel = m_ow_velocity(lev).array(mfi);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ void apply_relaxation_zones(CFDSim& sim, const RelaxZonesBaseData& wdata)
auto& target_vof = m_ow_vof(lev);
const auto& dx = geom[lev].CellSizeArray();

// this one
for (amrex::MFIter mfi(ls); mfi.isValid(); ++mfi) {
const auto& gbx = mfi.growntilebox(2);
const amrex::Array4<amrex::Real>& phi = ls.array(mfi);
Expand All @@ -88,6 +89,7 @@ void apply_relaxation_zones(CFDSim& sim, const RelaxZonesBaseData& wdata)
auto& density = sim.repo().get_field("density");

for (int lev = 0; lev < nlevels; ++lev) {
// this one
for (amrex::MFIter mfi(vof(lev)); mfi.isValid(); ++mfi) {
const auto& gbx = mfi.growntilebox(2);
const auto& dx = geom[lev].CellSizeArray();
Expand Down
2 changes: 2 additions & 0 deletions amr-wind/ocean_waves/relaxation_zones/stokes_waves_ops.H
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ struct InitDataOp<StokesWaves>
auto& velocity = sim.repo().get_field("velocity");
const auto& problo = geom.ProbLoArray();
const auto& dx = geom.CellSizeArray();
// this one
for (amrex::MFIter mfi(m_levelset(level)); mfi.isValid(); ++mfi) {

const auto& phi = m_levelset(level).array(mfi);
Expand Down Expand Up @@ -154,6 +155,7 @@ struct UpdateRelaxZonesOp<StokesWaves>
const auto& problo = geom[lev].ProbLoArray();
const auto& dx = geom[lev].CellSizeArray();

// this one
for (amrex::MFIter mfi(m_ow_levelset(lev)); mfi.isValid(); ++mfi) {
const auto& phi = m_ow_levelset(lev).array(mfi);
const auto& vel = m_ow_velocity(lev).array(mfi);
Expand Down
3 changes: 3 additions & 0 deletions amr-wind/ocean_waves/relaxation_zones/waves2amr_ops.H
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ void postprocess_velocity_mfab_liquid(
amrex::MultiFab& lvs_mfab,
const amrex::GpuArray<amrex::Real, AMREX_SPACEDIM> dx)
{
// this one
for (amrex::MFIter mfi(vel_mfab); mfi.isValid(); ++mfi) {
auto vel = vel_mfab.array(mfi);
auto phi = lvs_mfab.const_array(mfi);
Expand Down Expand Up @@ -425,6 +426,7 @@ struct InitDataOp<W2AWaves>
// Blank initialization if asked for
if (!init_waves) {
// Loop to populate field data
// this one
for (amrex::MFIter mfi(levelset(level)); mfi.isValid(); ++mfi) {
auto phi = levelset(level).array(mfi);
auto vel = velocity(level).array(mfi);
Expand Down Expand Up @@ -651,6 +653,7 @@ struct UpdateRelaxZonesOp<W2AWaves>

// Temporally interpolate at every timestep to get target solution
for (int lev = 0; lev < nlevels; ++lev) {
// this one
for (amrex::MFIter mfi(m_ow_levelset(lev)); mfi.isValid(); ++mfi) {
auto phi = m_ow_levelset(lev).array(mfi);
auto vel = m_ow_velocity(lev).array(mfi);
Expand Down
1 change: 1 addition & 0 deletions amr-wind/overset/OversetOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ void OversetOps::update_gradp()
#ifdef AMREX_USE_OMP
#pragma omp parallel if (amrex::Gpu::notInLaunchRegion())
#endif
// this one
for (MFIter mfi(grad_p(lev), TilingIfNotGPU()); mfi.isValid(); ++mfi) {
Box const& tbx = mfi.tilebox();
Array4<Real> const& gp_lev = grad_p(lev).array(mfi);
Expand Down
1 change: 1 addition & 0 deletions amr-wind/physics/BoussinesqBubble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ void BoussinesqBubble::initialize_fields(int level, const amrex::Geometry& geom)
auto& density = m_density(level);
auto& scalars = (*m_temperature)(level);

// needs openmp pragma?
for (amrex::MFIter mfi(density); mfi.isValid(); ++mfi) {
const auto& vbx = mfi.validbox();

Expand Down
3 changes: 2 additions & 1 deletion amr-wind/physics/BurggrafFlow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ void BurggrafFlow::initialize_fields(int level, const amrex::Geometry& geom)

UExact u_exact;
VExact v_exact;
// this one
for (amrex::MFIter mfi(velocity); mfi.isValid(); ++mfi) {
const auto& vbx = mfi.validbox();

Expand Down Expand Up @@ -181,4 +182,4 @@ void BurggrafFlow::post_init_actions() { output_error(); }

void BurggrafFlow::post_advance_work() { output_error(); }

} // namespace amr_wind::burggraf
} // namespace amr_wind::burggraf
Loading

0 comments on commit 8c85df2

Please sign in to comment.