diff --git a/Exec/unit_tests/test_react/GNUmakefile b/Exec/unit_tests/test_react/GNUmakefile index 1c32ed51e..2ce21dc63 100644 --- a/Exec/unit_tests/test_react/GNUmakefile +++ b/Exec/unit_tests/test_react/GNUmakefile @@ -8,6 +8,9 @@ USE_REACT = TRUE # define the location of the MAESTROEX home directory MAESTROEX_HOME := ../../.. +MAX_ZONES := 4096 + +DEFINES += -DN_XN_ZONES=$(MAX_ZONES) # define the physics packages to build this problem EOS_DIR := helmholtz diff --git a/Exec/unit_tests/test_react/MaestroEvolve.cpp b/Exec/unit_tests/test_react/MaestroEvolve.cpp index e5f361513..07bdee542 100644 --- a/Exec/unit_tests/test_react/MaestroEvolve.cpp +++ b/Exec/unit_tests/test_react/MaestroEvolve.cpp @@ -7,6 +7,14 @@ using namespace problem_rp; // advance solution to final time void Maestro::Evolve() { + + if (fixed_dt != -1.0) { + dt = fixed_dt; + if (maestro_verbose > 0) { + Print() << "Setting fixed dt = " << dt; + } + } + Vector rho_omegadot(finest_level + 1); Vector rho_Hnuc(finest_level + 1); Vector rho_Hext(finest_level + 1); @@ -60,13 +68,14 @@ void Maestro::Evolve() { WritePlotFile(-4, t_new, dt, dummy, dummy, dummy, dummy, rho_omegadot, rho_Hnuc, rho_Hext); - // Explore ten orders of magnitude of the time domain using user inputs. + // Explore orders of magnitude of the time domain using user inputs. do_burning = dbo; do_heating = dho; - + dt = min_time_step; for (auto i = 0; i < react_its; ++i) { React(sold, snew, rho_Hext, rho_omegadot, rho_Hnuc, p0_old, dt, t_old); WritePlotFile(i, t_new, dt, dummy, dummy, dummy, dummy, rho_omegadot, rho_Hnuc, rho_Hext); + dt*=10._rt; } } diff --git a/Exec/unit_tests/test_react/MaestroInit.cpp b/Exec/unit_tests/test_react/MaestroInit.cpp index df0fc6c95..6a73ffd5b 100644 --- a/Exec/unit_tests/test_react/MaestroInit.cpp +++ b/Exec/unit_tests/test_react/MaestroInit.cpp @@ -107,9 +107,43 @@ void Maestro::MakeNewLevelFromScratch(int lev, Real time, const BoxArray& ba, const auto temp_min_l = temp_min; const auto dens_min_l = dens_min; - GpuArray xn_zone; - // FIXME: need to allocate the xns here - + //read in composition + Array2D xn_zone; + if (xin_file == "uniform"){ + for (auto k = 0; k < xn_hi; ++k){ + for (auto comp = 0; comp < NumSpec; ++comp) { + xn_zone(k, comp) = 1./NumSpec; + } + } + } + else { + // open the file + std::ifstream xn_file_s(xin_file); + Print() << " xin file = " << xin_file << std::endl; + + if (!xn_file_s.is_open()) { + Abort("Could not open xin file!"); + } + + // start reading in the data + int comp = 0; + std::string line; + while (std::getline(xn_file_s, line)) { + //skip comments w/ nuc name + if (line.at(0) != '#'){ + std::istringstream iss(line); + for (auto k = 0; k < xn_hi; ++k) { + iss >> xn_zone(k, comp); + } + ++comp; + } + } + xn_file_s.close(); + if (comp != NumSpec){ + Abort("Number of species in xinfile does not match number in Network"); + } + } + // Loop over boxes (make sure mfi takes a cell-centered multifab as an argument) #ifdef _OPENMP #pragma omp parallel @@ -133,7 +167,7 @@ void Maestro::MakeNewLevelFromScratch(int lev, Real time, const BoxArray& ba, eos_state.T = temp_zone; eos_state.rho = dens_zone; for (auto comp = 0; comp < NumSpec; ++comp) { - eos_state.xn[comp] = xn_zone[comp]; + eos_state.xn[comp] = xn_zone(k, comp); } eos(eos_input_rt, eos_state); @@ -143,7 +177,7 @@ void Maestro::MakeNewLevelFromScratch(int lev, Real time, const BoxArray& ba, scal(i, j, k, RhoH) = dens_zone * eos_state.h; scal(i, j, k, Temp) = temp_zone; for (auto comp = 0; comp < NumSpec; ++comp) { - scal(i, j, k, FirstSpec + comp) = dens_zone * xn_zone[comp]; + scal(i, j, k, FirstSpec + comp) = dens_zone * xn_zone(k, comp); } }); } diff --git a/Exec/unit_tests/test_react/inputs_3alpha b/Exec/unit_tests/test_react/inputs_3alpha index d83bcf47f..0303b36e8 100644 --- a/Exec/unit_tests/test_react/inputs_3alpha +++ b/Exec/unit_tests/test_react/inputs_3alpha @@ -38,9 +38,9 @@ maestro.hi_bc = 0 0 0 geometry.is_periodic = 1 1 1 # VERBOSITY -maestro.v = 1 # verbosity -maestro.mg_verbose = 0 -maestro.cg_verbose = 0 +maestro.maestro_verbose = 1 # verbosity +maestro.mg_verbose = 0 +maestro.cg_verbose = 0 # DIFFUSION parameters maestro.do_heating = false diff --git a/Exec/unit_tests/test_react/inputs_aprox13 b/Exec/unit_tests/test_react/inputs_aprox13 index 0634e97f1..381398f98 100644 --- a/Exec/unit_tests/test_react/inputs_aprox13 +++ b/Exec/unit_tests/test_react/inputs_aprox13 @@ -38,9 +38,9 @@ maestro.hi_bc = 0 0 0 geometry.is_periodic = 1 1 1 # VERBOSITY -maestro.v = 1 # verbosity -maestro.mg_verbose = 0 -maestro.cg_verbose = 0 +maestro.maestro_verbose = 1 # verbosity +maestro.mg_verbose = 0 +maestro.cg_verbose = 0 # DIFFUSION parameters maestro.do_heating = false diff --git a/Exec/unit_tests/test_react/inputs_ignition b/Exec/unit_tests/test_react/inputs_ignition index be7d7a913..5ab1a887b 100644 --- a/Exec/unit_tests/test_react/inputs_ignition +++ b/Exec/unit_tests/test_react/inputs_ignition @@ -38,9 +38,9 @@ maestro.hi_bc = 0 0 0 geometry.is_periodic = 1 1 1 # VERBOSITY -maestro.v = 1 # verbosity -maestro.mg_verbose = 0 -maestro.cg_verbose = 0 +maestro.maestro_verbose = 1 # verbosity +maestro.mg_verbose = 0 +maestro.cg_verbose = 0 # DIFFUSION parameters maestro.do_heating = false diff --git a/Exec/unit_tests/test_react/inputs_mesa_carbon b/Exec/unit_tests/test_react/inputs_mesa_carbon index d8ffbcdc0..6b27bc2f0 100644 --- a/Exec/unit_tests/test_react/inputs_mesa_carbon +++ b/Exec/unit_tests/test_react/inputs_mesa_carbon @@ -38,9 +38,9 @@ maestro.hi_bc = 0 0 0 geometry.is_periodic = 1 1 1 # VERBOSITY -maestro.v = 1 # verbosity -maestro.mg_verbose = 0 -maestro.cg_verbose = 0 +maestro.maestro_verbose = 1 # verbosity +maestro.mg_verbose = 0 +maestro.cg_verbose = 0 # DIFFUSION parameters maestro.do_heating = false diff --git a/Exec/unit_tests/test_react/inputs_reaclib_cburn b/Exec/unit_tests/test_react/inputs_reaclib_cburn index 20712c307..8c94e5220 100644 --- a/Exec/unit_tests/test_react/inputs_reaclib_cburn +++ b/Exec/unit_tests/test_react/inputs_reaclib_cburn @@ -38,9 +38,9 @@ maestro.hi_bc = 0 0 0 geometry.is_periodic = 1 1 1 # VERBOSITY -maestro.v = 1 # verbosity -maestro.mg_verbose = 0 -maestro.cg_verbose = 0 +maestro.maestro_verbose = 1 # verbosity +maestro.mg_verbose = 0 +maestro.cg_verbose = 0 # DIFFUSION parameters maestro.do_heating = true diff --git a/Exec/unit_tests/test_react/inputs_reaclib_ctest b/Exec/unit_tests/test_react/inputs_reaclib_ctest index c7e98e4f0..05a8e60cf 100644 --- a/Exec/unit_tests/test_react/inputs_reaclib_ctest +++ b/Exec/unit_tests/test_react/inputs_reaclib_ctest @@ -38,9 +38,9 @@ maestro.hi_bc = 0 0 0 geometry.is_periodic = 1 1 1 # VERBOSITY -maestro.v = 1 # verbosity -maestro.mg_verbose = 0 -maestro.cg_verbose = 0 +maestro.maestro_verbose = 1 # verbosity +maestro.mg_verbose = 0 +maestro.cg_verbose = 0 # DIFFUSION parameters maestro.do_heating = false diff --git a/Exec/unit_tests/test_react/inputs_reaclib_urca b/Exec/unit_tests/test_react/inputs_reaclib_urca index ee20a0476..b41b23b12 100644 --- a/Exec/unit_tests/test_react/inputs_reaclib_urca +++ b/Exec/unit_tests/test_react/inputs_reaclib_urca @@ -38,9 +38,9 @@ maestro.hi_bc = 0 0 0 geometry.is_periodic = 1 1 1 # VERBOSITY -maestro.v = 1 # verbosity -maestro.mg_verbose = 0 -maestro.cg_verbose = 0 +maestro.maestro_verbose = 1 # verbosity +maestro.mg_verbose = 0 +maestro.cg_verbose = 0 # DIFFUSION parameters maestro.do_heating = false diff --git a/Exec/unit_tests/test_react/inputs_react b/Exec/unit_tests/test_react/inputs_react index 85943e30f..e01b88024 100644 --- a/Exec/unit_tests/test_react/inputs_react +++ b/Exec/unit_tests/test_react/inputs_react @@ -38,9 +38,9 @@ maestro.hi_bc = 0 0 0 geometry.is_periodic = 1 1 1 # VERBOSITY -maestro.v = 1 # verbosity -maestro.mg_verbose = 0 -maestro.cg_verbose = 0 +maestro.maestro_verbose = 1 # verbosity +maestro.mg_verbose = 0 +maestro.cg_verbose = 0 # DIFFUSION parameters maestro.do_heating = false diff --git a/Exec/unit_tests/test_react/inputs_rprox b/Exec/unit_tests/test_react/inputs_rprox index 544b6ca4e..86720467d 100644 --- a/Exec/unit_tests/test_react/inputs_rprox +++ b/Exec/unit_tests/test_react/inputs_rprox @@ -38,9 +38,9 @@ maestro.hi_bc = 0 0 0 geometry.is_periodic = 1 1 1 # VERBOSITY -maestro.v = 1 # verbosity -maestro.mg_verbose = 0 -maestro.cg_verbose = 0 +maestro.maestro_verbose = 1 # verbosity +maestro.mg_verbose = 0 +maestro.cg_verbose = 0 # DIFFUSION parameters maestro.do_heating = false diff --git a/Exec/unit_tests/test_react/inputs_xrb_simple b/Exec/unit_tests/test_react/inputs_xrb_simple index 278d5145e..3af00b64e 100644 --- a/Exec/unit_tests/test_react/inputs_xrb_simple +++ b/Exec/unit_tests/test_react/inputs_xrb_simple @@ -38,9 +38,9 @@ maestro.hi_bc = 0 0 0 geometry.is_periodic = 1 1 1 # VERBOSITY -maestro.v = 1 # verbosity -maestro.mg_verbose = 0 -maestro.cg_verbose = 0 +maestro.maestro_verbose = 1 # verbosity +maestro.mg_verbose = 0 +maestro.cg_verbose = 0 # DIFFUSION parameters maestro.do_heating = false