Skip to content

Commit 9490678

Browse files
committed
more progress
1 parent 86a6537 commit 9490678

File tree

2 files changed

+27
-15
lines changed

2 files changed

+27
-15
lines changed

source/spectral_radius/GNUmakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ EBASE := sprad
2626
EOS_DIR := helmholtz
2727

2828
# this should match what we used for the simulation
29-
NETWORK_DIR := nova-li
29+
NETWORK_DIR := nova
3030

3131
# this should be RKC so we have access to the circle theorem function
3232
INTEGRATOR_DIR := RKC

source/spectral_radius/main.cpp

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717

1818
#include <network.H>
1919
#include <eos.H>
20+
#include <burn_type.H>
21+
#include <rkc_type.H>
22+
#include <integrator_data.H>
23+
#include <circle_theorem.H>
2024

2125
using namespace amrex;
2226

@@ -62,6 +66,9 @@ int main(int argc, char* argv[])
6266
// we will use a mask that tells us if a zone on the current level
6367
// is covered by data on a finer level.
6468

69+
amrex::Real sprad_max{-1.0};
70+
burn_t burn_state_max;
71+
6572
for (int ilev = 0; ilev <= fine_level; ++ilev) {
6673

6774
if (ilev < fine_level) {
@@ -86,26 +93,31 @@ int main(int argc, char* argv[])
8693
for (int j = lo.y; j <= hi.y; ++j) {
8794
for (int i = lo.x; i <= hi.x; ++i) {
8895

89-
// if we only wanted to work on the zones not covered
90-
// by finer grids (e.g., for computing a global sum)
91-
// we'd uncomment this mask check
92-
93-
//if (m(i,j,k) == 0) { // not covered by fine
94-
95-
// compute the coordinate of the current zone
96+
burn_t burn_state;
9697

97-
eos_t eos_state;
98-
99-
eos_state.rho = fab(i,j,k,dens_comp);
100-
eos_state.T = fab(i,j,k,temp_comp);
98+
burn_state.rho = fab(i,j,k,dens_comp);
99+
burn_state.T = fab(i,j,k,temp_comp);
101100
for (int n = 0; n < NumSpec; ++n) {
102-
eos_state.xn[n] = fab(i,j,k,spec_comp+n);
101+
burn_state.xn[n] = fab(i,j,k,spec_comp+n);
103102
}
104103

105-
eos(eos_input_rt, eos_state);
104+
// we also need internal energy
105+
eos(eos_input_rt, burn_state);
106+
burn_state.e_scale = burn_state.e;
106107

107-
// } // mask
108+
// we need to load up the integrator type
109+
constexpr int int_neqs = integrator_neqs<burn_t>();
110+
rkc_t<int_neqs> rstate;
111+
burn_to_integrator(burn_state, rstate);
112+
rstate.t = 0.0;
108113

114+
amrex::Real sprad{};
115+
circle_theorem_sprad(rstate.t, burn_state, rstate, sprad);
116+
117+
if (sprad > sprad_max) {
118+
sprad_max = sprad;
119+
burn_state_max = burn_state;
120+
}
109121
}
110122
}
111123
}

0 commit comments

Comments
 (0)