From b89830381dc9f86e341c41c426129369f8cc9e6f Mon Sep 17 00:00:00 2001 From: Marc Henry de Frahan Date: Mon, 20 May 2024 15:16:43 -0600 Subject: [PATCH] Identify locations --- amr-wind/CMakeLists.txt | 1 - amr-wind/core/Field.cpp | 50 ++++++++--------- amr-wind/core/FieldFillPatchOps.H | 2 +- amr-wind/core/field_ops.H | 54 +++++++++---------- amr-wind/derive/CMakeLists.txt | 5 -- amr-wind/derive/field_algebra.cpp | 37 ------------- amr-wind/diffusion/incflo_diffusion.cpp | 3 ++ amr-wind/equation_systems/CompRHSOps.H | 2 + amr-wind/equation_systems/DiffusionOps.cpp | 1 + amr-wind/equation_systems/PDEOps.H | 1 + .../equation_systems/density/density_ops.H | 2 + .../equation_systems/icns/icns_advection.cpp | 6 +++ .../equation_systems/icns/icns_diffusion.H | 5 ++ amr-wind/equation_systems/icns/icns_ops.H | 1 + .../equation_systems/levelset/levelset_ops.H | 2 + amr-wind/equation_systems/tke/tke_ops.H | 1 + .../vof/vof_hybridsolver_ops.H | 1 + .../bluff_body/bluff_body_ops.cpp | 2 + .../immersed_boundary/bluff_body/box_ops.H | 1 + .../bluff_body/cylinder_ops.H | 1 + .../immersed_boundary/bluff_body/sphere_ops.H | 1 + .../mesh_mapping_models/ChannelFlowMap.cpp | 5 ++ amr-wind/mesh_mapping_models/ConstantMap.cpp | 5 ++ .../relaxation_zones/linear_waves_ops.H | 2 + .../relaxation_zones/relaxation_zones_ops.cpp | 2 + .../relaxation_zones/stokes_waves_ops.H | 2 + .../relaxation_zones/waves2amr_ops.H | 3 ++ amr-wind/overset/OversetOps.cpp | 3 +- amr-wind/overset/TiogaInterface.cpp | 1 + amr-wind/physics/BoussinesqBubble.cpp | 1 + amr-wind/physics/BurggrafFlow.H | 2 +- amr-wind/physics/BurggrafFlow.cpp | 3 +- amr-wind/physics/ChannelFlow.cpp | 2 + amr-wind/physics/ConvectingTaylorVortex.cpp | 2 + amr-wind/physics/EkmanSpiral.cpp | 1 + amr-wind/physics/HybridRANSLESABL.cpp | 2 + amr-wind/physics/RayleighTaylor.cpp | 1 + amr-wind/physics/ScalarAdvection.cpp | 2 + amr-wind/physics/SyntheticTurbulence.cpp | 1 + amr-wind/physics/TaylorGreenVortex.cpp | 1 + amr-wind/physics/VortexDipole.cpp | 3 +- amr-wind/physics/VortexRing.cpp | 2 + amr-wind/physics/multiphase/BreakingWaves.cpp | 1 + amr-wind/physics/multiphase/DamBreak.cpp | 1 + amr-wind/physics/multiphase/MultiPhase.cpp | 6 +++ amr-wind/physics/multiphase/RainDrop.cpp | 2 + amr-wind/physics/multiphase/SloshingTank.cpp | 1 + amr-wind/physics/multiphase/VortexPatch.cpp | 3 ++ .../multiphase/VortexPatchScalarVel.cpp | 2 + amr-wind/physics/multiphase/ZalesakDisk.cpp | 3 ++ .../multiphase/ZalesakDiskScalarVel.cpp | 3 ++ amr-wind/physics/multiphase/hydrostatic_ops.H | 4 +- amr-wind/physics/udfs/UDF.cpp | 1 + .../incflo_apply_nodal_projection.cpp | 6 ++- amr-wind/transport_models/TwoPhaseTransport.H | 4 ++ amr-wind/turbulence/LES/AMD.H | 2 +- amr-wind/turbulence/LES/AMD.cpp | 1 + amr-wind/turbulence/LES/AMDNoTherm.H | 2 +- amr-wind/turbulence/LES/AMDNoTherm.cpp | 1 + amr-wind/turbulence/LES/Kosovic.cpp | 2 + amr-wind/turbulence/LES/OneEqKsgs.cpp | 3 ++ amr-wind/turbulence/LES/Smagorinsky.cpp | 1 + amr-wind/turbulence/RANS/KOmegaSST.cpp | 3 ++ amr-wind/turbulence/RANS/KOmegaSSTIDDES.cpp | 1 + amr-wind/utilities/MultiLevelVector.H | 2 +- amr-wind/utilities/averaging/ReAveraging.cpp | 1 + .../utilities/averaging/ReynoldsStress.cpp | 1 + .../utilities/sampling/DTUSpinnerSampler.H | 2 +- amr-wind/utilities/sampling/FreeSurface.cpp | 3 ++ amr-wind/utilities/sampling/LidarSampler.H | 2 +- .../utilities/sampling/SamplingContainer.cpp | 1 + .../utilities/tagging/CurvatureRefinement.cpp | 1 + .../utilities/tagging/FieldRefinement.cpp | 1 + .../tagging/GradientMagRefinement.cpp | 1 + .../utilities/tagging/OversetRefinement.cpp | 1 + .../tagging/QCriterionRefinement.cpp | 1 + .../tagging/VorticityMagRefinement.cpp | 1 + amr-wind/wind_energy/ABL.cpp | 1 + amr-wind/wind_energy/ABLBoundaryPlane.cpp | 2 + amr-wind/wind_energy/ABLFieldInit.cpp | 2 + amr-wind/wind_energy/ABLModulatedPowerLaw.cpp | 2 + amr-wind/wind_energy/ABLStats.cpp | 2 + .../actuator/ActuatorContainer.cpp | 1 + unit_tests/aw_test_utils/iter_tools.H | 2 + unit_tests/core/test_field_ops.cpp | 1 + .../test_icns_gravityforcing.cpp | 3 +- unit_tests/multiphase/test_mflux_schemes.cpp | 5 ++ unit_tests/multiphase/test_momflux.cpp | 1 + unit_tests/multiphase/test_vof_BCs.cpp | 2 + .../ocean_waves/test_relaxation_zones.cpp | 1 + .../projection/test_pressure_offset.cpp | 2 + unit_tests/turbulence/test_turbulence_LES.cpp | 4 ++ .../turbulence/test_turbulence_LES_bc.cpp | 2 + unit_tests/utilities/test_diagnostics.cpp | 2 + unit_tests/utilities/test_field_norms.cpp | 1 + unit_tests/utilities/test_free_surface.cpp | 3 ++ unit_tests/utilities/test_sampling.cpp | 1 + unit_tests/utilities/test_wave_energy.cpp | 2 + .../actuator/test_actuator_joukowsky_disk.cpp | 2 +- unit_tests/wind_energy/test_abl_init_ncf.cpp | 1 + 100 files changed, 225 insertions(+), 116 deletions(-) delete mode 100644 amr-wind/derive/CMakeLists.txt delete mode 100644 amr-wind/derive/field_algebra.cpp diff --git a/amr-wind/CMakeLists.txt b/amr-wind/CMakeLists.txt index cf1679aaa4..1757ceab0e 100644 --- a/amr-wind/CMakeLists.txt +++ b/amr-wind/CMakeLists.txt @@ -20,7 +20,6 @@ target_include_directories(${amr_wind_lib_name} PUBLIC add_subdirectory(core) add_subdirectory(boundary_conditions) add_subdirectory(convection) -add_subdirectory(derive) add_subdirectory(diffusion) add_subdirectory(projection) add_subdirectory(setup) diff --git a/amr-wind/core/Field.cpp b/amr-wind/core/Field.cpp index 1689123f31..fbc3cac535 100644 --- a/amr-wind/core/Field.cpp +++ b/amr-wind/core/Field.cpp @@ -391,22 +391,17 @@ void Field::to_uniform_space() noexcept // scale velocity to accommodate for mesh mapping -> U^bar = U * J/fac for (int lev = 0; lev < m_repo.num_active_levels(); ++lev) { - for (amrex::MFIter mfi(mesh_fac(lev)); mfi.isValid(); ++mfi) { - - amrex::Array4 const& field = operator()(lev).array( - mfi); - amrex::Array4 const& fac = - mesh_fac(lev).const_array(mfi); - amrex::Array4 const& detJ = - mesh_detJ(lev).const_array(mfi); - - amrex::ParallelFor( - mfi.growntilebox(), AMREX_SPACEDIM, - [=] AMREX_GPU_DEVICE(int i, int j, int k, int n) noexcept { - field(i, j, k, n) *= detJ(i, j, k) / fac(i, j, k, n); - }); - } + const auto& fac = mesh_fac(lev).const_arrays(); + const auto& detJ = mesh_detJ(lev).const_arrays(); + const auto& field = operator()(lev).arrays(); + amrex::ParallelFor( + mesh_fac(lev), amrex::IntVect(0), operator()(lev).nComp(), + [=] AMREX_GPU_DEVICE(int nbx, int i, int j, int k, int n) noexcept { + field[nbx](i, j, k, n) *= + detJ[nbx](i, j, k) / fac[nbx](i, j, k, n); + }); } + amrex::Gpu::synchronize(); m_mesh_mapped = true; } @@ -426,21 +421,18 @@ void Field::to_stretched_space() noexcept // scale field back to stretched mesh -> U = U^bar * fac/J for (int lev = 0; lev < m_repo.num_active_levels(); ++lev) { - for (amrex::MFIter mfi(mesh_fac(lev)); mfi.isValid(); ++mfi) { - amrex::Array4 const& field = operator()(lev).array( - mfi); - amrex::Array4 const& fac = - mesh_fac(lev).const_array(mfi); - amrex::Array4 const& detJ = - mesh_detJ(lev).const_array(mfi); - - amrex::ParallelFor( - mfi.growntilebox(), AMREX_SPACEDIM, - [=] AMREX_GPU_DEVICE(int i, int j, int k, int n) noexcept { - field(i, j, k, n) *= fac(i, j, k, n) / detJ(i, j, k); - }); - } + + const auto& fac = mesh_fac(lev).const_arrays(); + const auto& detJ = mesh_detJ(lev).const_arrays(); + const auto& field = operator()(lev).arrays(); + amrex::ParallelFor( + mesh_fac(lev), num_grow(), operator()(lev).nComp(), + [=] AMREX_GPU_DEVICE(int nbx, int i, int j, int k, int n) noexcept { + field[nbx](i, j, k, n) *= + fac[nbx](i, j, k, n) / detJ[nbx](i, j, k); + }); } + amrex::Gpu::synchronize(); m_mesh_mapped = false; } diff --git a/amr-wind/core/FieldFillPatchOps.H b/amr-wind/core/FieldFillPatchOps.H index 7f8b3fb98e..5d76e182ad 100644 --- a/amr-wind/core/FieldFillPatchOps.H +++ b/amr-wind/core/FieldFillPatchOps.H @@ -373,7 +373,7 @@ public: const auto& dbx = ori.isLow() ? amrex::adjCellLo(domain, idir, nghost[idir]) : amrex::adjCellHi(domain, idir, nghost[idir]); - + // needs openmp pragma? for (amrex::MFIter mfi(mfab); mfi.isValid(); ++mfi) { const auto& gbx = amrex::grow(mfi.validbox(), nghost); const auto& bx = gbx & dbx; diff --git a/amr-wind/core/field_ops.H b/amr-wind/core/field_ops.H index 43edfdf304..80cb5eb288 100644 --- a/amr-wind/core/field_ops.H +++ b/amr-wind/core/field_ops.H @@ -310,18 +310,15 @@ lower_bound(FType& field, const amrex::Real min_value, const int icomp = 0) const auto& repo = field.repo(); const int nlevels = repo.num_active_levels(); for (int lev = 0; lev < nlevels; ++lev) { - - for (amrex::MFIter mfi(field(lev)); mfi.isValid(); ++mfi) { - const auto& bx = mfi.tilebox(); - const auto& field_arr = field(lev).array(mfi); - - amrex::ParallelFor( - bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { - field_arr(i, j, k, icomp) = - amrex::max(min_value, field_arr(i, j, k, icomp)); - }); - } + const auto& farrs = field(lev).arrays(); + amrex::ParallelFor( + field(lev), + [=] AMREX_GPU_DEVICE(int nbx, int i, int j, int k) noexcept { + farrs[nbx](i, j, k, icomp) = + amrex::max(min_value, farrs[nbx](i, j, k, icomp)); + }); } + amrex::Gpu::synchronize(); } /** Computes the global maximum of a field from all levels @@ -378,28 +375,25 @@ inline void normalize(FType& field) const int nlevels = repo.num_active_levels(); for (int lev = 0; lev < nlevels; ++lev) { - - for (amrex::MFIter mfi(field(lev)); mfi.isValid(); ++mfi) { - const auto& bx = mfi.tilebox(); - const auto& field_arr = field(lev).array(mfi); - - amrex::ParallelFor( - bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { - // Compute magnitude - amrex::Real mag = 0.; + const auto& farrs = field(lev).arrays(); + amrex::ParallelFor( + field(lev), + [=] AMREX_GPU_DEVICE(int nbx, int i, int j, int k) noexcept { + auto farr = farrs[nbx]; + // Compute magnitude + amrex::Real mag = 0.; + for (int icomp = 0; icomp < ncomp; ++icomp) { + mag = mag + farr(i, j, k, icomp) * farr(i, j, k, icomp); + } + if (mag > eps) { for (int icomp = 0; icomp < ncomp; ++icomp) { - mag = mag + field_arr(i, j, k, icomp) * - field_arr(i, j, k, icomp); - } - if (mag > eps) { - for (int icomp = 0; icomp < ncomp; ++icomp) { - field_arr(i, j, k, icomp) = - field_arr(i, j, k, icomp) / std::sqrt(mag); - } + farr(i, j, k, icomp) = + farr(i, j, k, icomp) / std::sqrt(mag); } - }); - } + } + }); } + amrex::Gpu::synchronize(); } } // namespace amr_wind::field_ops diff --git a/amr-wind/derive/CMakeLists.txt b/amr-wind/derive/CMakeLists.txt deleted file mode 100644 index 031e498877..0000000000 --- a/amr-wind/derive/CMakeLists.txt +++ /dev/null @@ -1,5 +0,0 @@ -target_sources(${amr_wind_lib_name} - PRIVATE - #C++ - field_algebra.cpp - ) diff --git a/amr-wind/derive/field_algebra.cpp b/amr-wind/derive/field_algebra.cpp deleted file mode 100644 index 3688cc4b2f..0000000000 --- a/amr-wind/derive/field_algebra.cpp +++ /dev/null @@ -1,37 +0,0 @@ -#include "amr-wind/core/FieldRepo.H" -namespace amr_wind { - -template -void normalize_field(FType& Field) -{ - const auto& repo = Field.repo(); - const auto ncomp = Field.num_comp(); - - const int nlevels = repo.num_active_levels(); - for (int lev = 0; lev < nlevels; ++lev) { - for (amrex::MFIter mfi(Field(lev)); mfi.isValid(); ++mfi) { - const auto& bx = mfi.tilebox(); - const auto& field_arr = Field(lev).array(mfi); - - amrex::ParallelFor( - bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept { - amrex::Real mag = 0; - // Compute magnitude - for (int icomp = 0; icomp < ncomp; ++icomp) { - mag = mag + field_arr(i, j, k, icomp) * - field_arr(i, j, k, icomp); - } - // Normalize field - for (int icomp = 0; icomp < ncomp; ++icomp) { - field_arr(i, j, k, icomp) = - field_arr(i, j, k, icomp) / std::sqrt(mag); - } - }); - } - } -} - -template void normalize_field(Field&); -template void normalize_field(ScratchField&); - -} // namespace amr_wind diff --git a/amr-wind/diffusion/incflo_diffusion.cpp b/amr-wind/diffusion/incflo_diffusion.cpp index ca3280593d..7e8412213d 100644 --- a/amr-wind/diffusion/incflo_diffusion.cpp +++ b/amr-wind/diffusion/incflo_diffusion.cpp @@ -221,6 +221,7 @@ void viscosity_to_uniform_space( repo.get_mesh_mapping_detJ(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 const& mu = b[0].array(mfi); amrex::Array4 const& fac = @@ -235,6 +236,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 const& mu = b[1].array(mfi); amrex::Array4 const& fac = @@ -249,6 +251,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 const& mu = b[2].array(mfi); amrex::Array4 const& fac = diff --git a/amr-wind/equation_systems/CompRHSOps.H b/amr-wind/equation_systems/CompRHSOps.H index dfc012643f..7231bcab95 100644 --- a/amr-wind/equation_systems/CompRHSOps.H +++ b/amr-wind/equation_systems/CompRHSOps.H @@ -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); @@ -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); diff --git a/amr-wind/equation_systems/DiffusionOps.cpp b/amr-wind/equation_systems/DiffusionOps.cpp index d7cc281415..81e37bbca0 100644 --- a/amr-wind/equation_systems/DiffusionOps.cpp +++ b/amr-wind/equation_systems/DiffusionOps.cpp @@ -128,6 +128,7 @@ void DiffSolverIface::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(); diff --git a/amr-wind/equation_systems/PDEOps.H b/amr-wind/equation_systems/PDEOps.H index 6dcdd7e955..2e64d0f34d 100644 --- a/amr-wind/equation_systems/PDEOps.H +++ b/amr-wind/equation_systems/PDEOps.H @@ -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(); diff --git a/amr-wind/equation_systems/density/density_ops.H b/amr-wind/equation_systems/density/density_ops.H index d1e15eb7fd..fdd1b62bf9 100644 --- a/amr-wind/equation_systems/density/density_ops.H +++ b/amr-wind/equation_systems/density/density_ops.H @@ -30,6 +30,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 rho = field(lev).array(mfi); @@ -62,6 +63,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 rho = field(lev).array(mfi); diff --git a/amr-wind/equation_systems/icns/icns_advection.cpp b/amr-wind/equation_systems/icns/icns_advection.cpp index 6bffd88035..47f448991c 100644 --- a/amr-wind/equation_systems/icns/icns_advection.cpp +++ b/amr-wind/equation_systems/icns/icns_advection.cpp @@ -287,6 +287,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 const& u = u_mac(lev).array(mfi); amrex::Array4 const& rho = rho_face[0]->array(mfi); @@ -303,6 +305,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 const& v = v_mac(lev).array(mfi); amrex::Array4 const& rho = rho_face[1]->array(mfi); @@ -319,6 +323,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 const& w = w_mac(lev).array(mfi); amrex::Array4 const& rho = rho_face[2]->array(mfi); diff --git a/amr-wind/equation_systems/icns/icns_diffusion.H b/amr-wind/equation_systems/icns/icns_diffusion.H index 4f52206e1f..787a80ca2f 100644 --- a/amr-wind/equation_systems/icns/icns_diffusion.H +++ b/amr-wind/equation_systems/icns/icns_diffusion.H @@ -56,6 +56,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(); @@ -198,6 +199,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(); @@ -269,6 +271,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(); @@ -430,6 +433,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(); @@ -512,6 +516,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(); diff --git a/amr-wind/equation_systems/icns/icns_ops.H b/amr-wind/equation_systems/icns/icns_ops.H index 3b9ed88154..86d5b7690d 100644 --- a/amr-wind/equation_systems/icns/icns_ops.H +++ b/amr-wind/equation_systems/icns/icns_ops.H @@ -94,6 +94,7 @@ struct SrcTermOp : 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(); diff --git a/amr-wind/equation_systems/levelset/levelset_ops.H b/amr-wind/equation_systems/levelset/levelset_ops.H index 3b29b9299e..3742157acf 100644 --- a/amr-wind/equation_systems/levelset/levelset_ops.H +++ b/amr-wind/equation_systems/levelset/levelset_ops.H @@ -69,6 +69,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 phi = field(lev).array(mfi); @@ -101,6 +102,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 phi = field(lev).array(mfi); diff --git a/amr-wind/equation_systems/tke/tke_ops.H b/amr-wind/equation_systems/tke/tke_ops.H index c395100b1f..93f96bc8cc 100644 --- a/amr-wind/equation_systems/tke/tke_ops.H +++ b/amr-wind/equation_systems/tke/tke_ops.H @@ -42,6 +42,7 @@ struct PostSolveOp 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); diff --git a/amr-wind/equation_systems/vof/vof_hybridsolver_ops.H b/amr-wind/equation_systems/vof/vof_hybridsolver_ops.H index f22fa4ffc3..cb0a0ffd1f 100644 --- a/amr-wind/equation_systems/vof/vof_hybridsolver_ops.H +++ b/amr-wind/equation_systems/vof/vof_hybridsolver_ops.H @@ -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& native_flag = diff --git a/amr-wind/immersed_boundary/bluff_body/bluff_body_ops.cpp b/amr-wind/immersed_boundary/bluff_body/bluff_body_ops.cpp index 516de2f489..4e49f3438a 100644 --- a/amr-wind/immersed_boundary/bluff_body/bluff_body_ops.cpp +++ b/amr-wind/immersed_boundary/bluff_body/bluff_body_ops.cpp @@ -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); @@ -90,6 +91,7 @@ void apply_dirichlet_vel(CFDSim& sim, const amrex::Vector& 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); diff --git a/amr-wind/immersed_boundary/bluff_body/box_ops.H b/amr-wind/immersed_boundary/bluff_body/box_ops.H index 4c2175f7a0..1e70f7a325 100644 --- a/amr-wind/immersed_boundary/bluff_body/box_ops.H +++ b/amr-wind/immersed_boundary/bluff_body/box_ops.H @@ -59,6 +59,7 @@ struct InitDataOp 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); diff --git a/amr-wind/immersed_boundary/bluff_body/cylinder_ops.H b/amr-wind/immersed_boundary/bluff_body/cylinder_ops.H index 2002f661b6..46440c0c33 100644 --- a/amr-wind/immersed_boundary/bluff_body/cylinder_ops.H +++ b/amr-wind/immersed_boundary/bluff_body/cylinder_ops.H @@ -58,6 +58,7 @@ struct InitDataOp 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); diff --git a/amr-wind/immersed_boundary/bluff_body/sphere_ops.H b/amr-wind/immersed_boundary/bluff_body/sphere_ops.H index ec8fc94709..cda68c77ff 100644 --- a/amr-wind/immersed_boundary/bluff_body/sphere_ops.H +++ b/amr-wind/immersed_boundary/bluff_body/sphere_ops.H @@ -56,6 +56,7 @@ struct InitDataOp 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); diff --git a/amr-wind/mesh_mapping_models/ChannelFlowMap.cpp b/amr-wind/mesh_mapping_models/ChannelFlowMap.cpp index f56f85651c..843f3a1fc0 100644 --- a/amr-wind/mesh_mapping_models/ChannelFlowMap.cpp +++ b/amr-wind/mesh_mapping_models/ChannelFlowMap.cpp @@ -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(); @@ -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(); @@ -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(); @@ -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(); @@ -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) { diff --git a/amr-wind/mesh_mapping_models/ConstantMap.cpp b/amr-wind/mesh_mapping_models/ConstantMap.cpp index 56292e8d42..0184ccaa36 100644 --- a/amr-wind/mesh_mapping_models/ConstantMap.cpp +++ b/amr-wind/mesh_mapping_models/ConstantMap.cpp @@ -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(); @@ -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 const& scale_fac_xf = @@ -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 const& scale_fac_yf = @@ -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 const& scale_fac_zf = @@ -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) { diff --git a/amr-wind/ocean_waves/relaxation_zones/linear_waves_ops.H b/amr-wind/ocean_waves/relaxation_zones/linear_waves_ops.H index 7216815714..bd6cb11257 100644 --- a/amr-wind/ocean_waves/relaxation_zones/linear_waves_ops.H +++ b/amr-wind/ocean_waves/relaxation_zones/linear_waves_ops.H @@ -44,6 +44,7 @@ struct InitDataOp 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); @@ -125,6 +126,7 @@ struct UpdateRelaxZonesOp 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); diff --git a/amr-wind/ocean_waves/relaxation_zones/relaxation_zones_ops.cpp b/amr-wind/ocean_waves/relaxation_zones/relaxation_zones_ops.cpp index 0c88b5b55f..d2e1bbd890 100644 --- a/amr-wind/ocean_waves/relaxation_zones/relaxation_zones_ops.cpp +++ b/amr-wind/ocean_waves/relaxation_zones/relaxation_zones_ops.cpp @@ -64,6 +64,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& phi = ls.array(mfi); @@ -87,6 +88,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(); diff --git a/amr-wind/ocean_waves/relaxation_zones/stokes_waves_ops.H b/amr-wind/ocean_waves/relaxation_zones/stokes_waves_ops.H index 97ac6cdabd..384efe5754 100644 --- a/amr-wind/ocean_waves/relaxation_zones/stokes_waves_ops.H +++ b/amr-wind/ocean_waves/relaxation_zones/stokes_waves_ops.H @@ -83,6 +83,7 @@ struct InitDataOp 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); @@ -124,6 +125,7 @@ struct UpdateRelaxZonesOp 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); diff --git a/amr-wind/ocean_waves/relaxation_zones/waves2amr_ops.H b/amr-wind/ocean_waves/relaxation_zones/waves2amr_ops.H index c3332f5b69..68d18c5a75 100644 --- a/amr-wind/ocean_waves/relaxation_zones/waves2amr_ops.H +++ b/amr-wind/ocean_waves/relaxation_zones/waves2amr_ops.H @@ -82,6 +82,7 @@ void postprocess_velocity_mfab_liquid( amrex::MultiFab& lvs_mfab, const amrex::GpuArray 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); @@ -403,6 +404,7 @@ struct InitDataOp // 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); @@ -623,6 +625,7 @@ struct UpdateRelaxZonesOp // 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); diff --git a/amr-wind/overset/OversetOps.cpp b/amr-wind/overset/OversetOps.cpp index 31f2f1e94e..cfa8387593 100644 --- a/amr-wind/overset/OversetOps.cpp +++ b/amr-wind/overset/OversetOps.cpp @@ -58,6 +58,7 @@ void OversetOps::update_gradp() #ifdef AMREX_USE_OMP #pragma omp parallel if (Gpu::notInLaunchRegion()) #endif + // this one for (MFIter mfi(grad_p(lev), TilingIfNotGPU()); mfi.isValid(); ++mfi) { Box const& tbx = mfi.tilebox(); Array4 const& gp_lev = grad_p(lev).array(mfi); @@ -73,4 +74,4 @@ void OversetOps::update_gradp() // Averaging down here would be unnecessary; it is built into calcGradPhi } -} // namespace amr_wind \ No newline at end of file +} // namespace amr_wind diff --git a/amr-wind/overset/TiogaInterface.cpp b/amr-wind/overset/TiogaInterface.cpp index 59e42d414d..43eb1f383c 100644 --- a/amr-wind/overset/TiogaInterface.cpp +++ b/amr-wind/overset/TiogaInterface.cpp @@ -31,6 +31,7 @@ void iblank_to_mask(const IntField& iblank, IntField& maskf) #ifdef AMREX_USE_OMP #pragma omp parallel if (amrex::Gpu::notInLaunchRegion()) #endif + // this one for (amrex::MFIter mfi(ibl); mfi.isValid(); ++mfi) { const auto& gbx = mfi.growntilebox(); const auto& ibarr = ibl.const_array(mfi); diff --git a/amr-wind/physics/BoussinesqBubble.cpp b/amr-wind/physics/BoussinesqBubble.cpp index 444e42134d..c8dc9d67f8 100644 --- a/amr-wind/physics/BoussinesqBubble.cpp +++ b/amr-wind/physics/BoussinesqBubble.cpp @@ -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(); diff --git a/amr-wind/physics/BurggrafFlow.H b/amr-wind/physics/BurggrafFlow.H index 8ad89bfa0b..8438eaea94 100644 --- a/amr-wind/physics/BurggrafFlow.H +++ b/amr-wind/physics/BurggrafFlow.H @@ -56,7 +56,7 @@ public: void post_regrid_actions() override {} - void pre_advance_work() override{}; + void pre_advance_work() override {}; void post_advance_work() override; diff --git a/amr-wind/physics/BurggrafFlow.cpp b/amr-wind/physics/BurggrafFlow.cpp index 5399048308..c279370207 100644 --- a/amr-wind/physics/BurggrafFlow.cpp +++ b/amr-wind/physics/BurggrafFlow.cpp @@ -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(); @@ -181,4 +182,4 @@ void BurggrafFlow::post_init_actions() { output_error(); } void BurggrafFlow::post_advance_work() { output_error(); } -} // namespace amr_wind::burggraf \ No newline at end of file +} // namespace amr_wind::burggraf diff --git a/amr-wind/physics/ChannelFlow.cpp b/amr-wind/physics/ChannelFlow.cpp index f49d99e57e..ce6477b72d 100644 --- a/amr-wind/physics/ChannelFlow.cpp +++ b/amr-wind/physics/ChannelFlow.cpp @@ -148,6 +148,7 @@ void ChannelFlow::initialize_fields( const auto C0 = m_C0; const auto C1 = m_C1; const auto dpdx = m_dpdx; + // this one for (amrex::MFIter mfi(velocity); mfi.isValid(); ++mfi) { const auto& vbx = mfi.validbox(); auto vel = velocity.array(mfi); @@ -181,6 +182,7 @@ void ChannelFlow::initialize_fields( } auto& walldist = m_repo.get_field("wall_dist")(level); + // this one for (amrex::MFIter mfi(velocity); mfi.isValid(); ++mfi) { const auto& vbx = mfi.validbox(); auto vel = velocity.array(mfi); diff --git a/amr-wind/physics/ConvectingTaylorVortex.cpp b/amr-wind/physics/ConvectingTaylorVortex.cpp index 08f1822caa..e30499c7c9 100644 --- a/amr-wind/physics/ConvectingTaylorVortex.cpp +++ b/amr-wind/physics/ConvectingTaylorVortex.cpp @@ -156,6 +156,7 @@ void ConvectingTaylorVortex::initialize_fields( GpyExact gpy_exact; GpzExact gpz_exact; + // this one for (amrex::MFIter mfi(velocity); mfi.isValid(); ++mfi) { const auto& vbx = mfi.validbox(); @@ -240,6 +241,7 @@ amrex::Real ConvectingTaylorVortex::compute_error(const Field& field) } if (m_sim.has_overset()) { + // this one for (amrex::MFIter mfi(field(lev)); mfi.isValid(); ++mfi) { const auto& vbx = mfi.validbox(); diff --git a/amr-wind/physics/EkmanSpiral.cpp b/amr-wind/physics/EkmanSpiral.cpp index 25dda0ba95..c3bf5491c3 100644 --- a/amr-wind/physics/EkmanSpiral.cpp +++ b/amr-wind/physics/EkmanSpiral.cpp @@ -111,6 +111,7 @@ void EkmanSpiral::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(); diff --git a/amr-wind/physics/HybridRANSLESABL.cpp b/amr-wind/physics/HybridRANSLESABL.cpp index 94a20d2e50..a447365aaa 100644 --- a/amr-wind/physics/HybridRANSLESABL.cpp +++ b/amr-wind/physics/HybridRANSLESABL.cpp @@ -20,6 +20,7 @@ void HybridRANSLESABL::initialize_fields(int level, const amrex::Geometry& geom) const amrex::Real dz = geom.CellSize()[2]; const amrex::Real ds = std::cbrt(dx * dy * dz); + // this one for (amrex::MFIter mfi((*m_tke)(level)); mfi.isValid(); ++mfi) { const auto& bx = mfi.growntilebox(); const auto& tke_arr = (*m_tke)(level).array(mfi); @@ -88,6 +89,7 @@ void HybridRANSLESABL::compute_sdr_impl() const amrex::Real dz = geom.CellSize()[2]; const amrex::Real ds = std::cbrt(dx * dy * dz); + // this one for (amrex::MFIter mfi((*tke)(lev)); mfi.isValid(); ++mfi) { const auto& bx = mfi.growntilebox(); const auto& tke_arr = (*tke)(lev).array(mfi); diff --git a/amr-wind/physics/RayleighTaylor.cpp b/amr-wind/physics/RayleighTaylor.cpp index e0756f4fd8..1aa2d14e24 100644 --- a/amr-wind/physics/RayleighTaylor.cpp +++ b/amr-wind/physics/RayleighTaylor.cpp @@ -24,6 +24,7 @@ void RayleighTaylor::initialize_fields(int level, const amrex::Geometry& geom) velocity.setVal(0.0); + // needs openmp pragma? for (amrex::MFIter mfi(density); mfi.isValid(); ++mfi) { const auto& vbx = mfi.validbox(); diff --git a/amr-wind/physics/ScalarAdvection.cpp b/amr-wind/physics/ScalarAdvection.cpp index 93a1bcd71b..61206d295c 100644 --- a/amr-wind/physics/ScalarAdvection.cpp +++ b/amr-wind/physics/ScalarAdvection.cpp @@ -162,6 +162,7 @@ void ScalarAdvection::initialize_fields( auto& density = m_density(level); density.setVal(m_rho); + // this one for (amrex::MFIter mfi(velocity); mfi.isValid(); ++mfi) { const auto& vbx = mfi.validbox(); auto vel = velocity.array(mfi); @@ -215,6 +216,7 @@ void ScalarAdvection::initialize_scalar(const Shape& scalar_function) const auto& problo = m_repo.mesh().Geom(level).ProbLoArray(); auto& scalar = (*m_scalar)(level); + // this one for (amrex::MFIter mfi(scalar); mfi.isValid(); ++mfi) { const auto& dx = m_repo.mesh().Geom(level).CellSizeArray(); const auto& nbx = mfi.nodaltilebox(); diff --git a/amr-wind/physics/SyntheticTurbulence.cpp b/amr-wind/physics/SyntheticTurbulence.cpp index c76f75bf88..c3bc1904cd 100644 --- a/amr-wind/physics/SyntheticTurbulence.cpp +++ b/amr-wind/physics/SyntheticTurbulence.cpp @@ -574,6 +574,7 @@ void SyntheticTurbulence::update_impl( const auto& gauss_scaling = m_gauss_scaling; const auto& epsilon = m_epsilon; + // this one for (amrex::MFIter mfi(m_turb_force(lev)); mfi.isValid(); ++mfi) { const auto& bx = mfi.tilebox(); const auto& turb_force_arr = m_turb_force(lev).array(mfi); diff --git a/amr-wind/physics/TaylorGreenVortex.cpp b/amr-wind/physics/TaylorGreenVortex.cpp index 2de400cdda..ac17a6b399 100644 --- a/amr-wind/physics/TaylorGreenVortex.cpp +++ b/amr-wind/physics/TaylorGreenVortex.cpp @@ -32,6 +32,7 @@ void TaylorGreenVortex::initialize_fields( const amrex::Real Ly = probhi[1] - problo[1]; const amrex::Real Lz = probhi[2] - problo[2]; + // this one for (amrex::MFIter mfi(velocity); mfi.isValid(); ++mfi) { const auto& vbx = mfi.validbox(); const auto& dx = geom.CellSizeArray(); diff --git a/amr-wind/physics/VortexDipole.cpp b/amr-wind/physics/VortexDipole.cpp index 259b70697c..92f50ce4d0 100644 --- a/amr-wind/physics/VortexDipole.cpp +++ b/amr-wind/physics/VortexDipole.cpp @@ -36,6 +36,7 @@ void VortexDipole::initialize_fields(int level, const amrex::Geometry& geom) const auto& problo = geom.ProbLoArray(); + // this one for (amrex::MFIter mfi(velocity); mfi.isValid(); ++mfi) { const auto& vbx = mfi.validbox(); const auto& dx = geom.CellSizeArray(); @@ -74,4 +75,4 @@ void VortexDipole::initialize_fields(int level, const amrex::Geometry& geom) } } -} // namespace amr_wind \ No newline at end of file +} // namespace amr_wind diff --git a/amr-wind/physics/VortexRing.cpp b/amr-wind/physics/VortexRing.cpp index 49368852b2..962aefc130 100644 --- a/amr-wind/physics/VortexRing.cpp +++ b/amr-wind/physics/VortexRing.cpp @@ -164,6 +164,7 @@ void VortexRing::initialize_velocity(const VortexRingType& vorticity_theta) const auto& problo = m_repo.mesh().Geom(level).ProbLoArray(); + // this one for (amrex::MFIter mfi(m_velocity(level)); mfi.isValid(); ++mfi) { const auto& dx = m_repo.mesh().Geom(level).CellSizeArray(); const auto& nbx = mfi.nodaltilebox(); @@ -250,6 +251,7 @@ void VortexRing::initialize_velocity(const VortexRingType& vorticity_theta) for (int level = 0; level <= m_repo.mesh().finestLevel(); ++level) { auto& velocity = m_velocity(level); + // this one for (amrex::MFIter mfi(velocity); mfi.isValid(); ++mfi) { const auto& vbx = mfi.validbox(); diff --git a/amr-wind/physics/multiphase/BreakingWaves.cpp b/amr-wind/physics/multiphase/BreakingWaves.cpp index de203b33f0..a635135486 100644 --- a/amr-wind/physics/multiphase/BreakingWaves.cpp +++ b/amr-wind/physics/multiphase/BreakingWaves.cpp @@ -69,6 +69,7 @@ void BreakingWaves::initialize_fields(int level, const amrex::Geometry& geom) sdr.setVal(m_sdr0); } + // this one for (amrex::MFIter mfi(levelset); mfi.isValid(); ++mfi) { const auto& vbx = mfi.growntilebox(); auto vel = velocity.array(mfi); diff --git a/amr-wind/physics/multiphase/DamBreak.cpp b/amr-wind/physics/multiphase/DamBreak.cpp index 3ffa69ca7e..6bbd3071a7 100644 --- a/amr-wind/physics/multiphase/DamBreak.cpp +++ b/amr-wind/physics/multiphase/DamBreak.cpp @@ -42,6 +42,7 @@ void DamBreak::initialize_fields(int level, const amrex::Geometry& geom) const amrex::Real rho1 = mphase.rho1(); const amrex::Real rho2 = mphase.rho2(); + // this one for (amrex::MFIter mfi(levelset); mfi.isValid(); ++mfi) { const auto& vbx = mfi.validbox(); auto phi = levelset.array(mfi); diff --git a/amr-wind/physics/multiphase/MultiPhase.cpp b/amr-wind/physics/multiphase/MultiPhase.cpp index 33bb7140b0..23d1169acb 100644 --- a/amr-wind/physics/multiphase/MultiPhase.cpp +++ b/amr-wind/physics/multiphase/MultiPhase.cpp @@ -304,6 +304,7 @@ void MultiPhase::set_density_via_levelset() auto& density = m_density(lev); auto& levelset = (*m_levelset)(lev); + // this one for (amrex::MFIter mfi(density); mfi.isValid(); ++mfi) { const auto& vbx = mfi.validbox(); const auto& dx = geom[lev].CellSizeArray(); @@ -342,6 +343,7 @@ void MultiPhase::set_density_via_vof(amr_wind::FieldState fstate) auto& density = m_density.state(fstate)(lev); auto& vof = (*m_vof).state(fstate)(lev); + // this one for (amrex::MFIter mfi(density); mfi.isValid(); ++mfi) { const auto& vbx = mfi.validbox(); const amrex::Array4& F = vof.array(mfi); @@ -381,6 +383,7 @@ void MultiPhase::calculate_advected_facedensity() for (int lev = 0; lev < nlevels; ++lev) { + // this one for (amrex::MFIter mfi((*m_vof)(lev)); mfi.isValid(); ++mfi) { const auto& bx = mfi.tilebox(); const auto& bxg1 = amrex::grow(bx, 1); @@ -429,6 +432,7 @@ void MultiPhase::favre_filtering() auto& velocity = m_velocity(lev); auto& density = m_density(lev); + // this one for (amrex::MFIter mfi(velocity); mfi.isValid(); ++mfi) { const auto& bx = mfi.growntilebox(1); const amrex::Array4& vel = velocity.array(mfi); @@ -450,6 +454,7 @@ void MultiPhase::favre_filtering() auto& vof = (*m_vof)(lev); auto& mom_fil = (*momentum_filter)(lev); auto& rho_fil = (*density_filter)(lev); + // this one for (amrex::MFIter mfi(velocity); mfi.isValid(); ++mfi) { const auto& vbx = mfi.validbox(); const amrex::Array4& vel = velocity.array(mfi); @@ -480,6 +485,7 @@ void MultiPhase::levelset2vof() auto& vof = (*m_vof)(lev); const auto& dx = geom[lev].CellSizeArray(); + // this one for (amrex::MFIter mfi(levelset); mfi.isValid(); ++mfi) { const auto& vbx = mfi.validbox(); const amrex::Array4& phi = levelset.array(mfi); diff --git a/amr-wind/physics/multiphase/RainDrop.cpp b/amr-wind/physics/multiphase/RainDrop.cpp index fb1f36625b..b4895c5541 100644 --- a/amr-wind/physics/multiphase/RainDrop.cpp +++ b/amr-wind/physics/multiphase/RainDrop.cpp @@ -32,6 +32,7 @@ void RainDrop::initialize_fields(int level, const amrex::Geometry& geom) const amrex::Real yc = m_loc[1]; const amrex::Real zc = m_loc[2]; const amrex::Real radius = m_radius; + // this one for (amrex::MFIter mfi(velocity); mfi.isValid(); ++mfi) { const auto& vbx = mfi.validbox(); auto phi = levelset.array(mfi); @@ -69,6 +70,7 @@ void RainDrop::initialize_fields(int level, const amrex::Geometry& geom) amrex::Gpu::copy( amrex::Gpu::hostToDevice, m_vel.begin(), m_vel.end(), dvel.begin()); const auto* vptr = dvel.data(); + // this one for (amrex::MFIter mfi(velocity); mfi.isValid(); ++mfi) { const auto& vbx = mfi.validbox(); auto vel = velocity.array(mfi); diff --git a/amr-wind/physics/multiphase/SloshingTank.cpp b/amr-wind/physics/multiphase/SloshingTank.cpp index 7558141c7c..30a2f9c2c0 100644 --- a/amr-wind/physics/multiphase/SloshingTank.cpp +++ b/amr-wind/physics/multiphase/SloshingTank.cpp @@ -35,6 +35,7 @@ void SloshingTank::initialize_fields(int level, const amrex::Geometry& geom) const amrex::Real Lx = probhi[0] - problo[0]; const amrex::Real Ly = probhi[1] - problo[1]; + // this one for (amrex::MFIter mfi(levelset); mfi.isValid(); ++mfi) { const auto& vbx = mfi.validbox(); auto phi = levelset.array(mfi); diff --git a/amr-wind/physics/multiphase/VortexPatch.cpp b/amr-wind/physics/multiphase/VortexPatch.cpp index 03ee0f0f50..223afab541 100644 --- a/amr-wind/physics/multiphase/VortexPatch.cpp +++ b/amr-wind/physics/multiphase/VortexPatch.cpp @@ -45,6 +45,7 @@ void VortexPatch::initialize_fields(int level, const amrex::Geometry& geom) auto& v_mac = m_sim.repo().get_field("v_mac")(level); auto& w_mac = m_sim.repo().get_field("w_mac")(level); + // this one for (amrex::MFIter mfi(velocity); mfi.isValid(); ++mfi) { const auto& vbx = mfi.validbox(); auto uf = u_mac.array(mfi); @@ -117,6 +118,7 @@ void VortexPatch::pre_advance_work() auto& u_mac = m_sim.repo().get_field("u_mac")(lev); auto& v_mac = m_sim.repo().get_field("v_mac")(lev); auto& w_mac = m_sim.repo().get_field("w_mac")(lev); + // this one for (amrex::MFIter mfi(m_velocity(lev)); mfi.isValid(); ++mfi) { const auto& vbx = mfi.growntilebox(1); const auto& dx = geom[lev].CellSizeArray(); @@ -162,6 +164,7 @@ void VortexPatch::post_advance_work() // Overriding the velocity field for (int lev = 0; lev < nlevels; ++lev) { + // this one for (amrex::MFIter mfi(m_velocity(lev)); mfi.isValid(); ++mfi) { const auto& vbx = mfi.growntilebox(); const auto& dx = geom[lev].CellSizeArray(); diff --git a/amr-wind/physics/multiphase/VortexPatchScalarVel.cpp b/amr-wind/physics/multiphase/VortexPatchScalarVel.cpp index ec521a4237..9c8ec5a418 100644 --- a/amr-wind/physics/multiphase/VortexPatchScalarVel.cpp +++ b/amr-wind/physics/multiphase/VortexPatchScalarVel.cpp @@ -47,6 +47,7 @@ void VortexPatchScalarVel::initialize_fields( auto& v_mac = m_sim.repo().get_field("v_mac")(level); auto& w_mac = m_sim.repo().get_field("w_mac")(level); + // this one for (amrex::MFIter mfi(velocity); mfi.isValid(); ++mfi) { const auto& vbx = mfi.validbox(); auto uf = u_mac.array(mfi); @@ -128,6 +129,7 @@ void VortexPatchScalarVel::pre_advance_work() auto& u_mac = m_sim.repo().get_field("u_mac")(lev); auto& v_mac = m_sim.repo().get_field("v_mac")(lev); auto& w_mac = m_sim.repo().get_field("w_mac")(lev); + // this one for (amrex::MFIter mfi(m_velocity(lev)); mfi.isValid(); ++mfi) { const auto& vbx = mfi.growntilebox(1); const auto& dx = geom[lev].CellSizeArray(); diff --git a/amr-wind/physics/multiphase/ZalesakDisk.cpp b/amr-wind/physics/multiphase/ZalesakDisk.cpp index fee7728c23..20622276ad 100644 --- a/amr-wind/physics/multiphase/ZalesakDisk.cpp +++ b/amr-wind/physics/multiphase/ZalesakDisk.cpp @@ -50,6 +50,7 @@ void ZalesakDisk::initialize_fields(int level, const amrex::Geometry& geom) const amrex::Real width = m_width; const amrex::Real depth = m_depth; + // this one for (amrex::MFIter mfi(levelset); mfi.isValid(); ++mfi) { const auto& gbx = mfi.growntilebox(1); auto uf = u_mac.array(mfi); @@ -128,6 +129,7 @@ void ZalesakDisk::pre_advance_work() auto& u_mac = m_sim.repo().get_field("u_mac")(lev); auto& v_mac = m_sim.repo().get_field("v_mac")(lev); auto& w_mac = m_sim.repo().get_field("w_mac")(lev); + // this one for (amrex::MFIter mfi(m_velocity(lev)); mfi.isValid(); ++mfi) { const auto& gbx = mfi.growntilebox(1); const auto& dx = geom[lev].CellSizeArray(); @@ -160,6 +162,7 @@ void ZalesakDisk::post_advance_work() // Overriding the velocity field for (int lev = 0; lev < nlevels; ++lev) { + // this one for (amrex::MFIter mfi(m_velocity(lev)); mfi.isValid(); ++mfi) { const auto& vbx = mfi.validbox(); const auto& dx = geom[lev].CellSizeArray(); diff --git a/amr-wind/physics/multiphase/ZalesakDiskScalarVel.cpp b/amr-wind/physics/multiphase/ZalesakDiskScalarVel.cpp index 83593438b2..e36ec39b7d 100644 --- a/amr-wind/physics/multiphase/ZalesakDiskScalarVel.cpp +++ b/amr-wind/physics/multiphase/ZalesakDiskScalarVel.cpp @@ -83,6 +83,7 @@ void ZalesakDiskScalarVel::initialize_fields( const amrex::Real width = m_width; const amrex::Real depth = m_depth; + // this one for (amrex::MFIter mfi(levelset); mfi.isValid(); ++mfi) { const auto& gbx = mfi.growntilebox(1); auto uf = u_mac.array(mfi); @@ -170,6 +171,7 @@ void ZalesakDiskScalarVel::pre_advance_work() auto& u_mac = m_sim.repo().get_field("u_mac")(lev); auto& v_mac = m_sim.repo().get_field("v_mac")(lev); auto& w_mac = m_sim.repo().get_field("w_mac")(lev); + // this one for (amrex::MFIter mfi(m_velocity(lev)); mfi.isValid(); ++mfi) { const auto& gbx = mfi.growntilebox(1); const auto& dx = geom[lev].CellSizeArray(); @@ -235,6 +237,7 @@ amrex::Real ZalesakDiskScalarVel::compute_error(const Field& field) } if (m_sim.has_overset()) { + // this one for (amrex::MFIter mfi(field(lev)); mfi.isValid(); ++mfi) { const auto& vbx = mfi.validbox(); diff --git a/amr-wind/physics/multiphase/hydrostatic_ops.H b/amr-wind/physics/multiphase/hydrostatic_ops.H index 4f4eeb1942..8840d2979b 100644 --- a/amr-wind/physics/multiphase/hydrostatic_ops.H +++ b/amr-wind/physics/multiphase/hydrostatic_ops.H @@ -15,6 +15,7 @@ static void define_rho0( for (int lev = 0; lev < rho0.repo().num_active_levels(); ++lev) { const auto& dx = geom[lev].CellSizeArray(); const auto& problo = geom[lev].ProbLoArray(); + // this one for (amrex::MFIter mfi(rho0(lev)); mfi.isValid(); ++mfi) { amrex::Box const& bx = mfi.validbox(); auto rho0_arr = rho0(lev).array(mfi); @@ -41,6 +42,7 @@ static void define_p0( const auto& dx = geom[lev].CellSizeArray(); const auto& problo = geom[lev].ProbLoArray(); const auto& probhi = geom[lev].ProbHiArray(); + // this one for (amrex::MFIter mfi(p0(lev)); mfi.isValid(); ++mfi) { amrex::Box const& nbx = mfi.grownnodaltilebox(); auto p0_arr = p0(lev).array(mfi); @@ -67,4 +69,4 @@ static void define_p0( } // namespace amr_wind::hydrostatic -#endif \ No newline at end of file +#endif diff --git a/amr-wind/physics/udfs/UDF.cpp b/amr-wind/physics/udfs/UDF.cpp index 5372b27976..cd334fcd00 100644 --- a/amr-wind/physics/udfs/UDF.cpp +++ b/amr-wind/physics/udfs/UDF.cpp @@ -45,6 +45,7 @@ void UDFImpl::operator()(int level, const amrex::Geometry& geom) const amrex::Real time = 0.0; const auto ncomp = m_field.num_comp(); const auto& dop = m_op.device_instance(); + // this one for (amrex::MFIter mfi(mfab); mfi.isValid(); ++mfi) { const auto& bx = mfi.tilebox(); const auto& marr = mfab.array(mfi); diff --git a/amr-wind/projection/incflo_apply_nodal_projection.cpp b/amr-wind/projection/incflo_apply_nodal_projection.cpp index fe1cac1bfc..c773635395 100644 --- a/amr-wind/projection/incflo_apply_nodal_projection.cpp +++ b/amr-wind/projection/incflo_apply_nodal_projection.cpp @@ -173,6 +173,7 @@ void incflo::ApplyProjection( #ifdef AMREX_USE_OMP #pragma omp parallel if (Gpu::notInLaunchRegion()) #endif + // this one for (MFIter mfi(velocity(lev), TilingIfNotGPU()); mfi.isValid(); ++mfi) { Box const& bx = mfi.tilebox(); @@ -215,6 +216,7 @@ void incflo::ApplyProjection( Factory(lev)); // At the moment set it to zero surf_tens_force.setVal(0.0); + // this one for (MFIter mfi(velocity(lev), TilingIfNotGPU()); mfi.isValid(); ++mfi) { Box const& bx = mfi.tilebox(); @@ -264,6 +266,7 @@ void incflo::ApplyProjection( #ifdef AMREX_USE_OMP #pragma omp parallel if (Gpu::notInLaunchRegion()) #endif + // this one for (MFIter mfi(sigma[lev], TilingIfNotGPU()); mfi.isValid(); ++mfi) { Box const& bx = mfi.tilebox(); @@ -416,6 +419,7 @@ void incflo::ApplyProjection( #ifdef AMREX_USE_OMP #pragma omp parallel if (Gpu::notInLaunchRegion()) #endif + // this one for (MFIter mfi(grad_p(lev), TilingIfNotGPU()); mfi.isValid(); ++mfi) { Box const& tbx = mfi.tilebox(); Box const& nbx = mfi.nodaltilebox(); @@ -469,4 +473,4 @@ void incflo::ApplyProjection( PrintMaxValues("after projection"); } } -} \ No newline at end of file +} diff --git a/amr-wind/transport_models/TwoPhaseTransport.H b/amr-wind/transport_models/TwoPhaseTransport.H index 28ee096e9d..2a26efb6c4 100644 --- a/amr-wind/transport_models/TwoPhaseTransport.H +++ b/amr-wind/transport_models/TwoPhaseTransport.H @@ -82,6 +82,7 @@ public: const auto& vof = m_repo.get_field("vof"); for (int lev = 0; lev < m_repo.num_active_levels(); ++lev) { + // this one for (amrex::MFIter mfi((*mu)(lev)); mfi.isValid(); ++mfi) { const auto& vbx = mfi.growntilebox(); const auto& volfrac = vof(lev).const_array(mfi); @@ -103,6 +104,7 @@ public: const auto& geom = m_repo.mesh().Geom(); for (int lev = 0; lev < m_repo.num_active_levels(); ++lev) { + // this one for (amrex::MFIter mfi((*mu)(lev)); mfi.isValid(); ++mfi) { const auto& vbx = mfi.growntilebox(); const auto& dx = geom[lev].CellSizeArray(); @@ -147,6 +149,7 @@ public: const auto& vof = m_repo.get_field("vof"); for (int lev = 0; lev < m_repo.num_active_levels(); ++lev) { + // this one for (amrex::MFIter mfi((*alpha)(lev)); mfi.isValid(); ++mfi) { const auto& vbx = mfi.growntilebox(); const auto& volfrac = vof(lev).const_array(mfi); @@ -171,6 +174,7 @@ public: const auto& geom = m_repo.mesh().Geom(); for (int lev = 0; lev < m_repo.num_active_levels(); ++lev) { + // this one for (amrex::MFIter mfi((*alpha)(lev)); mfi.isValid(); ++mfi) { const auto& vbx = mfi.growntilebox(); const auto& dx = geom[lev].CellSizeArray(); diff --git a/amr-wind/turbulence/LES/AMD.H b/amr-wind/turbulence/LES/AMD.H index 3402b14736..22579573ce 100644 --- a/amr-wind/turbulence/LES/AMD.H +++ b/amr-wind/turbulence/LES/AMD.H @@ -43,7 +43,7 @@ public: void parse_model_coeffs() override; //! No post advance work for this model - void post_advance_work() override{}; + void post_advance_work() override {}; private: //! Poincare coefficient (default value set for 2nd order AMR-wind diff --git a/amr-wind/turbulence/LES/AMD.cpp b/amr-wind/turbulence/LES/AMD.cpp index 968471ed81..f48ffa038e 100644 --- a/amr-wind/turbulence/LES/AMD.cpp +++ b/amr-wind/turbulence/LES/AMD.cpp @@ -140,6 +140,7 @@ void AMD::update_alphaeff(Field& alphaeff) const auto& geom = geom_vec[lev]; const auto& dx = geom.CellSizeArray(); + // this one for (amrex::MFIter mfi(alphaeff(lev)); mfi.isValid(); ++mfi) { const auto& bx = mfi.tilebox(); const auto& gradVel_arr = (*gradVel)(lev).const_array(mfi); diff --git a/amr-wind/turbulence/LES/AMDNoTherm.H b/amr-wind/turbulence/LES/AMDNoTherm.H index e937bfdbbf..21523fb1d3 100644 --- a/amr-wind/turbulence/LES/AMDNoTherm.H +++ b/amr-wind/turbulence/LES/AMDNoTherm.H @@ -38,7 +38,7 @@ public: void parse_model_coeffs() override; //! No post advance work for this model - void post_advance_work() override{}; + void post_advance_work() override {}; private: //! Poincare coefficient (default value set for 2nd order AMR-wind diff --git a/amr-wind/turbulence/LES/AMDNoTherm.cpp b/amr-wind/turbulence/LES/AMDNoTherm.cpp index 310aac57f3..2da4c6c748 100644 --- a/amr-wind/turbulence/LES/AMDNoTherm.cpp +++ b/amr-wind/turbulence/LES/AMDNoTherm.cpp @@ -50,6 +50,7 @@ void AMDNoTherm::update_turbulent_viscosity( const auto& geom = geom_vec[lev]; const auto& dx = geom.CellSizeArray(); + // this one for (amrex::MFIter mfi(mu_turb(lev)); mfi.isValid(); ++mfi) { const auto& bx = mfi.tilebox(); const auto& gradVel_arr = (*gradVel)(lev).array(mfi); diff --git a/amr-wind/turbulence/LES/Kosovic.cpp b/amr-wind/turbulence/LES/Kosovic.cpp index 13f975c87c..783f5a76f2 100644 --- a/amr-wind/turbulence/LES/Kosovic.cpp +++ b/amr-wind/turbulence/LES/Kosovic.cpp @@ -78,6 +78,7 @@ void Kosovic::update_turbulent_viscosity( const amrex::Real locSurfaceRANSExp = m_surfaceRANSExp; const amrex::Real locSurfaceFactor = m_surfaceFactor; const amrex::Real locC1 = m_C1; + // this one for (amrex::MFIter mfi(mu_turb(lev)); mfi.isValid(); ++mfi) { const auto& bx = mfi.tilebox(); const auto& mu_arr = mu_turb(lev).array(mfi); @@ -128,6 +129,7 @@ void Kosovic::update_alphaeff(Field& alphaeff) const amrex::Real muCoeff = (m_refMOL < 0) ? 3 : 1; const int nlevels = repo.num_active_levels(); for (int lev = 0; lev < nlevels; ++lev) { + // this one for (amrex::MFIter mfi(mu_turb(lev)); mfi.isValid(); ++mfi) { const auto& bx = mfi.tilebox(); const auto& muturb_arr = mu_turb(lev).array(mfi); diff --git a/amr-wind/turbulence/LES/OneEqKsgs.cpp b/amr-wind/turbulence/LES/OneEqKsgs.cpp index da1c6653e4..83d25ff0eb 100644 --- a/amr-wind/turbulence/LES/OneEqKsgs.cpp +++ b/amr-wind/turbulence/LES/OneEqKsgs.cpp @@ -118,6 +118,7 @@ void OneEqKsgsM84::update_turbulent_viscosity( const amrex::Real dz = geom.CellSize()[2]; const amrex::Real ds = std::cbrt(dx * dy * dz); + // this one for (amrex::MFIter mfi(mu_turb(lev)); mfi.isValid(); ++mfi) { const auto& bx = mfi.tilebox(); const auto& mu_arr = mu_turb(lev).array(mfi); @@ -181,6 +182,7 @@ void OneEqKsgsM84::update_alphaeff(Field& alphaeff) const amrex::Real dz = geom.CellSize()[2]; const amrex::Real ds = std::cbrt(dx * dy * dz); + // this one for (amrex::MFIter mfi(mu_turb(lev)); mfi.isValid(); ++mfi) { const auto& bx = mfi.tilebox(); const auto& muturb_arr = mu_turb(lev).array(mfi); @@ -247,6 +249,7 @@ void OneEqKsgsM84::post_advance_work() const amrex::Real dz = geom.CellSize()[2]; const amrex::Real ds = std::cbrt(dx * dy * dz); + // this one for (amrex::MFIter mfi(tke(lev)); mfi.isValid(); ++mfi) { const auto& bx = mfi.growntilebox(); const auto& tke_arr = tke(lev).array(mfi); diff --git a/amr-wind/turbulence/LES/Smagorinsky.cpp b/amr-wind/turbulence/LES/Smagorinsky.cpp index ec5c75718d..6ea54d3c3d 100644 --- a/amr-wind/turbulence/LES/Smagorinsky.cpp +++ b/amr-wind/turbulence/LES/Smagorinsky.cpp @@ -47,6 +47,7 @@ void Smagorinsky::update_turbulent_viscosity( const amrex::Real ds_sqr = ds * ds; const amrex::Real smag_factor = Cs_sqr * ds_sqr; + // this one for (amrex::MFIter mfi(mu_turb(lev)); mfi.isValid(); ++mfi) { const auto& bx = mfi.tilebox(); const auto& mu_arr = mu_turb(lev).array(mfi); diff --git a/amr-wind/turbulence/RANS/KOmegaSST.cpp b/amr-wind/turbulence/RANS/KOmegaSST.cpp index 2c74f34aa9..b839aac893 100644 --- a/amr-wind/turbulence/RANS/KOmegaSST.cpp +++ b/amr-wind/turbulence/RANS/KOmegaSST.cpp @@ -113,6 +113,7 @@ void KOmegaSST::update_turbulent_viscosity( const int nlevels = repo.num_active_levels(); for (int lev = 0; lev < nlevels; ++lev) { + // this one for (amrex::MFIter mfi(mu_turb(lev)); mfi.isValid(); ++mfi) { const auto& bx = mfi.tilebox(); const auto& lam_mu_arr = (*lam_mu)(lev).array(mfi); @@ -281,6 +282,7 @@ void KOmegaSST::update_scalar_diff( const auto& repo = deff.repo(); const int nlevels = repo.num_active_levels(); for (int lev = 0; lev < nlevels; ++lev) { + // this one for (amrex::MFIter mfi(deff(lev)); mfi.isValid(); ++mfi) { const auto& bx = mfi.tilebox(); const auto& lam_mu_arr = (*lam_mu)(lev).array(mfi); @@ -304,6 +306,7 @@ void KOmegaSST::update_scalar_diff( const auto& repo = deff.repo(); const int nlevels = repo.num_active_levels(); for (int lev = 0; lev < nlevels; ++lev) { + // this one for (amrex::MFIter mfi(deff(lev)); mfi.isValid(); ++mfi) { const auto& bx = mfi.tilebox(); const auto& lam_mu_arr = (*lam_mu)(lev).array(mfi); diff --git a/amr-wind/turbulence/RANS/KOmegaSSTIDDES.cpp b/amr-wind/turbulence/RANS/KOmegaSSTIDDES.cpp index 47a898dc23..9f3836a886 100644 --- a/amr-wind/turbulence/RANS/KOmegaSSTIDDES.cpp +++ b/amr-wind/turbulence/RANS/KOmegaSSTIDDES.cpp @@ -130,6 +130,7 @@ void KOmegaSSTIDDES::update_turbulent_viscosity( const amrex::Real hmax = amrex::max(amrex::max(dx, dy), dz); + // this one for (amrex::MFIter mfi(mu_turb(lev)); mfi.isValid(); ++mfi) { const auto& bx = mfi.tilebox(); const auto& lam_mu_arr = (*lam_mu)(lev).array(mfi); diff --git a/amr-wind/utilities/MultiLevelVector.H b/amr-wind/utilities/MultiLevelVector.H index 3186ed4aff..e4482f088d 100644 --- a/amr-wind/utilities/MultiLevelVector.H +++ b/amr-wind/utilities/MultiLevelVector.H @@ -22,7 +22,7 @@ namespace amr_wind { class MultiLevelVector { public: - MultiLevelVector(const FieldLoc floc = FieldLoc::CELL) : m_floc(floc){}; + MultiLevelVector(const FieldLoc floc = FieldLoc::CELL) : m_floc(floc) {}; void resize(const int axis, const amrex::Vector& geom); diff --git a/amr-wind/utilities/averaging/ReAveraging.cpp b/amr-wind/utilities/averaging/ReAveraging.cpp index 677640869f..a9d853cd11 100644 --- a/amr-wind/utilities/averaging/ReAveraging.cpp +++ b/amr-wind/utilities/averaging/ReAveraging.cpp @@ -61,6 +61,7 @@ void ReAveraging::operator()( #ifdef AMREX_USE_OMP #pragma omp parallel if (amrex::Gpu::notInLaunchRegion()) #endif + // this one for (amrex::MFIter mfi(ffab, amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi) { const auto& bx = mfi.tilebox(); diff --git a/amr-wind/utilities/averaging/ReynoldsStress.cpp b/amr-wind/utilities/averaging/ReynoldsStress.cpp index 42a8590abf..cb28b919c6 100644 --- a/amr-wind/utilities/averaging/ReynoldsStress.cpp +++ b/amr-wind/utilities/averaging/ReynoldsStress.cpp @@ -78,6 +78,7 @@ void ReynoldsStress::operator()( #ifdef AMREX_USE_OMP #pragma omp parallel if (amrex::Gpu::notInLaunchRegion()) #endif + // this one for (amrex::MFIter mfi(ffab, amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi) { const auto& bx = mfi.tilebox(); diff --git a/amr-wind/utilities/sampling/DTUSpinnerSampler.H b/amr-wind/utilities/sampling/DTUSpinnerSampler.H index db26a7ca6a..f8ffc36406 100644 --- a/amr-wind/utilities/sampling/DTUSpinnerSampler.H +++ b/amr-wind/utilities/sampling/DTUSpinnerSampler.H @@ -62,7 +62,7 @@ public: */ void update_sampling_locations() override; - void post_sample_actions() override{}; + void post_sample_actions() override {}; long num_points() const override { return (m_beam_points * m_ntotal); } diff --git a/amr-wind/utilities/sampling/FreeSurface.cpp b/amr-wind/utilities/sampling/FreeSurface.cpp index 226a5d1f93..81e07ddc9c 100644 --- a/amr-wind/utilities/sampling/FreeSurface.cpp +++ b/amr-wind/utilities/sampling/FreeSurface.cpp @@ -239,6 +239,7 @@ void FreeSurface::initialize() geom.ProbLoArray(); const amrex::GpuArray phi = geom.ProbHiArray(); + // this one for (amrex::MFIter mfi(floc(lev)); mfi.isValid(); ++mfi) { auto loc_arr = floc(lev).array(mfi); auto idx_arr = fidx(lev).array(mfi); @@ -391,6 +392,7 @@ void FreeSurface::post_advance_work() geom.InvCellSizeArray(); const amrex::GpuArray plo = geom.ProbLoArray(); + // this one for (amrex::MFIter mfi(floc(lev)); mfi.isValid(); ++mfi) { auto loc_arr = floc(lev).const_array(mfi); auto idx_arr = fidx(lev).const_array(mfi); @@ -567,6 +569,7 @@ void FreeSurface::post_regrid_actions() geom.ProbLoArray(); const amrex::GpuArray phi = geom.ProbHiArray(); + // this one for (amrex::MFIter mfi(floc(lev)); mfi.isValid(); ++mfi) { auto loc_arr = floc(lev).array(mfi); auto idx_arr = fidx(lev).array(mfi); diff --git a/amr-wind/utilities/sampling/LidarSampler.H b/amr-wind/utilities/sampling/LidarSampler.H index 80913b7a0a..0fe142cbfc 100644 --- a/amr-wind/utilities/sampling/LidarSampler.H +++ b/amr-wind/utilities/sampling/LidarSampler.H @@ -35,7 +35,7 @@ public: */ void update_sampling_locations() override; - void post_sample_actions() override{}; + void post_sample_actions() override {}; void define_netcdf_metadata(const ncutils::NCGroup& /*unused*/) const override; diff --git a/amr-wind/utilities/sampling/SamplingContainer.cpp b/amr-wind/utilities/sampling/SamplingContainer.cpp index 3a78aae09d..d8a4605e0d 100644 --- a/amr-wind/utilities/sampling/SamplingContainer.cpp +++ b/amr-wind/utilities/sampling/SamplingContainer.cpp @@ -84,6 +84,7 @@ void SamplingContainer::setup_container( const int nlevels = m_mesh.finestLevel() + 1; for (int lev = 0; lev < nlevels; ++lev) { + // needs openmp pragma? for (amrex::MFIter mfi = MakeMFIter(lev); mfi.isValid(); ++mfi) { DefineAndReturnParticleTile(lev, mfi.index(), mfi.LocalTileIndex()); } diff --git a/amr-wind/utilities/tagging/CurvatureRefinement.cpp b/amr-wind/utilities/tagging/CurvatureRefinement.cpp index 268ffa99ab..f77894b8d2 100644 --- a/amr-wind/utilities/tagging/CurvatureRefinement.cpp +++ b/amr-wind/utilities/tagging/CurvatureRefinement.cpp @@ -56,6 +56,7 @@ void CurvatureRefinement::operator()( #ifdef AMREX_USE_OMP #pragma omp parallel if (amrex::Gpu::notInLaunchRegion()) #endif + // this one for (amrex::MFIter mfi(mfab, amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi) { const auto& bx = mfi.tilebox(); diff --git a/amr-wind/utilities/tagging/FieldRefinement.cpp b/amr-wind/utilities/tagging/FieldRefinement.cpp index 126eec0b13..9cf92181aa 100644 --- a/amr-wind/utilities/tagging/FieldRefinement.cpp +++ b/amr-wind/utilities/tagging/FieldRefinement.cpp @@ -70,6 +70,7 @@ void FieldRefinement::operator()( #ifdef AMREX_USE_OMP #pragma omp parallel if (amrex::Gpu::notInLaunchRegion()) #endif + // this one for (amrex::MFIter mfi(mfab, amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi) { const auto& bx = mfi.tilebox(); diff --git a/amr-wind/utilities/tagging/GradientMagRefinement.cpp b/amr-wind/utilities/tagging/GradientMagRefinement.cpp index b1af1ca1d4..a367729753 100644 --- a/amr-wind/utilities/tagging/GradientMagRefinement.cpp +++ b/amr-wind/utilities/tagging/GradientMagRefinement.cpp @@ -56,6 +56,7 @@ void GradientMagRefinement::operator()( #ifdef AMREX_USE_OMP #pragma omp parallel if (amrex::Gpu::notInLaunchRegion()) #endif + // this one for (amrex::MFIter mfi(mfab, amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi) { const auto& bx = mfi.tilebox(); diff --git a/amr-wind/utilities/tagging/OversetRefinement.cpp b/amr-wind/utilities/tagging/OversetRefinement.cpp index 475603ef72..cf5b7be8ac 100644 --- a/amr-wind/utilities/tagging/OversetRefinement.cpp +++ b/amr-wind/utilities/tagging/OversetRefinement.cpp @@ -34,6 +34,7 @@ void OversetRefinement::operator()( #ifdef AMREX_USE_OMP #pragma omp parallel if (amrex::Gpu::notInLaunchRegion()) #endif + // this one for (amrex::MFIter mfi(ibfab, amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi) { const auto& bx = mfi.tilebox(); diff --git a/amr-wind/utilities/tagging/QCriterionRefinement.cpp b/amr-wind/utilities/tagging/QCriterionRefinement.cpp index f7bbd4b0d8..20ed7c7001 100644 --- a/amr-wind/utilities/tagging/QCriterionRefinement.cpp +++ b/amr-wind/utilities/tagging/QCriterionRefinement.cpp @@ -64,6 +64,7 @@ void QCriterionRefinement::operator()( #ifdef AMREX_USE_OMP #pragma omp parallel if (amrex::Gpu::notInLaunchRegion()) #endif + // this one for (amrex::MFIter mfi(mfab, amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi) { const auto& bx = mfi.tilebox(); diff --git a/amr-wind/utilities/tagging/VorticityMagRefinement.cpp b/amr-wind/utilities/tagging/VorticityMagRefinement.cpp index 5544587330..fe1797cf10 100644 --- a/amr-wind/utilities/tagging/VorticityMagRefinement.cpp +++ b/amr-wind/utilities/tagging/VorticityMagRefinement.cpp @@ -60,6 +60,7 @@ void VorticityMagRefinement::operator()( #ifdef AMREX_USE_OMP #pragma omp parallel if (amrex::Gpu::notInLaunchRegion()) #endif + // this one for (amrex::MFIter mfi(mfab, amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi) { const auto& bx = mfi.tilebox(); diff --git a/amr-wind/wind_energy/ABL.cpp b/amr-wind/wind_energy/ABL.cpp index c1873f36ba..8a7ae8f239 100644 --- a/amr-wind/wind_energy/ABL.cpp +++ b/amr-wind/wind_energy/ABL.cpp @@ -106,6 +106,7 @@ void ABL::initialize_fields(int level, const amrex::Geometry& geom) } bool interp_fine_levels = false; + // needs openmp pragma? for (amrex::MFIter mfi(density); mfi.isValid(); ++mfi) { const auto& vbx = mfi.validbox(); diff --git a/amr-wind/wind_energy/ABLBoundaryPlane.cpp b/amr-wind/wind_energy/ABLBoundaryPlane.cpp index 4b55970276..497e149ce9 100644 --- a/amr-wind/wind_energy/ABLBoundaryPlane.cpp +++ b/amr-wind/wind_energy/ABLBoundaryPlane.cpp @@ -170,6 +170,7 @@ void InletData::read_data_native( bndry_n[ori].boxArray(), bndry_n[ori].DistributionMap(), bndry_n[ori].nComp(), 0, amrex::MFInfo()); + // needs openmp pragma? for (amrex::MFIter mfi(bndry); mfi.isValid(); ++mfi) { const auto& vbx = mfi.validbox(); @@ -193,6 +194,7 @@ void InletData::read_data_native( bndry.copyTo((*m_data_n[ori])[lev], 0, nstart, static_cast(nc)); + // needs openmp pragma? for (amrex::MFIter mfi(bndry); mfi.isValid(); ++mfi) { const auto& vbx = mfi.validbox(); const auto& bndry_np1_arr = bndry_np1[ori].array(mfi); diff --git a/amr-wind/wind_energy/ABLFieldInit.cpp b/amr-wind/wind_energy/ABLFieldInit.cpp index 97d0639912..134859ae85 100644 --- a/amr-wind/wind_energy/ABLFieldInit.cpp +++ b/amr-wind/wind_energy/ABLFieldInit.cpp @@ -299,6 +299,7 @@ void ABLFieldInit::perturb_temperature( #ifdef AMREX_USE_OMP #pragma omp parallel if (amrex::Gpu::notInLaunchRegion()) #endif + // this one for (amrex::MFIter mfi(theta_fab, amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi) { const auto& bx = mfi.tilebox(); @@ -336,6 +337,7 @@ void ABLFieldInit::init_tke( #ifdef AMREX_USE_OMP #pragma omp parallel if (amrex::Gpu::notInLaunchRegion()) #endif + // this one for (amrex::MFIter mfi(tke_fab, amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi) { const auto& bx = mfi.tilebox(); diff --git a/amr-wind/wind_energy/ABLModulatedPowerLaw.cpp b/amr-wind/wind_energy/ABLModulatedPowerLaw.cpp index a5b0a21dba..f990de1f09 100644 --- a/amr-wind/wind_energy/ABLModulatedPowerLaw.cpp +++ b/amr-wind/wind_energy/ABLModulatedPowerLaw.cpp @@ -172,6 +172,7 @@ void ABLModulatedPowerLaw::set_velocity( const auto& dbx = ori.isLow() ? amrex::adjCellLo(domain, idir, nghost) : amrex::adjCellHi(domain, idir, nghost); + // needs openmp pragma? for (amrex::MFIter mfi(mfab); mfi.isValid(); ++mfi) { auto gbx = amrex::grow(mfi.validbox(), nghost); if (!gbx.cellCentered()) { @@ -249,6 +250,7 @@ void ABLModulatedPowerLaw::set_temperature( const auto& dbx = ori.isLow() ? amrex::adjCellLo(domain, idir, nghost) : amrex::adjCellHi(domain, idir, nghost); + // needs openmp pragma? for (amrex::MFIter mfi(mfab); mfi.isValid(); ++mfi) { auto gbx = amrex::grow(mfi.validbox(), nghost); if (!gbx.cellCentered()) { diff --git a/amr-wind/wind_energy/ABLStats.cpp b/amr-wind/wind_energy/ABLStats.cpp index 3bf77ef9d4..1e875fcd60 100644 --- a/amr-wind/wind_energy/ABLStats.cpp +++ b/amr-wind/wind_energy/ABLStats.cpp @@ -118,6 +118,7 @@ void ABLStats::calc_sfs_stress_avgs( const int nlevels = repo.num_active_levels(); for (int lev = 0; lev < nlevels; ++lev) { + // this one for (amrex::MFIter mfi(m_mueff(lev)); mfi.isValid(); ++mfi) { const auto& bx = mfi.tilebox(); const auto& mueff_arr = m_mueff(lev).array(mfi); @@ -185,6 +186,7 @@ void ABLStats::calc_tke_diffusion( const int nlevels = m_sim.repo().num_active_levels(); for (int lev = 0; lev < nlevels; ++lev) { + // this one for (amrex::MFIter mfi(diffusion(lev)); mfi.isValid(); ++mfi) { const auto& bx = mfi.tilebox(); const auto& diffusion_arr = diffusion(lev).array(mfi); diff --git a/amr-wind/wind_energy/actuator/ActuatorContainer.cpp b/amr-wind/wind_energy/actuator/ActuatorContainer.cpp index 6399d27b08..1b4af4b1f9 100644 --- a/amr-wind/wind_energy/actuator/ActuatorContainer.cpp +++ b/amr-wind/wind_energy/actuator/ActuatorContainer.cpp @@ -96,6 +96,7 @@ void ActuatorContainer::initialize_particles(const int total_pts) bool assigned = false; const int nlevels = m_mesh.finestLevel() + 1; for (int lev = 0; ((lev < nlevels) && !assigned); ++lev) { + // needs openmp pragma? for (auto mfi = MakeMFIter(lev); (mfi.isValid() && !assigned); ++mfi) { auto& ptile = GetParticles( lev)[std::make_pair(mfi.index(), mfi.LocalTileIndex())]; diff --git a/unit_tests/aw_test_utils/iter_tools.H b/unit_tests/aw_test_utils/iter_tools.H index f8a67ea13d..426080c15f 100644 --- a/unit_tests/aw_test_utils/iter_tools.H +++ b/unit_tests/aw_test_utils/iter_tools.H @@ -29,6 +29,7 @@ void run_algorithm( for (int lev = 0; lev < nlevels; ++lev) { auto& lfab = *field[lev]; + // needs openmp pragma? for (amrex::MFIter mfi(lfab); mfi.isValid(); ++mfi) { func(lev, mfi); } @@ -42,6 +43,7 @@ void run_algorithm(amr_wind::Field& field, const Functor& func) for (int lev = 0; lev < nlevels; ++lev) { auto& lfab = field(lev); + // needs openmp pragma? for (amrex::MFIter mfi(lfab); mfi.isValid(); ++mfi) { func(lev, mfi); } diff --git a/unit_tests/core/test_field_ops.cpp b/unit_tests/core/test_field_ops.cpp index dff707d527..eab71a3951 100644 --- a/unit_tests/core/test_field_ops.cpp +++ b/unit_tests/core/test_field_ops.cpp @@ -21,6 +21,7 @@ class FieldOpsTest : public MeshTest for (int lev = 0; lev < nlevels; ++lev) { const auto& dx = geom[lev].CellSizeArray(); const auto& problo = geom[lev].ProbLoArray(); + // this one for (amrex::MFIter mfi(field(lev)); mfi.isValid(); ++mfi) { const auto& bx = mfi.tilebox(); const auto& field_arr = field(lev).array(mfi); diff --git a/unit_tests/equation_systems/test_icns_gravityforcing.cpp b/unit_tests/equation_systems/test_icns_gravityforcing.cpp index 7d4223dc8b..0a5c203664 100644 --- a/unit_tests/equation_systems/test_icns_gravityforcing.cpp +++ b/unit_tests/equation_systems/test_icns_gravityforcing.cpp @@ -11,6 +11,7 @@ void init_density(amr_wind::Field& density, const int k_thresh = -3) for (int lev = 0; lev < nlevels; ++lev) { + // this one for (amrex::MFIter mfi(density(lev)); mfi.isValid(); ++mfi) { auto gbx = mfi.growntilebox(); const auto& darr = density(lev).array(mfi); @@ -214,4 +215,4 @@ TEST_F(GravityForcingTest, perturb_field) Fg, m_nx * m_ny * m_nz, m_nz, amr_wind::FieldState::New, true); } -} // namespace amr_wind_tests \ No newline at end of file +} // namespace amr_wind_tests diff --git a/unit_tests/multiphase/test_mflux_schemes.cpp b/unit_tests/multiphase/test_mflux_schemes.cpp index e36a1880df..9c2448372f 100644 --- a/unit_tests/multiphase/test_mflux_schemes.cpp +++ b/unit_tests/multiphase/test_mflux_schemes.cpp @@ -13,6 +13,7 @@ void init_scalar_increasing(amr_wind::Field& fld, int dir) const int nlevels = fld.repo().num_active_levels(); for (int lev = 0; lev < nlevels; ++lev) { + // this one for (amrex::MFIter mfi(fld(lev)); mfi.isValid(); ++mfi) { auto bx = mfi.growntilebox(1); const auto& farr = fld(lev).array(mfi); @@ -30,6 +31,7 @@ void init_scalar_slopechange(amr_wind::Field& fld, int dir, int center) const int nlevels = fld.repo().num_active_levels(); for (int lev = 0; lev < nlevels; ++lev) { + // this one for (amrex::MFIter mfi(fld(lev)); mfi.isValid(); ++mfi) { auto bx = mfi.growntilebox(1); const auto& farr = fld(lev).array(mfi); @@ -49,6 +51,7 @@ void init_scalar_uniform(amr_wind::Field& fld, amrex::Real cst) const int nlevels = fld.repo().num_active_levels(); for (int lev = 0; lev < nlevels; ++lev) { + // this one for (amrex::MFIter mfi(fld(lev)); mfi.isValid(); ++mfi) { auto bx = mfi.growntilebox(1); const auto& farr = fld(lev).array(mfi); @@ -73,6 +76,7 @@ void get_output_upwind( const int nlevels = fld.repo().num_active_levels(); for (int lev = 0; lev < nlevels; ++lev) { + // needs openmp pragma? for (amrex::MFIter mfi(fld(lev)); mfi.isValid(); ++mfi) { auto bx = mfi.validbox(); const auto& farr = fld(lev).const_array(mfi); @@ -113,6 +117,7 @@ void get_output_minmod( const auto dlo = amrex::lbound(domain); const auto dhi = amrex::ubound(domain); + // needs openmp pragma? for (amrex::MFIter mfi(fld(lev)); mfi.isValid(); ++mfi) { auto bx = mfi.validbox(); const auto& farr = fld(lev).const_array(mfi); diff --git a/unit_tests/multiphase/test_momflux.cpp b/unit_tests/multiphase/test_momflux.cpp index 33e49e96eb..da68f0fed2 100644 --- a/unit_tests/multiphase/test_momflux.cpp +++ b/unit_tests/multiphase/test_momflux.cpp @@ -18,6 +18,7 @@ void init_field3( for (int lev = 0; lev < nlevels; ++lev) { + // this one for (amrex::MFIter mfi(fld(lev)); mfi.isValid(); ++mfi) { auto bx = mfi.growntilebox(); const auto& farr = fld(lev).array(mfi); diff --git a/unit_tests/multiphase/test_vof_BCs.cpp b/unit_tests/multiphase/test_vof_BCs.cpp index 143916c808..cb22253503 100644 --- a/unit_tests/multiphase/test_vof_BCs.cpp +++ b/unit_tests/multiphase/test_vof_BCs.cpp @@ -24,6 +24,7 @@ void get_accuracy_vofsol( const amr_wind::Field& vof) { /* -- Check VOF boundary values from fillpatch -- */ + // needs openmp pragma? for (amrex::MFIter mfi(vof(lev)); mfi.isValid(); ++mfi) { auto err_arr = err_fld(lev).array(mfi); const auto& vof_arr = vof(lev).array(mfi); @@ -81,6 +82,7 @@ void get_accuracy_advalpha( const amr_wind::Field& advalpha_f) { /* -- Check VOF boundary fluxes -- */ + // needs openmp pragma? for (amrex::MFIter mfi(vof(lev)); mfi.isValid(); ++mfi) { auto err_arr = err_fld(lev).array(mfi); diff --git a/unit_tests/ocean_waves/test_relaxation_zones.cpp b/unit_tests/ocean_waves/test_relaxation_zones.cpp index 9f050e2784..702ea25832 100644 --- a/unit_tests/ocean_waves/test_relaxation_zones.cpp +++ b/unit_tests/ocean_waves/test_relaxation_zones.cpp @@ -95,6 +95,7 @@ void apply_relaxation_zone_field( const auto& geom = comp.repo().mesh().Geom(); for (int lev = 0; lev < comp.repo().num_active_levels(); ++lev) { + // this one for (amrex::MFIter mfi(comp(lev)); mfi.isValid(); ++mfi) { const auto& gbx = mfi.growntilebox(2); const auto& dx = geom[lev].CellSizeArray(); diff --git a/unit_tests/projection/test_pressure_offset.cpp b/unit_tests/projection/test_pressure_offset.cpp index cf6cc692a8..4c77d03b46 100644 --- a/unit_tests/projection/test_pressure_offset.cpp +++ b/unit_tests/projection/test_pressure_offset.cpp @@ -11,6 +11,7 @@ void init_vel_z(amr_wind::Field& vel, const amrex::Real w_const) for (int lev = 0; lev < nlevels; ++lev) { + // this one for (amrex::MFIter mfi(vel(lev)); mfi.isValid(); ++mfi) { auto gbx = mfi.growntilebox(); const auto& varr = vel(lev).array(mfi); @@ -33,6 +34,7 @@ void init_ref_p( for (int lev = 0; lev < nlevels; ++lev) { const auto& dx = geom[lev].CellSizeArray(); const auto& probhi = geom[lev].ProbHiArray(); + // this one for (amrex::MFIter mfi(ref_p(lev)); mfi.isValid(); ++mfi) { auto nbx = mfi.nodaltilebox(); const auto& p0_arr = ref_p(lev).array(mfi); diff --git a/unit_tests/turbulence/test_turbulence_LES.cpp b/unit_tests/turbulence/test_turbulence_LES.cpp index 67c4ffb191..d4026d9fbc 100644 --- a/unit_tests/turbulence/test_turbulence_LES.cpp +++ b/unit_tests/turbulence/test_turbulence_LES.cpp @@ -21,6 +21,7 @@ void init_field3(amr_wind::Field& fld, amrex::Real srate) const auto& dx = mesh.Geom(lev).CellSizeArray(); const auto& problo = mesh.Geom(lev).ProbLoArray(); + // this one for (amrex::MFIter mfi(fld(lev)); mfi.isValid(); ++mfi) { auto bx = mfi.growntilebox(); const auto& farr = fld(lev).array(mfi); @@ -52,6 +53,7 @@ void init_field_amd(amr_wind::Field& fld, amrex::Real scale) const auto& dx = mesh.Geom(lev).CellSizeArray(); const auto& problo = mesh.Geom(lev).ProbLoArray(); + // this one for (amrex::MFIter mfi(fld(lev)); mfi.isValid(); ++mfi) { auto bx = mfi.growntilebox(); const auto& farr = fld(lev).array(mfi); @@ -83,6 +85,7 @@ void init_field_incomp(amr_wind::Field& fld, amrex::Real scale) const auto& dx = mesh.Geom(lev).CellSizeArray(); const auto& problo = mesh.Geom(lev).ProbLoArray(); + // this one for (amrex::MFIter mfi(fld(lev)); mfi.isValid(); ++mfi) { auto bx = mfi.growntilebox(); const auto& farr = fld(lev).array(mfi); @@ -114,6 +117,7 @@ void init_field1(amr_wind::Field& fld, amrex::Real tgrad) const auto& dx = mesh.Geom(lev).CellSizeArray(); const auto& problo = mesh.Geom(lev).ProbLoArray(); + // this one for (amrex::MFIter mfi(fld(lev)); mfi.isValid(); ++mfi) { auto bx = mfi.growntilebox(); const auto& farr = fld(lev).array(mfi); diff --git a/unit_tests/turbulence/test_turbulence_LES_bc.cpp b/unit_tests/turbulence/test_turbulence_LES_bc.cpp index fec26db781..1fa7837507 100644 --- a/unit_tests/turbulence/test_turbulence_LES_bc.cpp +++ b/unit_tests/turbulence/test_turbulence_LES_bc.cpp @@ -51,6 +51,7 @@ void init_field3(amr_wind::Field& fld, amrex::Real srate) const auto& dx = mesh.Geom(lev).CellSizeArray(); const auto& problo = mesh.Geom(lev).ProbLoArray(); + // this one for (amrex::MFIter mfi(fld(lev)); mfi.isValid(); ++mfi) { auto bx = mfi.growntilebox(); const auto& farr = fld(lev).array(mfi); @@ -80,6 +81,7 @@ void init_field1(amr_wind::Field& fld, amrex::Real tgrad) const auto& dx = mesh.Geom(lev).CellSizeArray(); const auto& problo = mesh.Geom(lev).ProbLoArray(); + // this one for (amrex::MFIter mfi(fld(lev)); mfi.isValid(); ++mfi) { auto bx = mfi.growntilebox(); const auto& farr = fld(lev).array(mfi); diff --git a/unit_tests/utilities/test_diagnostics.cpp b/unit_tests/utilities/test_diagnostics.cpp index 950f90190f..f15760fcb0 100644 --- a/unit_tests/utilities/test_diagnostics.cpp +++ b/unit_tests/utilities/test_diagnostics.cpp @@ -14,6 +14,7 @@ void init_velocity(amr_wind::Field& velocity) const auto& dx = mesh.Geom(lev).CellSizeArray(); const auto& problo = mesh.Geom(lev).ProbLoArray(); + // this one for (amrex::MFIter mfi(velocity(lev)); mfi.isValid(); ++mfi) { auto bx = mfi.validbox(); const auto& farr = velocity(lev).array(mfi); @@ -51,6 +52,7 @@ void init_mac_velocity( const auto& dx = mesh.Geom(lev).CellSizeArray(); const auto& problo = mesh.Geom(lev).ProbLoArray(); + // this one for (amrex::MFIter mfi(cc(lev)); mfi.isValid(); ++mfi) { auto bx = mfi.growntilebox(1); const auto& uarr = umac(lev).array(mfi); diff --git a/unit_tests/utilities/test_field_norms.cpp b/unit_tests/utilities/test_field_norms.cpp index 914536ebc3..de9e926d12 100644 --- a/unit_tests/utilities/test_field_norms.cpp +++ b/unit_tests/utilities/test_field_norms.cpp @@ -21,6 +21,7 @@ void init_velocity( // Apply a factor to the base level values const amrex::Real fac = (lev == 0) ? lev0_fac : 1.0; + // this one for (amrex::MFIter mfi(vel_fld(lev)); mfi.isValid(); ++mfi) { auto bx = mfi.growntilebox(); const auto& farr = vel_fld(lev).array(mfi); diff --git a/unit_tests/utilities/test_free_surface.cpp b/unit_tests/utilities/test_free_surface.cpp index 52d5646246..3ea0082327 100644 --- a/unit_tests/utilities/test_free_surface.cpp +++ b/unit_tests/utilities/test_free_surface.cpp @@ -20,6 +20,7 @@ void init_vof(amr_wind::Field& vof_fld, amrex::Real water_level) const auto& dx = mesh.Geom(lev).CellSizeArray(); const auto& problo = mesh.Geom(lev).ProbLoArray(); + // this one for (amrex::MFIter mfi(vof_fld(lev)); mfi.isValid(); ++mfi) { auto bx = mfi.growntilebox(); const auto& farr = vof_fld(lev).array(mfi); @@ -56,6 +57,7 @@ void init_vof_multival( const auto& dx = mesh.Geom(lev).CellSizeArray(); const auto& problo = mesh.Geom(lev).ProbLoArray(); + // this one for (amrex::MFIter mfi(vof_fld(lev)); mfi.isValid(); ++mfi) { auto bx = mfi.growntilebox(); const auto& farr = vof_fld(lev).array(mfi); @@ -108,6 +110,7 @@ void init_vof_slope( const auto& dx = mesh.Geom(lev).CellSizeArray(); const auto& problo = mesh.Geom(lev).ProbLoArray(); + // this one for (amrex::MFIter mfi(vof_fld(lev)); mfi.isValid(); ++mfi) { auto bx = mfi.growntilebox(); const auto& farr = vof_fld(lev).array(mfi); diff --git a/unit_tests/utilities/test_sampling.cpp b/unit_tests/utilities/test_sampling.cpp index bf394b5fe9..12849731a6 100644 --- a/unit_tests/utilities/test_sampling.cpp +++ b/unit_tests/utilities/test_sampling.cpp @@ -31,6 +31,7 @@ void init_field(amr_wind::Field& fld) const auto& dx = mesh.Geom(lev).CellSizeArray(); const auto& problo = mesh.Geom(lev).ProbLoArray(); + // this one for (amrex::MFIter mfi(fld(lev)); mfi.isValid(); ++mfi) { auto bx = mfi.growntilebox(); const auto& farr = fld(lev).array(mfi); diff --git a/unit_tests/utilities/test_wave_energy.cpp b/unit_tests/utilities/test_wave_energy.cpp index 1c0ae1d7e9..d655aba661 100644 --- a/unit_tests/utilities/test_wave_energy.cpp +++ b/unit_tests/utilities/test_wave_energy.cpp @@ -15,6 +15,7 @@ void init_velocity(amr_wind::Field& fld) for (int lev = 0; lev < nlevels; ++lev) { + // this one for (amrex::MFIter mfi(fld(lev)); mfi.isValid(); ++mfi) { auto bx = mfi.validbox(); const auto& farr = fld(lev).array(mfi); @@ -34,6 +35,7 @@ void init_vof(amr_wind::Field& fld) for (int lev = 0; lev < nlevels; ++lev) { + // this one for (amrex::MFIter mfi(fld(lev)); mfi.isValid(); ++mfi) { auto bx = mfi.validbox(); const auto& vof_arr = fld(lev).array(mfi); diff --git a/unit_tests/wind_energy/actuator/test_actuator_joukowsky_disk.cpp b/unit_tests/wind_energy/actuator/test_actuator_joukowsky_disk.cpp index 5bce221c23..d63eae5c1a 100644 --- a/unit_tests/wind_energy/actuator/test_actuator_joukowsky_disk.cpp +++ b/unit_tests/wind_energy/actuator/test_actuator_joukowsky_disk.cpp @@ -168,7 +168,7 @@ struct ProcessOutputsOp<::amr_wind_tests::Joukowsky, ActSrcDisk> void operator()(::amr_wind_tests::Joukowsky::DataType& /*data*/) {} void read_io_options(const utils::ActParser& /**/) {} void prepare_outputs(const std::string& /**/) {} - void write_outputs(){}; + void write_outputs() {}; }; } // namespace ops diff --git a/unit_tests/wind_energy/test_abl_init_ncf.cpp b/unit_tests/wind_energy/test_abl_init_ncf.cpp index a8914fe2e1..4bf51b4357 100644 --- a/unit_tests/wind_energy/test_abl_init_ncf.cpp +++ b/unit_tests/wind_energy/test_abl_init_ncf.cpp @@ -130,6 +130,7 @@ TEST_F(ABLMeshTest, abl_init_netcdf_multilevel) for (int lev = 0; lev < nlevels; ++lev) { // Fill base level using input file + // needs openmp pragma? for (amrex::MFIter mfi(velocityf(lev)); mfi.isValid(); ++mfi) { auto vel = velocity[lev]->array(mfi); const auto& bx = mfi.validbox();