-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
101 lines (82 loc) · 2.46 KB
/
Copy pathCMakeLists.txt
File metadata and controls
101 lines (82 loc) · 2.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
set(microphysics_network_name "photoionization") # this will override
# network_name to
# photoionization for this
# directory only
setup_target_for_microphysics_compilation(${microphysics_network_name}
"${CMAKE_CURRENT_BINARY_DIR}/")
# use the BEFORE keyword so that these files get priority in compilation for
# targets in this directory this is critical to ensure the correct Microphysics
# files are linked to photoionization target
include_directories(
BEFORE ${photoionization_dirs} "${CMAKE_CURRENT_BINARY_DIR}/"
"includes/extern_parameters.H" "includes/network_properties.H")
set(JOB_NAME OneZonePhotoionization)
# Number of species
set(NSPEC 3)
set(NEXTRASPEC 0)
# Species enums
set(SPECIES_ENUM
"e = 0,
H,
Hp"
)
# Atomic masses (in atomic mass units)
set(AION
"5.4858e-4,
1.0,
1.0"
)
set(AION_INV
"1822.89,
1.0,
1.0"
)
# Charges
set(ZION
"1.0,
1.0,
1.0"
)
# constexpr switch bodies
set(AION_CONSTEXPR
"case e: a = 1.0; break;
case H: a = 1.0; break;
case Hp: a = 1.0; break;"
)
set(ZION_CONSTEXPR
"case e: z = 1.0; break;
case H: z = 1.0; break;
case Hp: z = 1.0; break;"
)
# Species names
set(SHORT_SPEC_NAMES
"\"e\",
\"H\",
\"H+\""
)
set(SPEC_NAMES
"\"Electron\",
\"Hydrogen\",
\"Hydrogen_Ion\""
)
# No extra network properties
set(PROPERTIES "")
# Set photoionisation properties
set(NUM_CHEM_BANDS 1)
set(CHEM_BANDS "3.29e15, 1.50e16") # Hz
# Configure the header
configure_file(
${CMAKE_SOURCE_DIR}/src/networks/network_header.template
${CMAKE_CURRENT_BINARY_DIR}/network_properties.H
@ONLY
)
add_executable(
${JOB_NAME} testOneZonePhotoionization.cpp "${QuokkaSourcesNoEOS}"
../../radiation/photochemistry.cpp ${photoionization_sources})
# this will add #define PHOTOCHEMISTRY
target_compile_definitions(${JOB_NAME} PUBLIC PHOTOCHEMISTRY SKIP_PHOTOCHEMFLUX SKIP_RAD_NUM_CONV)
if(AMReX_GPU_BACKEND MATCHES "CUDA")
setup_target_for_cuda_compilation(${JOB_NAME})
endif(AMReX_GPU_BACKEND MATCHES "CUDA")
add_test(NAME OneZonePhotoionizationNoEnergy COMMAND ${JOB_NAME} ../inputs/OneZonePhotoionization.toml ${QuokkaTestParams} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests)
add_test(NAME OneZonePhotoionizationWithEnergy COMMAND ${JOB_NAME} ../inputs/OneZonePhotoionizationWithEnergy.toml ${QuokkaTestParams} WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests)