Skip to content

Commit

Permalink
WIP -- it won't compile until we can use the updated amrex (#1488)
Browse files Browse the repository at this point in the history
* start to generalizing AMR

* generalizing refinement

* more for AMR

* more towards AMR

* use conservative face interpolater

* more fixes

* Update ERF_fast_rhs_N.cpp

---------

Co-authored-by: Aaron M. Lattanzi <[email protected]>
  • Loading branch information
asalmgren and AMLattanzi authored Mar 12, 2024
1 parent f97cda0 commit 7861ec1
Show file tree
Hide file tree
Showing 33 changed files with 648 additions and 511 deletions.
6 changes: 3 additions & 3 deletions Docs/sphinx_doc/Inputs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ List of Parameters
| | after | | |
| | restarting | | |
+---------------------------+-----------------+-----------------+-------------+
| **amr.iterate_grids** | do we iterate | True, False | True |
| **amr.iterate_grids** | do we iterate | true, false | true |
| | on the grids? | | |
| | | | |
+---------------------------+-----------------+-----------------+-------------+
Expand Down Expand Up @@ -778,8 +778,8 @@ List of Parameters
| **erf.Sc_t** | Turbulent Schmidt | Real | 1.0 |
| | Number | | |
+----------------------------------+--------------------+---------------------+--------------+
| **erf.use_NumDiff** | Use 6th order | "True", | "False" |
| | numerical diffusion| "False" | |
| **erf.use_NumDiff** | Use 6th order | "true", | "false" |
| | numerical diffusion| "false" | |
| | | | |
+----------------------------------+--------------------+---------------------+--------------+
| **erf.NumDiffCoeff** | Coefficient for | Real | 0.0 |
Expand Down
3 changes: 2 additions & 1 deletion Exec/ABL_input_sounding/prob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ Problem::init_custom_pert(
});

// Set the z-velocity
ParallelForRNG(zbx, [=, parms=parms] AMREX_GPU_DEVICE(int i, int j, int k, const amrex::RandomEngine& engine) noexcept {
ParallelForRNG(zbx, [=, parms=parms] AMREX_GPU_DEVICE(int i, int j, int k, const amrex::RandomEngine& engine) noexcept
{
const int dom_lo_z = geomdata.Domain().smallEnd()[2];
const int dom_hi_z = geomdata.Domain().bigEnd()[2];

Expand Down
24 changes: 7 additions & 17 deletions Exec/DevTests/MovingTerrain/prob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,8 @@ Problem::init_custom_pert(
Array4<Real const> const& /*mf_v*/,
const SolverChoice& sc)
{
const int khi = geomdata.Domain().bigEnd()[2];

const bool use_moisture = (sc.moisture_type != MoistureType::None);

AMREX_ALWAYS_ASSERT(bx.length()[2] == khi+1);

const Real T_sfc = parms.T_0;
const Real rho_sfc = p_0 / (R_d*T_sfc);
//const Real thetabar = T_sfc;
Expand All @@ -59,9 +55,6 @@ Problem::init_custom_pert(
Real g = CONST_GRAV;
Real omega = std::sqrt(g * kp);

// HACK HACK HACK
// Ampl = 0.;

amrex::ParallelFor(bx, [=] AMREX_GPU_DEVICE(int i, int j, int k) noexcept
{
const auto prob_lo = geomdata.ProbLo();
Expand Down Expand Up @@ -131,13 +124,11 @@ Problem::init_custom_pert(
}

void
Problem::erf_init_rayleigh(
amrex::Vector<amrex::Vector<amrex::Real> >& rayleigh_ptrs,
amrex::Geometry const& geom,
std::unique_ptr<MultiFab>& /*z_phys_cc*/)
Problem::erf_init_rayleigh (Vector<amrex::Vector<amrex::Real> >& rayleigh_ptrs,
Geometry const& geom,
std::unique_ptr<MultiFab>& /*z_phys_cc*/)
{
const int khi = geom.Domain().bigEnd()[2];

for (int k = 0; k <= khi; k++)
{
rayleigh_ptrs[Rayleigh::tau][k] = 0.0;
Expand All @@ -159,10 +150,9 @@ Problem::erf_init_rayleigh(
}

void
Problem::init_custom_terrain(
const Geometry& geom,
MultiFab& z_phys_nd,
const Real& time)
Problem::init_custom_terrain (const Geometry& geom,
MultiFab& z_phys_nd,
const Real& time)
{
// Domain cell size and real bounds
auto dx = geom.CellSizeArray();
Expand All @@ -184,7 +174,7 @@ Problem::init_custom_terrain(
Real g = CONST_GRAV;
Real omega = std::sqrt(g * kp);

for ( amrex::MFIter mfi(z_phys_nd,amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi )
for (MFIter mfi(z_phys_nd,amrex::TilingIfNotGPU()); mfi.isValid(); ++mfi)
{
// Grown box with no z range
amrex::Box xybx = mfi.growntilebox(ngrow);
Expand Down
Loading

0 comments on commit 7861ec1

Please sign in to comment.