From 8018f20f12d33e8269e6e10c0c40fc6d1476d06b Mon Sep 17 00:00:00 2001 From: Eliot Quon Date: Thu, 4 Jan 2024 09:44:47 -0700 Subject: [PATCH] Remove unnecessary override of init_custom_terrain Note: The regression tests DynamicRefinement, IsentropicVortex, and ScalarAdvDiff all explicitly initialized z_phys_nd to be k*dz and then called FillBoundary(). However, if use_terrain==true (and init_custom_terrain() was called), then the default behavior should be equivalent: init_zlevels() called without grid stretching, then init_terrain_grid() called to populate z_phys_nd and then FillBoundary() --- Exec/ABL/prob.H | 5 --- Exec/ABL/prob.cpp | 25 -------------- Exec/ABL_input_sounding/prob.H | 5 --- Exec/ABL_input_sounding/prob.cpp | 25 -------------- Exec/DevTests/MiguelDev/prob.H | 5 --- Exec/DevTests/MiguelDev/prob.cpp | 28 --------------- Exec/DevTests/MultiBlock/prob.H | 5 --- Exec/DevTests/MultiBlock/prob.cpp | 28 --------------- Exec/LLJ/prob.H | 5 --- Exec/LLJ/prob.cpp | 25 -------------- Exec/Radiation/prob.H | 5 --- Exec/Radiation/prob.cpp | 28 --------------- Exec/RegTests/Bubble/prob.H | 5 --- Exec/RegTests/Bubble/prob.cpp | 28 --------------- Exec/RegTests/CouetteFlow/prob.H | 5 --- Exec/RegTests/CouetteFlow/prob.cpp | 25 -------------- Exec/RegTests/DensityCurrent/prob.H | 5 --- Exec/RegTests/DensityCurrent/prob.cpp | 29 ---------------- Exec/RegTests/DynamicRefinement/prob.H | 5 --- Exec/RegTests/DynamicRefinement/prob.cpp | 23 ------------- Exec/RegTests/EkmanSpiral_custom/prob.H | 5 --- Exec/RegTests/EkmanSpiral_custom/prob.cpp | 28 --------------- Exec/RegTests/EkmanSpiral_ideal/prob.H | 5 --- Exec/RegTests/EkmanSpiral_ideal/prob.cpp | 28 --------------- .../EkmanSpiral_input_sounding/prob.H | 5 --- .../EkmanSpiral_input_sounding/prob.cpp | 28 --------------- Exec/RegTests/IsentropicVortex/prob.H | 5 --- Exec/RegTests/IsentropicVortex/prob.cpp | 23 ------------- Exec/RegTests/PoiseuilleFlow/prob.H | 5 --- Exec/RegTests/PoiseuilleFlow/prob.cpp | 25 -------------- Exec/RegTests/ScalarAdvDiff/prob.H | 5 --- Exec/RegTests/ScalarAdvDiff/prob.cpp | 23 ------------- Exec/RegTests/StokesSecondProblem/prob.cpp | 34 ------------------- Exec/RegTests/TaylorGreenVortex/prob.H | 5 --- Exec/RegTests/TaylorGreenVortex/prob.cpp | 25 -------------- Exec/SquallLine_2D/prob.H | 5 --- Exec/SquallLine_2D/prob.cpp | 27 --------------- Exec/SuperCell/prob.H | 5 --- Exec/SuperCell/prob.cpp | 28 --------------- 39 files changed, 628 deletions(-) diff --git a/Exec/ABL/prob.H b/Exec/ABL/prob.H index b22c7d56b..7e2751a67 100644 --- a/Exec/ABL/prob.H +++ b/Exec/ABL/prob.H @@ -68,11 +68,6 @@ public: amrex::Array4 const& mf_v, const SolverChoice& sc) override; - void init_custom_terrain ( - const amrex::Geometry& geom, - amrex::MultiFab& z_phys_nd, - const amrex::Real& time) override; - protected: std::string name() override { return "ABL"; } diff --git a/Exec/ABL/prob.cpp b/Exec/ABL/prob.cpp index c0adb291b..3fa21566d 100644 --- a/Exec/ABL/prob.cpp +++ b/Exec/ABL/prob.cpp @@ -164,28 +164,3 @@ Problem::init_custom_pert( } }); } - -void -Problem::init_custom_terrain( - const Geometry& /*geom*/, - MultiFab& z_phys_nd, - const Real& /*time*/) -{ - // Number of ghost cells - int ngrow = z_phys_nd.nGrow(); - - for ( MFIter mfi(z_phys_nd, TilingIfNotGPU()); mfi.isValid(); ++mfi ) - { - // Grown box with no z range - amrex::Box xybx = mfi.growntilebox(ngrow); - xybx.setRange(2,0); - - Array4 z_arr = z_phys_nd.array(mfi); - - ParallelFor(xybx, [=] AMREX_GPU_DEVICE (int i, int j, int) { - - // Flat terrain with z = 0 at k = 0 - z_arr(i,j,0) = 0.; - }); - } -} diff --git a/Exec/ABL_input_sounding/prob.H b/Exec/ABL_input_sounding/prob.H index c0a8a4e74..8fee85f36 100644 --- a/Exec/ABL_input_sounding/prob.H +++ b/Exec/ABL_input_sounding/prob.H @@ -67,11 +67,6 @@ public: amrex::Array4 const& mf_v, const SolverChoice& sc) override; - void init_custom_terrain ( - const amrex::Geometry& geom, - amrex::MultiFab& z_phys_nd, - const amrex::Real& time) override; - protected: std::string name() override { return "ABL with input sounding"; } diff --git a/Exec/ABL_input_sounding/prob.cpp b/Exec/ABL_input_sounding/prob.cpp index 80dddebe7..0fd460d2d 100644 --- a/Exec/ABL_input_sounding/prob.cpp +++ b/Exec/ABL_input_sounding/prob.cpp @@ -157,28 +157,3 @@ Problem::init_custom_pert( } }); } - -void -Problem::init_custom_terrain( - const Geometry& /*geom*/, - MultiFab& z_phys_nd, - const Real& /*time*/) -{ - // Number of ghost cells - int ngrow = z_phys_nd.nGrow(); - - for ( MFIter mfi(z_phys_nd, TilingIfNotGPU()); mfi.isValid(); ++mfi ) - { - // Grown box with no z range - amrex::Box xybx = mfi.growntilebox(ngrow); - xybx.setRange(2,0); - - Array4 z_arr = z_phys_nd.array(mfi); - - ParallelFor(xybx, [=] AMREX_GPU_DEVICE (int i, int j, int) { - - // Flat terrain with z = 0 at k = 0 - z_arr(i,j,0) = 0.; - }); - } -} diff --git a/Exec/DevTests/MiguelDev/prob.H b/Exec/DevTests/MiguelDev/prob.H index 2bbf9bb93..b0f0955e4 100644 --- a/Exec/DevTests/MiguelDev/prob.H +++ b/Exec/DevTests/MiguelDev/prob.H @@ -57,11 +57,6 @@ public: amrex::Array4 const& mf_v, const SolverChoice& sc) override; - void init_custom_terrain ( - const amrex::Geometry& geom, - amrex::MultiFab& z_phys_nd, - const amrex::Real& time) override; - protected: std::string name() override { return "ABL test"; } diff --git a/Exec/DevTests/MiguelDev/prob.cpp b/Exec/DevTests/MiguelDev/prob.cpp index 035160882..088d3c869 100644 --- a/Exec/DevTests/MiguelDev/prob.cpp +++ b/Exec/DevTests/MiguelDev/prob.cpp @@ -140,31 +140,3 @@ Problem::init_custom_pert( }); } - -void -Problem::init_custom_terrain( - const Geometry& /*geom*/, - MultiFab& z_phys_nd, - const Real& /*time*/) -{ - // Number of ghost cells - int ngrow = z_phys_nd.nGrow(); - - // Bottom of domain - int k0 = 0; - - for ( MFIter mfi(z_phys_nd, TilingIfNotGPU()); mfi.isValid(); ++mfi ) - { - // Grown box with no z range - Box xybx = mfi.growntilebox(ngrow); - xybx.setRange(2,0); - - Array4 const& z_arr = z_phys_nd.array(mfi); - - ParallelFor(xybx, [=] AMREX_GPU_DEVICE (int i, int j, int) { - - // Flat terrain with z = 0 at k = 0 - z_arr(i,j,k0) = 0.0; - }); - } -} diff --git a/Exec/DevTests/MultiBlock/prob.H b/Exec/DevTests/MultiBlock/prob.H index 4b58c8691..44b27ee2f 100644 --- a/Exec/DevTests/MultiBlock/prob.H +++ b/Exec/DevTests/MultiBlock/prob.H @@ -46,11 +46,6 @@ public: amrex::Array4 const& mf_v, const SolverChoice& sc) override; - void init_custom_terrain ( - const amrex::Geometry& geom, - amrex::MultiFab& z_phys_nd, - const amrex::Real& time) override; - protected: std::string name() override { return "MultiBlock"; } diff --git a/Exec/DevTests/MultiBlock/prob.cpp b/Exec/DevTests/MultiBlock/prob.cpp index 20be90ef0..5908aa55c 100644 --- a/Exec/DevTests/MultiBlock/prob.cpp +++ b/Exec/DevTests/MultiBlock/prob.cpp @@ -111,31 +111,3 @@ Problem::init_custom_pert( amrex::Gpu::streamSynchronize(); } - -void -Problem::init_custom_terrain( - const Geometry& /*geom*/, - MultiFab& z_phys_nd, - const Real& /*time*/) -{ - // Number of ghost cells - int ngrow = z_phys_nd.nGrow(); - - // Bottom of domain - int k0 = 0; - - for ( MFIter mfi(z_phys_nd, TilingIfNotGPU()); mfi.isValid(); ++mfi ) - { - // Grown box with no z range - amrex::Box xybx = mfi.growntilebox(ngrow); - xybx.setRange(2,0); - - Array4 const& z_arr = z_phys_nd.array(mfi); - - ParallelFor(xybx, [=] AMREX_GPU_DEVICE (int i, int j, int) { - - // Flat terrain with z = 0 at k = 0 - z_arr(i,j,k0) = 0.0; - }); - } -} diff --git a/Exec/LLJ/prob.H b/Exec/LLJ/prob.H index 0d460d496..4bb8aa331 100644 --- a/Exec/LLJ/prob.H +++ b/Exec/LLJ/prob.H @@ -39,11 +39,6 @@ public: amrex::Array4 const& mf_v, const SolverChoice& sc) override; - void init_custom_terrain ( - const amrex::Geometry& geom, - amrex::MultiFab& z_phys_nd, - const amrex::Real& time) override; - protected: std::string name() override { return "Low-Level Jet"; } diff --git a/Exec/LLJ/prob.cpp b/Exec/LLJ/prob.cpp index 6f2ad9f38..9bc19a3e7 100644 --- a/Exec/LLJ/prob.cpp +++ b/Exec/LLJ/prob.cpp @@ -42,28 +42,3 @@ Problem::init_custom_pert( { amrex::Print() << "Dummy function..Needed for linking" << std::endl; } - -void -Problem::init_custom_terrain( - const Geometry& /*geom*/, - MultiFab& z_phys_nd, - const Real& /*time*/) -{ - // Number of ghost cells - int ngrow = z_phys_nd.nGrow(); - - for ( MFIter mfi(z_phys_nd, TilingIfNotGPU()); mfi.isValid(); ++mfi ) - { - // Grown box with no z range - amrex::Box xybx = mfi.growntilebox(ngrow); - xybx.setRange(2,0); - - Array4 z_arr = z_phys_nd.array(mfi); - - ParallelFor(xybx, [=] AMREX_GPU_DEVICE (int i, int j, int) { - - // Flat terrain with z = 0 at k = 0 - z_arr(i,j,0) = 0.; - }); - } -} diff --git a/Exec/Radiation/prob.H b/Exec/Radiation/prob.H index 77933842f..04025026f 100644 --- a/Exec/Radiation/prob.H +++ b/Exec/Radiation/prob.H @@ -46,11 +46,6 @@ public: amrex::Array4 const& mf_v, const SolverChoice& sc) override; - void init_custom_terrain ( - const amrex::Geometry& geom, - amrex::MultiFab& z_phys_nd, - const amrex::Real& time) override; - void erf_init_rayleigh ( amrex::Vector& tau, amrex::Vector& ubar, diff --git a/Exec/Radiation/prob.cpp b/Exec/Radiation/prob.cpp index 23c967ad4..f1fd2c10d 100644 --- a/Exec/Radiation/prob.cpp +++ b/Exec/Radiation/prob.cpp @@ -212,34 +212,6 @@ Problem::init_custom_pert( amrex::Gpu::streamSynchronize(); } -void -Problem::init_custom_terrain( - const Geometry& /*geom*/, - MultiFab& z_phys_nd, - const Real& /*time*/) -{ - // Number of ghost cells - int ngrow = z_phys_nd.nGrow(); - - // Bottom of domain - int k0 = 0; - - for ( MFIter mfi(z_phys_nd, TilingIfNotGPU()); mfi.isValid(); ++mfi ) - { - // Grown box with no z range - amrex::Box xybx = mfi.growntilebox(ngrow); - xybx.setRange(2,0); - - Array4 const& z_arr = z_phys_nd.array(mfi); - - ParallelFor(xybx, [=] AMREX_GPU_DEVICE (int i, int j, int) { - - // Flat terrain with z = 0 at k = 0 - z_arr(i,j,k0) = 0.0; - }); - } -} - void Problem::erf_init_rayleigh( amrex::Vector& tau, diff --git a/Exec/RegTests/Bubble/prob.H b/Exec/RegTests/Bubble/prob.H index e8fe13dd7..e1f3bfa18 100644 --- a/Exec/RegTests/Bubble/prob.H +++ b/Exec/RegTests/Bubble/prob.H @@ -62,11 +62,6 @@ public: amrex::Array4 const& mf_v, const SolverChoice& sc) override; - void init_custom_terrain ( - const amrex::Geometry& geom, - amrex::MultiFab& z_phys_nd, - const amrex::Real& time) override; - #include "Prob/init_rayleigh_damping.H" protected: diff --git a/Exec/RegTests/Bubble/prob.cpp b/Exec/RegTests/Bubble/prob.cpp index a70d87a1f..070bf937d 100644 --- a/Exec/RegTests/Bubble/prob.cpp +++ b/Exec/RegTests/Bubble/prob.cpp @@ -209,31 +209,3 @@ Problem::init_custom_pert( amrex::Gpu::streamSynchronize(); } - -void -Problem::init_custom_terrain( - const Geometry& /*geom*/, - MultiFab& z_phys_nd, - const Real& /*time*/) -{ - // Number of ghost cells - int ngrow = z_phys_nd.nGrow(); - - // Bottom of domain - int k0 = 0; - - for ( MFIter mfi(z_phys_nd, TilingIfNotGPU()); mfi.isValid(); ++mfi ) - { - // Grown box with no z range - amrex::Box xybx = mfi.growntilebox(ngrow); - xybx.setRange(2,0); - - Array4 const& z_arr = z_phys_nd.array(mfi); - - ParallelFor(xybx, [=] AMREX_GPU_DEVICE (int i, int j, int) { - - // Flat terrain with z = 0 at k = 0 - z_arr(i,j,k0) = 0.0; - }); - } -} diff --git a/Exec/RegTests/CouetteFlow/prob.H b/Exec/RegTests/CouetteFlow/prob.H index 570d2ef92..20dfde89a 100644 --- a/Exec/RegTests/CouetteFlow/prob.H +++ b/Exec/RegTests/CouetteFlow/prob.H @@ -41,11 +41,6 @@ public: amrex::Array4 const& mf_v, const SolverChoice& sc) override; - void init_custom_terrain ( - const amrex::Geometry& geom, - amrex::MultiFab& z_phys_nd, - const amrex::Real& time) override; - protected: std::string name() override { return "Couette Flow"; } diff --git a/Exec/RegTests/CouetteFlow/prob.cpp b/Exec/RegTests/CouetteFlow/prob.cpp index 0bc9be19e..c76c56b87 100644 --- a/Exec/RegTests/CouetteFlow/prob.cpp +++ b/Exec/RegTests/CouetteFlow/prob.cpp @@ -75,28 +75,3 @@ Problem::init_custom_pert( z_vel(i, j, k) = parms.w_0; }); } - -void -Problem::init_custom_terrain( - const Geometry& /*geom*/, - MultiFab& z_phys_nd, - const Real& /*time*/) -{ - // Number of ghost cells - int ngrow = z_phys_nd.nGrow(); - - for ( MFIter mfi(z_phys_nd, TilingIfNotGPU()); mfi.isValid(); ++mfi ) - { - // Grown box with no z range - amrex::Box xybx = mfi.growntilebox(ngrow); - xybx.setRange(2,0); - - Array4 z_arr = z_phys_nd.array(mfi); - - ParallelFor(xybx, [=] AMREX_GPU_DEVICE (int i, int j, int) { - - // Flat terrain with z = 0 at k = 0 - z_arr(i,j,0) = 0.; - }); - } -} diff --git a/Exec/RegTests/DensityCurrent/prob.H b/Exec/RegTests/DensityCurrent/prob.H index 7d17e9d8a..6d9e59888 100644 --- a/Exec/RegTests/DensityCurrent/prob.H +++ b/Exec/RegTests/DensityCurrent/prob.H @@ -44,11 +44,6 @@ public: amrex::Array4 const& mf_v, const SolverChoice& sc) override; - void init_custom_terrain ( - const amrex::Geometry& geom, - amrex::MultiFab& z_phys_nd, - const amrex::Real& time) override; - protected: std::string name() override { return "Density Current"; } diff --git a/Exec/RegTests/DensityCurrent/prob.cpp b/Exec/RegTests/DensityCurrent/prob.cpp index 04ec271ce..9b92e7756 100644 --- a/Exec/RegTests/DensityCurrent/prob.cpp +++ b/Exec/RegTests/DensityCurrent/prob.cpp @@ -148,32 +148,3 @@ Problem::init_custom_pert( amrex::Gpu::streamSynchronize(); } - -void -Problem::init_custom_terrain( - const Geometry& /*geom*/, - MultiFab& z_phys_nd, - const Real& /*time*/) -{ - // Number of ghost cells - int ngrow = z_phys_nd.nGrow(); - - // Bottom of domain - int k0 = 0; - - for ( MFIter mfi(z_phys_nd, TilingIfNotGPU()); mfi.isValid(); ++mfi ) - { - // Grown box with no z range - amrex::Box xybx = mfi.growntilebox(ngrow); - xybx.setRange(2,0); - - Array4 const& z_arr = z_phys_nd.array(mfi); - - ParallelFor(xybx, [=] AMREX_GPU_DEVICE (int i, int j, int) { - - // Flat terrain with z = 0 at k = 0 - z_arr(i,j,k0) = 0.0; - }); - } -} - diff --git a/Exec/RegTests/DynamicRefinement/prob.H b/Exec/RegTests/DynamicRefinement/prob.H index 1755d4979..8bae079aa 100644 --- a/Exec/RegTests/DynamicRefinement/prob.H +++ b/Exec/RegTests/DynamicRefinement/prob.H @@ -51,11 +51,6 @@ public: amrex::Array4 const& mf_v, const SolverChoice& sc) override; - void init_custom_terrain ( - const amrex::Geometry& geom, - amrex::MultiFab& z_phys_nd, - const amrex::Real& time) override; - protected: std::string name() override { return "Dynamic Refinement"; } diff --git a/Exec/RegTests/DynamicRefinement/prob.cpp b/Exec/RegTests/DynamicRefinement/prob.cpp index 0b2b549ad..3f59f0386 100644 --- a/Exec/RegTests/DynamicRefinement/prob.cpp +++ b/Exec/RegTests/DynamicRefinement/prob.cpp @@ -165,29 +165,6 @@ Problem::init_custom_pert( }); } -void -Problem::init_custom_terrain( - const Geometry& geom, - MultiFab& z_phys_nd, - const Real& /*time*/) -{ - auto dx = geom.CellSizeArray(); - - for ( MFIter mfi(z_phys_nd, TilingIfNotGPU()); mfi.isValid(); ++mfi ) - { - const Box& gbx = mfi.growntilebox(1); - Array4 z_arr = z_phys_nd.array(mfi); - ParallelFor(gbx, [=] AMREX_GPU_DEVICE (int i, int j, int k) { - - Real z = k * dx[2]; - - // Flat terrain with z = 0 at k = 0 - z_arr(i,j,k) = z; - }); - } - z_phys_nd.FillBoundary(geom.periodicity()); -} - #if 0 AMREX_GPU_DEVICE Real diff --git a/Exec/RegTests/EkmanSpiral_custom/prob.H b/Exec/RegTests/EkmanSpiral_custom/prob.H index fedf5e9d9..d6cc4e3b1 100644 --- a/Exec/RegTests/EkmanSpiral_custom/prob.H +++ b/Exec/RegTests/EkmanSpiral_custom/prob.H @@ -39,11 +39,6 @@ public: amrex::Array4 const& mf_v, const SolverChoice& sc) override; - void init_custom_terrain ( - const amrex::Geometry& geom, - amrex::MultiFab& z_phys_nd, - const amrex::Real& time) override; - protected: std::string name() override { return "Ekman Spiral"; } diff --git a/Exec/RegTests/EkmanSpiral_custom/prob.cpp b/Exec/RegTests/EkmanSpiral_custom/prob.cpp index e608032ee..833e3570d 100644 --- a/Exec/RegTests/EkmanSpiral_custom/prob.cpp +++ b/Exec/RegTests/EkmanSpiral_custom/prob.cpp @@ -106,31 +106,3 @@ Problem::init_custom_pert( z_vel(i, j, k) = 0.0; }); } - -void -Problem::init_custom_terrain( - const Geometry& /*geom*/, - MultiFab& z_phys_nd, - const Real& /*time*/) -{ - // Number of ghost cells - int ngrow = z_phys_nd.nGrow(); - - // Bottom of domain - int k0 = 0; - - for ( MFIter mfi(z_phys_nd, TilingIfNotGPU()); mfi.isValid(); ++mfi ) - { - // Grown box with no z range - Box xybx = mfi.growntilebox(ngrow); - xybx.setRange(2,0); - - Array4 const& z_arr = z_phys_nd.array(mfi); - - ParallelFor(xybx, [=] AMREX_GPU_DEVICE (int i, int j, int) { - - // Flat terrain with z = 0 at k = 0 - z_arr(i,j,k0) = 0.0; - }); - } -} diff --git a/Exec/RegTests/EkmanSpiral_ideal/prob.H b/Exec/RegTests/EkmanSpiral_ideal/prob.H index 192d96138..9ea7fb1e7 100644 --- a/Exec/RegTests/EkmanSpiral_ideal/prob.H +++ b/Exec/RegTests/EkmanSpiral_ideal/prob.H @@ -39,11 +39,6 @@ public: amrex::Array4 const& mf_v, const SolverChoice& sc) override; - void init_custom_terrain ( - const amrex::Geometry& geom, - amrex::MultiFab& z_phys_nd, - const amrex::Real& time) override; - protected: std::string name() override { return "Ekman Spiral (ideal)"; } diff --git a/Exec/RegTests/EkmanSpiral_ideal/prob.cpp b/Exec/RegTests/EkmanSpiral_ideal/prob.cpp index c69999a7b..bffe4924a 100644 --- a/Exec/RegTests/EkmanSpiral_ideal/prob.cpp +++ b/Exec/RegTests/EkmanSpiral_ideal/prob.cpp @@ -42,31 +42,3 @@ Problem::init_custom_pert( { amrex::Print() << "Dummy function..Needed for linking" << std::endl; } - -void -Problem::init_custom_terrain( - const Geometry& /*geom*/, - MultiFab& z_phys_nd, - const Real& /*time*/) -{ - // Number of ghost cells - int ngrow = z_phys_nd.nGrow(); - - // Bottom of domain - int k0 = 0; - - for ( MFIter mfi(z_phys_nd, TilingIfNotGPU()); mfi.isValid(); ++mfi ) - { - // Grown box with no z range - Box xybx = mfi.growntilebox(ngrow); - xybx.setRange(2,0); - - Array4 const& z_arr = z_phys_nd.array(mfi); - - ParallelFor(xybx, [=] AMREX_GPU_DEVICE (int i, int j, int) { - - // Flat terrain with z = 0 at k = 0 - z_arr(i,j,k0) = 0.0; - }); - } -} diff --git a/Exec/RegTests/EkmanSpiral_input_sounding/prob.H b/Exec/RegTests/EkmanSpiral_input_sounding/prob.H index cd96fa98b..5415ffb5c 100644 --- a/Exec/RegTests/EkmanSpiral_input_sounding/prob.H +++ b/Exec/RegTests/EkmanSpiral_input_sounding/prob.H @@ -39,11 +39,6 @@ public: amrex::Array4 const& mf_v, const SolverChoice& sc) override; - void init_custom_terrain ( - const amrex::Geometry& geom, - amrex::MultiFab& z_phys_nd, - const amrex::Real& time) override; - protected: std::string name() override { return "Ekman Spiral (input sounding)"; } diff --git a/Exec/RegTests/EkmanSpiral_input_sounding/prob.cpp b/Exec/RegTests/EkmanSpiral_input_sounding/prob.cpp index ab357578e..0fefa5616 100644 --- a/Exec/RegTests/EkmanSpiral_input_sounding/prob.cpp +++ b/Exec/RegTests/EkmanSpiral_input_sounding/prob.cpp @@ -42,31 +42,3 @@ Problem::init_custom_pert( { amrex::Print() << "Dummy function..Needed for linking" << std::endl; } - -void -Problem::init_custom_terrain( - const Geometry& /*geom*/, - MultiFab& z_phys_nd, - const Real& /*time*/) -{ - // Number of ghost cells - int ngrow = z_phys_nd.nGrow(); - - // Bottom of domain - int k0 = 0; - - for ( MFIter mfi(z_phys_nd, TilingIfNotGPU()); mfi.isValid(); ++mfi ) - { - // Grown box with no z range - Box xybx = mfi.growntilebox(ngrow); - xybx.setRange(2,0); - - Array4 const& z_arr = z_phys_nd.array(mfi); - - ParallelFor(xybx, [=] AMREX_GPU_DEVICE (int i, int j, int) { - - // Flat terrain with z = 0 at k = 0 - z_arr(i,j,k0) = 0.0; - }); - } -} diff --git a/Exec/RegTests/IsentropicVortex/prob.H b/Exec/RegTests/IsentropicVortex/prob.H index d2b51270f..fe9567010 100644 --- a/Exec/RegTests/IsentropicVortex/prob.H +++ b/Exec/RegTests/IsentropicVortex/prob.H @@ -50,11 +50,6 @@ public: amrex::Array4 const& mf_v, const SolverChoice& sc) override; - void init_custom_terrain ( - const amrex::Geometry& geom, - amrex::MultiFab& z_phys_nd, - const amrex::Real& time) override; - protected: std::string name() override { return "Isentropic Vortex"; } diff --git a/Exec/RegTests/IsentropicVortex/prob.cpp b/Exec/RegTests/IsentropicVortex/prob.cpp index 9c9aef46c..685c2c480 100644 --- a/Exec/RegTests/IsentropicVortex/prob.cpp +++ b/Exec/RegTests/IsentropicVortex/prob.cpp @@ -167,29 +167,6 @@ Problem::init_custom_pert( }); } -void -Problem::init_custom_terrain( - const Geometry& geom, - MultiFab& z_phys_nd, - const Real& /*time*/) -{ - auto dx = geom.CellSizeArray(); - - for ( MFIter mfi(z_phys_nd, TilingIfNotGPU()); mfi.isValid(); ++mfi ) - { - const Box& gbx = mfi.growntilebox(1); - Array4 z_arr = z_phys_nd.array(mfi); - ParallelFor(gbx, [=] AMREX_GPU_DEVICE (int i, int j, int k) { - - Real z = k * dx[2]; - - // Flat terrain with z = 0 at k = 0 - z_arr(i,j,k) = z; - }); - } - z_phys_nd.FillBoundary(geom.periodicity()); -} - #if 0 AMREX_GPU_DEVICE Real diff --git a/Exec/RegTests/PoiseuilleFlow/prob.H b/Exec/RegTests/PoiseuilleFlow/prob.H index 120b23372..508934e86 100644 --- a/Exec/RegTests/PoiseuilleFlow/prob.H +++ b/Exec/RegTests/PoiseuilleFlow/prob.H @@ -40,11 +40,6 @@ public: amrex::Array4 const& mf_v, const SolverChoice& sc) override; - void init_custom_terrain ( - const amrex::Geometry& geom, - amrex::MultiFab& z_phys_nd, - const amrex::Real& time) override; - protected: std::string name() override { return "Poiseuille Flow"; } diff --git a/Exec/RegTests/PoiseuilleFlow/prob.cpp b/Exec/RegTests/PoiseuilleFlow/prob.cpp index 3defea69d..adfe1d958 100644 --- a/Exec/RegTests/PoiseuilleFlow/prob.cpp +++ b/Exec/RegTests/PoiseuilleFlow/prob.cpp @@ -89,28 +89,3 @@ Problem::init_custom_pert( z_vel(i, j, k) = 0.0; }); } - -void -Problem::init_custom_terrain( - const Geometry& /*geom*/, - MultiFab& z_phys_nd, - const Real& /*time*/) -{ - // Number of ghost cells - int ngrow = z_phys_nd.nGrow(); - - for ( MFIter mfi(z_phys_nd, TilingIfNotGPU()); mfi.isValid(); ++mfi ) - { - // Grown box with no z range - amrex::Box xybx = mfi.growntilebox(ngrow); - xybx.setRange(2,0); - - Array4 z_arr = z_phys_nd.array(mfi); - - ParallelFor(xybx, [=] AMREX_GPU_DEVICE (int i, int j, int) { - - // Flat terrain with z = 0 at k = 0 - z_arr(i,j,0) = 0.; - }); - } -} diff --git a/Exec/RegTests/ScalarAdvDiff/prob.H b/Exec/RegTests/ScalarAdvDiff/prob.H index 5adca8818..00cbd5f83 100644 --- a/Exec/RegTests/ScalarAdvDiff/prob.H +++ b/Exec/RegTests/ScalarAdvDiff/prob.H @@ -52,11 +52,6 @@ public: amrex::Array4 const& mf_v, const SolverChoice& sc) override; - void init_custom_terrain ( - const amrex::Geometry& geom, - amrex::MultiFab& z_phys_nd, - const amrex::Real& time) override; - void erf_init_rayleigh ( amrex::Vector& tau, amrex::Vector& ubar, diff --git a/Exec/RegTests/ScalarAdvDiff/prob.cpp b/Exec/RegTests/ScalarAdvDiff/prob.cpp index f9e931dfc..f161da47a 100644 --- a/Exec/RegTests/ScalarAdvDiff/prob.cpp +++ b/Exec/RegTests/ScalarAdvDiff/prob.cpp @@ -162,29 +162,6 @@ Problem::init_custom_pert( }); } -void -Problem::init_custom_terrain( - const Geometry& geom, - MultiFab& z_phys_nd, - const Real& /*time*/) -{ - auto dx = geom.CellSizeArray(); - - for ( MFIter mfi(z_phys_nd, TilingIfNotGPU()); mfi.isValid(); ++mfi ) - { - const Box& gbx = mfi.growntilebox(1); - Array4 z_arr = z_phys_nd.array(mfi); - ParallelFor(gbx, [=] AMREX_GPU_DEVICE (int i, int j, int k) { - - Real z = k * dx[2]; - - // Flat terrain with z = 0 at k = 0 - z_arr(i,j,k) = z; - }); - } - z_phys_nd.FillBoundary(geom.periodicity()); -} - #if 0 AMREX_GPU_DEVICE Real diff --git a/Exec/RegTests/StokesSecondProblem/prob.cpp b/Exec/RegTests/StokesSecondProblem/prob.cpp index cf141fa62..71fff7879 100644 --- a/Exec/RegTests/StokesSecondProblem/prob.cpp +++ b/Exec/RegTests/StokesSecondProblem/prob.cpp @@ -81,40 +81,6 @@ Problem::init_custom_pert( } -void -Problem::init_custom_terrain( - const Geometry& geom, - MultiFab& z_phys_nd, - const Real& /*time*/) -{ - - // Domain valid box (z_nd is nodal) - const amrex::Box& domain = geom.Domain(); - // int domlo_y = domain.smallEnd(1); int domhi_y = domain.bigEnd(1) + 1; - int domlo_z = domain.smallEnd(2); - - // Number of ghost cells - int ngrow = z_phys_nd.nGrow(); - - // Populate bottom plane - int k0 = domlo_z; - - for ( amrex::MFIter mfi(z_phys_nd,amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi ) - { - // Grown box with no z range - amrex::Box xybx = mfi.growntilebox(ngrow); - xybx.setRange(2,0); - - amrex::Array4 const& z_arr = z_phys_nd.array(mfi); - - ParallelFor(xybx, [=] AMREX_GPU_DEVICE (int i, int j, int) { - - z_arr(i,j,k0) = 0.0; - - }); - } -} - Real Problem::compute_terrain_velocity(const Real time) { diff --git a/Exec/RegTests/TaylorGreenVortex/prob.H b/Exec/RegTests/TaylorGreenVortex/prob.H index 0635cacbb..65445a3bf 100644 --- a/Exec/RegTests/TaylorGreenVortex/prob.H +++ b/Exec/RegTests/TaylorGreenVortex/prob.H @@ -39,11 +39,6 @@ public: amrex::Array4 const& mf_v, const SolverChoice& sc) override; - void init_custom_terrain ( - const amrex::Geometry& geom, - amrex::MultiFab& z_phys_nd, - const amrex::Real& time) override; - protected: std::string name() override { return "Taylor-Green Vortex"; } diff --git a/Exec/RegTests/TaylorGreenVortex/prob.cpp b/Exec/RegTests/TaylorGreenVortex/prob.cpp index f90eee76c..68fe0ca8b 100644 --- a/Exec/RegTests/TaylorGreenVortex/prob.cpp +++ b/Exec/RegTests/TaylorGreenVortex/prob.cpp @@ -101,28 +101,3 @@ Problem::init_custom_pert( z_vel(i, j, k) = 0.0; }); } - -void -Problem::init_custom_terrain ( - const Geometry& /*geom*/, - MultiFab& z_phys_nd, - const Real& /*time*/) -{ - // Number of ghost cells - int ngrow = z_phys_nd.nGrow(); - - for ( MFIter mfi(z_phys_nd, TilingIfNotGPU()); mfi.isValid(); ++mfi ) - { - // Grown box with no z range - amrex::Box xybx = mfi.growntilebox(ngrow); - xybx.setRange(2,0); - - Array4 const& z_arr = z_phys_nd.array(mfi); - - ParallelFor(xybx, [=] AMREX_GPU_DEVICE (int i, int j, int) { - - // Flat terrain with z = 0 at k = 0 - z_arr(i,j,0) = 0.0; - }); - } -} diff --git a/Exec/SquallLine_2D/prob.H b/Exec/SquallLine_2D/prob.H index 28b637c59..4035fcfea 100644 --- a/Exec/SquallLine_2D/prob.H +++ b/Exec/SquallLine_2D/prob.H @@ -61,11 +61,6 @@ public: std::unique_ptr& z_phys_nd, amrex::Geometry const& geom) override; - void init_custom_terrain ( - const amrex::Geometry& geom, - amrex::MultiFab& z_phys_nd, - const amrex::Real& time) override; - void erf_init_rayleigh ( amrex::Vector& tau, amrex::Vector& ubar, diff --git a/Exec/SquallLine_2D/prob.cpp b/Exec/SquallLine_2D/prob.cpp index 8e5445f22..06da8587b 100644 --- a/Exec/SquallLine_2D/prob.cpp +++ b/Exec/SquallLine_2D/prob.cpp @@ -400,33 +400,6 @@ Problem::init_custom_pert ( amrex::Gpu::streamSynchronize(); } -void -Problem::init_custom_terrain (const Geometry& /*geom*/, - MultiFab& z_phys_nd, - const Real& /*time*/) -{ - // Number of ghost cells - int ngrow = z_phys_nd.nGrow(); - - // Bottom of domain - int k0 = 0; - - for ( MFIter mfi(z_phys_nd, TilingIfNotGPU()); mfi.isValid(); ++mfi ) - { - // Grown box with no z range - amrex::Box xybx = mfi.growntilebox(ngrow); - xybx.setRange(2,0); - - Array4 const& z_arr = z_phys_nd.array(mfi); - - ParallelFor(xybx, [=] AMREX_GPU_DEVICE (int i, int j, int) { - - // Flat terrain with z = 0 at k = 0 - z_arr(i,j,k0) = 0.0; - }); - } -} - void Problem::erf_init_rayleigh (amrex::Vector& tau, amrex::Vector& ubar, diff --git a/Exec/SuperCell/prob.H b/Exec/SuperCell/prob.H index 77933842f..04025026f 100644 --- a/Exec/SuperCell/prob.H +++ b/Exec/SuperCell/prob.H @@ -46,11 +46,6 @@ public: amrex::Array4 const& mf_v, const SolverChoice& sc) override; - void init_custom_terrain ( - const amrex::Geometry& geom, - amrex::MultiFab& z_phys_nd, - const amrex::Real& time) override; - void erf_init_rayleigh ( amrex::Vector& tau, amrex::Vector& ubar, diff --git a/Exec/SuperCell/prob.cpp b/Exec/SuperCell/prob.cpp index a16792591..ccd1d6242 100644 --- a/Exec/SuperCell/prob.cpp +++ b/Exec/SuperCell/prob.cpp @@ -212,34 +212,6 @@ Problem::init_custom_pert( amrex::Gpu::streamSynchronize(); } -void -Problem::init_custom_terrain( - const Geometry& /*geom*/, - MultiFab& z_phys_nd, - const Real& /*time*/) -{ - // Number of ghost cells - int ngrow = z_phys_nd.nGrow(); - - // Bottom of domain - int k0 = 0; - - for ( MFIter mfi(z_phys_nd, TilingIfNotGPU()); mfi.isValid(); ++mfi ) - { - // Grown box with no z range - amrex::Box xybx = mfi.growntilebox(ngrow); - xybx.setRange(2,0); - - Array4 const& z_arr = z_phys_nd.array(mfi); - - ParallelFor(xybx, [=] AMREX_GPU_DEVICE (int i, int j, int) { - - // Flat terrain with z = 0 at k = 0 - z_arr(i,j,k0) = 0.0; - }); - } -} - void Problem::erf_init_rayleigh( amrex::Vector& tau,