diff --git a/Exec/radiation_tests/RadSphere/Problem_Derive.cpp b/Exec/radiation_tests/RadSphere/Problem_Derive.cpp index 2203ba1a92..f781613a99 100644 --- a/Exec/radiation_tests/RadSphere/Problem_Derive.cpp +++ b/Exec/radiation_tests/RadSphere/Problem_Derive.cpp @@ -2,11 +2,12 @@ #include #include +#include #include #include +#include #include #include -#include using namespace amrex; @@ -23,10 +24,12 @@ void deranalytic(const Box& bx, FArrayBox& derfab, int dcomp, int /*ncomp*/, auto const der = derfab.array(); GpuArray nugroup = {0.0}; - ca_get_nugroup(nugroup.begin()); - GpuArray 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) diff --git a/Source/driver/Castro.cpp b/Source/driver/Castro.cpp index 053fd861d7..5a5640d5b5 100644 --- a/Source/driver/Castro.cpp +++ b/Source/driver/Castro.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -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); diff --git a/Source/driver/global.H b/Source/driver/global.H index 77c5e56302..50cb666937 100644 --- a/Source/driver/global.H +++ b/Source/driver/global.H @@ -6,6 +6,7 @@ namespace global { AMREX_INLINE Amr* the_amr_ptr; + AMREX_INLINE Radiation* the_radiation_ptr; } #endif