Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

robustify PrimordialChem unit test #1590

Merged
merged 4 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions unit_test/burn_cell_primordial_chem/burn_cell.H
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
amrex::Real grav_constant = 6.674e-8;

AMREX_INLINE
void burn_cell_c()
auto burn_cell_c() -> int
{

using namespace unit_test_rp;
Expand Down Expand Up @@ -255,6 +255,7 @@ void burn_cell_c()
for (int n = 0; n < NumSpec; ++n) {
std::cout << state.xn[n] << std::endl;
}


return state.success;
}
#endif
30 changes: 21 additions & 9 deletions unit_test/burn_cell_primordial_chem/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,32 @@ using namespace amrex;
int main(int argc, char *argv[]) {

amrex::Initialize(argc, argv);
int success = 0;

std::cout << "starting the single zone burn..." << std::endl;
{
// check that correct input file is provided
ParmParse const pp("unit_test");
std::string const run_prefix = "burn_cell_primordial_chem_";
std::string input_run_prefix;
pp.query("run_prefix", input_run_prefix);
AMREX_ALWAYS_ASSERT_WITH_MESSAGE(run_prefix == input_run_prefix, "input file is missing or incorrect!");

std::cout << "starting the single zone burn..." << std::endl;

ParmParse ppa("amr");
ParmParse ppa("amr");

init_unit_test();
init_unit_test();

// C++ EOS initialization (must be done after Fortran eos_init and init_extern_parameters)
eos_init(unit_test_rp::small_temp, unit_test_rp::small_dens);
// C++ EOS initialization (must be done after Fortran eos_init and init_extern_parameters)
eos_init(unit_test_rp::small_temp, unit_test_rp::small_dens);

// C++ Network, RHS, screening, rates initialization
network_init();

burn_cell_c();
// C++ Network, RHS, screening, rates initialization
network_init();

success = burn_cell_c();
}

amrex::Finalize();

return (!success);
}
Loading