-
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.
- Loading branch information
Showing
20 changed files
with
131 additions
and
74 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
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 |
---|---|---|
@@ -1,7 +1,5 @@ | ||
@namespace: unit_test | ||
|
||
run_prefix string "" | ||
|
||
small_temp real 1.e5 | ||
small_dens real 1.e5 | ||
|
||
|
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
unit_test.run_prefix = "react_aprox13_" | ||
|
||
unit_test.small_temp = 1.e5 | ||
unit_test.small_dens = 1.e5 | ||
|
||
|
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
unit_test.run_prefix = "react_aprox13_mott_" | ||
|
||
unit_test.small_temp = 1e5 | ||
unit_test.small_dens = 1e5 | ||
|
||
|
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
unit_test.run_prefix = "react_aprox19_" | ||
|
||
unit_test.small_temp = 1.e5 | ||
unit_test.small_dens = 1.e5 | ||
|
||
|
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
unit_test.run_prefix = "react_aprox19_nse_" | ||
|
||
unit_test.small_temp = 1.e5 | ||
unit_test.small_dens = 1.e5 | ||
|
||
|
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
unit_test.run_prefix = "react_aprox21_" | ||
|
||
unit_test.small_temp = 1e5 | ||
unit_test.small_dens = 1e5 | ||
|
||
|
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
unit_test.run_prefix = "react_aprox21_rot1_" | ||
|
||
unit_test.small_temp = 1e5 | ||
unit_test.small_dens = 1e5 | ||
|
||
|
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
unit_test.run_prefix = "react_aprox21_rot2_" | ||
|
||
unit_test.small_temp = 1e5 | ||
unit_test.small_dens = 1e5 | ||
|
||
|
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
unit_test.run_prefix = "react_ecsn_" | ||
|
||
unit_test.small_temp = 1.e5 | ||
unit_test.small_dens = 1.e5 | ||
|
||
|
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
unit_test.run_prefix = "react_ignition_" | ||
|
||
unit_test.small_temp = 1e5 | ||
unit_test.small_dens = 1e5 | ||
|
||
|
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
unit_test.run_prefix = "react_ignition_chamulak_" | ||
|
||
unit_test.small_temp = 1e5 | ||
unit_test.small_dens = 1e5 | ||
|
||
|
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
unit_test.run_prefix = "react_iso7_" | ||
|
||
unit_test.small_temp = 1e5 | ||
unit_test.small_dens = 1e5 | ||
|
||
|
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
unit_test.run_prefix = "react_rprox_" | ||
|
||
unit_test.small_temp = 1e5 | ||
unit_test.small_dens = 1e5 | ||
|
||
|
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
unit_test.run_prefix = "react_subch_simple_" | ||
|
||
unit_test.small_temp = 1.e5 | ||
unit_test.small_dens = 1.e5 | ||
|
||
|
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
unit_test.run_prefix = "react_triple_" | ||
|
||
unit_test.small_temp = 1e5 | ||
unit_test.small_dens = 1e5 | ||
|
||
|
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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
unit_test.run_prefix = "react_vode_example_" | ||
|
||
unit_test.small_temp = 1.e5 | ||
unit_test.small_dens = 1e5 | ||
|
||
|
This file was deleted.
Oops, something went wrong.
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,65 @@ | ||
import argparse | ||
|
||
import matplotlib.pyplot as plt | ||
from matplotlib import ticker | ||
import numpy as np | ||
|
||
|
||
def doit(state_file, xmin, n_plot, outfile): | ||
|
||
data = np.genfromtxt(state_file, names=True) | ||
|
||
# find the keys of the most abundant species | ||
maxX = {} | ||
for k in data.dtype.names: | ||
if k in ["Time", "Temperature"]: | ||
continue | ||
maxX[k] = data[k].max() | ||
|
||
abundant = [k for k, v in sorted(maxX.items(), key=lambda item: item[1])][::-1] | ||
|
||
fig , (ax1, ax2) = plt.subplots(2, 1, sharex=True) | ||
|
||
ax1.plot(data["Time"], data["Temperature"]) | ||
ax1.set_xscale("log") | ||
ax1.grid(ls=":") | ||
|
||
ax1.set_ylabel("temperature [K]") | ||
ax1.yaxis.set_major_formatter(ticker.ScalarFormatter(useMathText=True)) | ||
|
||
# now the species | ||
for n in range(n_plot): | ||
ax2.plot(data["Time"], data[abundant[n]], label=abundant[n]) | ||
|
||
ax2.set_xscale("log") | ||
ax2.set_yscale("log") | ||
ax2.set_ylim(xmin, 1.5) | ||
ax2.grid(ls=":") | ||
|
||
ax2.set_xlabel("time (s)") | ||
ax2.set_ylabel("mass fraction") | ||
|
||
ax2.legend(fontsize="small") | ||
|
||
fig.tight_layout() | ||
|
||
fig.set_size_inches(6, 7) | ||
|
||
fig.savefig(outfile) | ||
|
||
|
||
if __name__ == "__main__": | ||
|
||
parser = argparse.ArgumentParser() | ||
parser.add_argument("--xmin", type=float, default=1.e-10, | ||
help="cutoff value for mass fractions") | ||
parser.add_argument("-n", type=int, default=5, | ||
help="number of species to plot (most abundant shown)") | ||
parser.add_argument("-o", type=str, default="state.png", | ||
help="name of plot output file") | ||
parser.add_argument("state_file", type=str, nargs=1, | ||
help="burn cell state history file") | ||
|
||
args = parser.parse_args() | ||
|
||
doit(args.state_file[0], args.xmin, args.n, args.o) |