Skip to content

Commit

Permalink
Remove unnecessary override of init_custom_terrain
Browse files Browse the repository at this point in the history
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()
  • Loading branch information
ewquon committed Jan 4, 2024
1 parent f9082de commit 8018f20
Show file tree
Hide file tree
Showing 39 changed files with 0 additions and 628 deletions.
5 changes: 0 additions & 5 deletions Exec/ABL/prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@ public:
amrex::Array4<amrex::Real const> 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"; }

Expand Down
25 changes: 0 additions & 25 deletions Exec/ABL/prob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Real> 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.;
});
}
}
5 changes: 0 additions & 5 deletions Exec/ABL_input_sounding/prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ public:
amrex::Array4<amrex::Real const> 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"; }

Expand Down
25 changes: 0 additions & 25 deletions Exec/ABL_input_sounding/prob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Real> 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.;
});
}
}
5 changes: 0 additions & 5 deletions Exec/DevTests/MiguelDev/prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,6 @@ public:
amrex::Array4<amrex::Real const> 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"; }

Expand Down
28 changes: 0 additions & 28 deletions Exec/DevTests/MiguelDev/prob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Real> 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;
});
}
}
5 changes: 0 additions & 5 deletions Exec/DevTests/MultiBlock/prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ public:
amrex::Array4<amrex::Real const> 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"; }

Expand Down
28 changes: 0 additions & 28 deletions Exec/DevTests/MultiBlock/prob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Real> 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;
});
}
}
5 changes: 0 additions & 5 deletions Exec/LLJ/prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,6 @@ public:
amrex::Array4<amrex::Real const> 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"; }

Expand Down
25 changes: 0 additions & 25 deletions Exec/LLJ/prob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Real> 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.;
});
}
}
5 changes: 0 additions & 5 deletions Exec/Radiation/prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ public:
amrex::Array4<amrex::Real const> 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<amrex::Real>& tau,
amrex::Vector<amrex::Real>& ubar,
Expand Down
28 changes: 0 additions & 28 deletions Exec/Radiation/prob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Real> 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<amrex::Real>& tau,
Expand Down
5 changes: 0 additions & 5 deletions Exec/RegTests/Bubble/prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,6 @@ public:
amrex::Array4<amrex::Real const> 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:
Expand Down
28 changes: 0 additions & 28 deletions Exec/RegTests/Bubble/prob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Real> 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;
});
}
}
5 changes: 0 additions & 5 deletions Exec/RegTests/CouetteFlow/prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ public:
amrex::Array4<amrex::Real const> 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"; }

Expand Down
25 changes: 0 additions & 25 deletions Exec/RegTests/CouetteFlow/prob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Real> 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.;
});
}
}
5 changes: 0 additions & 5 deletions Exec/RegTests/DensityCurrent/prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ public:
amrex::Array4<amrex::Real const> 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"; }

Expand Down
29 changes: 0 additions & 29 deletions Exec/RegTests/DensityCurrent/prob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Real> 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;
});
}
}

5 changes: 0 additions & 5 deletions Exec/RegTests/DynamicRefinement/prob.H
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,6 @@ public:
amrex::Array4<amrex::Real const> 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"; }

Expand Down
Loading

0 comments on commit 8018f20

Please sign in to comment.