Skip to content

Commit

Permalink
Redist move (#224)
Browse files Browse the repository at this point in the history
* updates for redist move from amrex-hydro to amrex

* some Efield fixes
  • Loading branch information
baperry2 authored Jul 5, 2023
1 parent 07def54 commit 0d8a2b9
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 28 deletions.
3 changes: 1 addition & 2 deletions Source/DiffusionOp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <AMReX_VisMF.H>

#ifdef AMREX_USE_EB
#include <AMReX_EB_utils.H>
#include <AMReX_EB_Redistribution.H>
#include <AMReX_EBFArrayBox.H>
#endif

Expand Down Expand Up @@ -1131,4 +1131,3 @@ DiffusionTensorOp::readParameters ()
pp.query("num_pre_smooth",m_num_pre_smooth);
pp.query("num_post_smooth",m_num_post_smooth);
}

2 changes: 1 addition & 1 deletion Source/Efield/PeleLMEF_K.H
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

#include <PeleLMEF_Constants.H>
#include <PelePhysics.H>
#include <hydro_slopes_K.H>
#include <AMReX_Slopes_K.H>
#include <EOS_Extension.H>
#include <mechanism.H>

Expand Down
42 changes: 21 additions & 21 deletions Source/PeleLMEB.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#ifdef AMREX_USE_EB
#include <AMReX_EB2.H>
#include <AMReX_EB2_IF.H>
#include <hydro_redistribution.H>
#include <AMReX_EB_Redistribution.H>
#include <AMReX_EBMFInterpolater.H>

using namespace amrex;
Expand Down Expand Up @@ -108,11 +108,11 @@ void PeleLM::redistributeAofS(int a_lev,
[=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
{ scratch(i,j,k) = 1.;});
}
Redistribution::Apply( bx, ncomp, aofs_ar, divT_ar,
a_state.const_array(mfi, state_comp), scratch, flag,
AMREX_D_DECL(apx,apy,apz), vfrac_arr,
AMREX_D_DECL(fcx,fcy,fcz), ccc, d_bc,
a_geom, a_dt, m_adv_redist_type );
ApplyRedistribution( bx, ncomp, aofs_ar, divT_ar,
a_state.const_array(mfi, state_comp), scratch, flag,
AMREX_D_DECL(apx,apy,apz), vfrac_arr,
AMREX_D_DECL(fcx,fcy,fcz), ccc, d_bc,
a_geom, a_dt, m_adv_redist_type );
} else {
// Move data to AofS for regular bx
amrex::ParallelFor(bx, ncomp, [=]
Expand Down Expand Up @@ -232,11 +232,11 @@ void PeleLM::redistributeDiff(int a_lev,
[=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
{ scratch(i,j,k) = 1.;});
}
Redistribution::Apply( bx, ncomp, diff_ar, divT_ar,
a_state.const_array(mfi, state_comp), scratch, flag,
AMREX_D_DECL(apx,apy,apz), vfrac_arr,
AMREX_D_DECL(fcx,fcy,fcz), ccc, d_bc,
a_geom, a_dt, m_diff_redist_type );
ApplyRedistribution( bx, ncomp, diff_ar, divT_ar,
a_state.const_array(mfi, state_comp), scratch, flag,
AMREX_D_DECL(apx,apy,apz), vfrac_arr,
AMREX_D_DECL(fcx,fcy,fcz), ccc, d_bc,
a_geom, a_dt, m_diff_redist_type );
} else {
// Move data to AofS for regular bx
amrex::ParallelFor(bx, ncomp, [=]
Expand Down Expand Up @@ -353,19 +353,19 @@ void PeleLM::initialRedistribution()
if ( m_incompressible ) {
auto bcRec = fetchBCRecArray(0,AMREX_SPACEDIM);
auto bcRec_d = convertToDeviceVector(bcRec);
Redistribution::ApplyToInitialData( bx, AMREX_SPACEDIM,
ldataNew_p->state.array(mfi,0), ldataOld_p->state.array(mfi,0),
flag, AMREX_D_DECL(apx, apy, apz), vfrac,
AMREX_D_DECL(fcx, fcy, fcz), ccc,
bcRec_d.dataPtr(), geom[lev], m_adv_redist_type);
ApplyInitialRedistribution( bx, AMREX_SPACEDIM,
ldataNew_p->state.array(mfi,0), ldataOld_p->state.array(mfi,0),
flag, AMREX_D_DECL(apx, apy, apz), vfrac,
AMREX_D_DECL(fcx, fcy, fcz), ccc,
bcRec_d.dataPtr(), geom[lev], m_adv_redist_type);
} else {
auto bcRec = fetchBCRecArray(0,NVAR);
auto bcRec_d = convertToDeviceVector(bcRec);
Redistribution::ApplyToInitialData( bx, NVAR,
ldataNew_p->state.array(mfi,0), ldataOld_p->state.array(mfi,0),
flag, AMREX_D_DECL(apx, apy, apz), vfrac,
AMREX_D_DECL(fcx, fcy, fcz), ccc,
bcRec_d.dataPtr(), geom[lev], m_adv_redist_type);
ApplyInitialRedistribution( bx, NVAR,
ldataNew_p->state.array(mfi,0), ldataOld_p->state.array(mfi,0),
flag, AMREX_D_DECL(apx, apy, apz), vfrac,
AMREX_D_DECL(fcx, fcy, fcz), ccc,
bcRec_d.dataPtr(), geom[lev], m_adv_redist_type);
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions Source/PeleLMSetup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
using namespace amrex;

static Box the_same_box (const Box& b) { return b; }
#ifdef PELE_USE_EFIELD
static Box grow_box_by_one (const Box& b) { return amrex::grow(b,1); }
#endif
static Box grow_box_by_two (const Box& b) { return amrex::grow(b,2); }

void PeleLM::Setup() {
Expand Down Expand Up @@ -187,6 +190,8 @@ void PeleLM::readParameters() {
ParmParse ppef("ef");

// Get the phiV bc
Vector<std::string> lo_bc_char(AMREX_SPACEDIM);
Vector<std::string> hi_bc_char(AMREX_SPACEDIM);
ppef.getarr("phiV_lo_bc",lo_bc_char,0,AMREX_SPACEDIM);
ppef.getarr("phiV_hi_bc",hi_bc_char,0,AMREX_SPACEDIM);
for (int idim = 0; idim < AMREX_SPACEDIM; idim++)
Expand Down
2 changes: 1 addition & 1 deletion Submodules/AMReX-Hydro
2 changes: 1 addition & 1 deletion Submodules/amrex
Submodule amrex updated 398 files
4 changes: 2 additions & 2 deletions Utils/Make.PeleLMeX
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,9 @@ include $(PELE_PHYSICS_HOME)/ThirdParty/Make.ThirdParty
#---------------
# AMReX-Hydro sources
#---------------
Hdirs := Slopes Godunov MOL Utils Projections BDS
Hdirs := Godunov MOL Utils Projections BDS
ifeq ($(USE_EB), TRUE)
Hdirs += Redistribution EBGodunov EBMOL
Hdirs += EBGodunov EBMOL
endif
Bpack += $(foreach dir, $(Hdirs), $(AMREX_HYDRO_HOME)/$(dir)/Make.package)
Blocs += $(foreach dir, $(Hdirs), $(AMREX_HYDRO_HOME)/$(dir))
Expand Down

0 comments on commit 0d8a2b9

Please sign in to comment.