-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create a struct to hold the Microphysics runtime parameters (#1433)
This now creates a header extern_type.H with a struct extern_t that holds all of the runtime parameters for Microphysics. The struct is filled on initialization and returned by init_extern_parameters(). This can replace the global version of the runtime parameters. This also revives the test_parameters unit test to show how to access things.
- Loading branch information
Showing
10 changed files
with
168 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
PRECISION = DOUBLE | ||
PROFILE = FALSE | ||
|
||
DEBUG = FALSE | ||
|
||
DIM = 3 | ||
|
||
COMP = gnu | ||
|
||
USE_MPI = FALSE | ||
USE_OMP = FALSE | ||
|
||
USE_REACT = TRUE | ||
|
||
EBASE = main | ||
|
||
BL_NO_FORT = TRUE | ||
|
||
# define the location of the Microphysics top directory | ||
MICROPHYSICS_HOME := ../.. | ||
|
||
# This sets the EOS directory | ||
EOS_DIR := helmholtz | ||
|
||
# This sets the network directory | ||
NETWORK_DIR := aprox19 | ||
|
||
EXTERN_SEARCH += . .. | ||
|
||
Bpack := ./Make.package | ||
Blocs := . | ||
|
||
include $(MICROPHYSICS_HOME)/unit_test/Make.unit_test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
CEXE_sources += main.cpp | ||
|
||
CEXE_headers += test_parameters.H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
@namespace: unit_test | ||
|
||
dens_min real 1.e6 | ||
dens_max real 1.e9 | ||
temp_min real 1.e6 | ||
temp_max real 1.e12 | ||
|
||
small_temp real 1.e4 | ||
small_dens real 1.e-4 | ||
|
||
test_string string "test" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
unit_test.test_string = "this is a C++ string" | ||
eos.eos_input_is_constant = 0 | ||
|
||
amr.probin = probin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#include <AMReX_PlotFileUtil.H> | ||
#include <AMReX_ParmParse.H> | ||
#include <AMReX_Print.H> | ||
|
||
#include <AMReX_Geometry.H> | ||
#include <AMReX_MultiFab.H> | ||
#include <AMReX_BCRec.H> | ||
|
||
|
||
using namespace amrex; | ||
|
||
#include <test_parameters.H> | ||
#include <AMReX_buildInfo.H> | ||
|
||
#include <extern_parameters.H> | ||
#include <unit_test.H> | ||
|
||
int main (int argc, char* argv[]) | ||
{ | ||
amrex::Initialize(argc, argv); | ||
|
||
main_main(); | ||
|
||
amrex::Finalize(); | ||
return 0; | ||
} | ||
|
||
void main_main () | ||
{ | ||
|
||
// do the runtime parameter initializations and microphysics inits | ||
if (ParallelDescriptor::IOProcessor()) { | ||
std::cout << "reading extern runtime parameters ..." << std::endl; | ||
} | ||
|
||
ParmParse ppa("amr"); | ||
|
||
auto params = init_unit_test(); | ||
|
||
std::cout << "in C++" << std::endl; | ||
|
||
std::cout << " eos_input_is_constant = " << eos_rp::eos_input_is_constant << " " << params.eos.eos_input_is_constant << std::endl; | ||
std::cout << " test_string = " << unit_test_rp::test_string << " " << params.unit_test.test_string << std::endl; | ||
std::cout << " dens_min = " << unit_test_rp::dens_min << " " << params.unit_test.dens_min << std::endl; | ||
std::cout << " nonaka_file = " << integrator_rp::nonaka_file << " " << params.integrator.nonaka_file << std::endl; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#ifndef TEST_EOS_H | ||
#define TEST_EOS_H | ||
|
||
void main_main(); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters