Skip to content

Commit

Permalink
Update RadSphere
Browse files Browse the repository at this point in the history
  • Loading branch information
maxpkatz committed Oct 15, 2023
1 parent 4a8d157 commit 203d8f3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
11 changes: 7 additions & 4 deletions Exec/radiation_tests/RadSphere/Problem_Derive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

#include <Derive.H>
#include <Castro.H>
#include <Radiation.H>
#include <prob_parameters.H>
#include <extern_parameters.H>
#include <global.H>
#include <gravity_params.H>
#include <problem_util.H>
#include <RAD_F.H>

using namespace amrex;

Expand All @@ -23,10 +24,12 @@ void deranalytic(const Box& bx, FArrayBox& derfab, int dcomp, int /*ncomp*/,
auto const der = derfab.array();

GpuArray<Real, NGROUPS> nugroup = {0.0};
ca_get_nugroup(nugroup.begin());

GpuArray<Real, NGROUPS> dnugroup = {0.0};
ca_get_dnugroup(dnugroup.begin());

for (int i = 0; i < NGROUPS; ++i) {
nugroup[i] = global::the_radiation_ptr->nugroup[i];
dnugroup[i] = global::the_radiation_ptr->dnugroup[i];
}

amrex::ParallelFor(bx,
[=] AMREX_GPU_HOST_DEVICE (int i, int j, int k)
Expand Down
2 changes: 2 additions & 0 deletions Source/driver/Castro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <AMReX_Utility.H>
#include <AMReX_CONSTANTS.H>
#include <Castro.H>
#include <global.H>
#include <runtime_parameters.H>
#include <AMReX_VisMF.H>
#include <AMReX_TagBox.H>
Expand Down Expand Up @@ -722,6 +723,7 @@ Castro::Castro (Amr& papa,
if (radiation == nullptr) {
// radiation is a static object, only alloc if not already there
radiation = new Radiation(parent, this);
global::the_radiation_ptr = radiation;
}
radiation->regrid(level, grids, dmap);

Expand Down
1 change: 1 addition & 0 deletions Source/driver/global.H
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
namespace global
{
AMREX_INLINE Amr* the_amr_ptr;
AMREX_INLINE Radiation* the_radiation_ptr;
}

#endif

0 comments on commit 203d8f3

Please sign in to comment.