|
5 | 5 |
|
6 | 6 | @author: cpf5546 |
7 | 7 | """ |
| 8 | +import json |
8 | 9 | import pandas as pd |
9 | 10 | import matplotlib.pyplot as plt |
10 | 11 |
|
11 | | -from pySDC.playgrounds.dedalus.problems.rbc import OutputFiles, checkDNS |
12 | | - |
13 | | -OutputFiles.VERBOSE = True |
| 12 | +from pySDC.playgrounds.dedalus.problems.rbc import checkDNS |
14 | 13 |
|
15 | 14 | simDirs = [ |
16 | 15 | "run_3D_A4_M0.5_R1_Ra5e3", |
|
29 | 28 | "run_3D_A4_M1_R1_Ra1e6", |
30 | 29 | ] |
31 | 30 |
|
32 | | -simDirs = [ |
| 31 | +runs = [ |
33 | 32 | "run_3D_A4_M1_R2_Ra1.5e5", |
| 33 | + "run_3D_A4_M1_R2_Ra3e5", |
| 34 | + "run_3D_A4_M1_R2_Ra5e5", |
| 35 | + "run_3D_A4_M1_R2_Ra8e5", |
| 36 | + "run_3D_A4_M1_R2_Ra9.5e5", |
34 | 37 | "run_3D_A4_M1_R2_Ra1e6", |
| 38 | + "run_3D_A4_M1_R2_Ra2e6" |
| 39 | + ] |
| 40 | + |
| 41 | +runs = [ |
| 42 | + "run_3D_A4_M1_R4_Ra2e6", |
| 43 | + "run_3D_A4_M1_R4_Ra5e6", |
35 | 44 | ] |
36 | 45 |
|
37 | 46 | df = pd.DataFrame( |
38 | 47 | columns=["Ra", "c_2[u]", "c_2[uv]", "c_2[uh]", "c_2[b]", "c_2[p]"]) |
39 | 48 |
|
40 | | -for i, dirName in enumerate(simDirs): |
| 49 | +for i, run in enumerate(runs): |
41 | 50 |
|
42 | | - output = OutputFiles(dirName) |
43 | | - df.loc[i, "Ra"] = float(dirName.split("_Ra")[-1]) |
| 51 | + with open(f"postData/{run}.json", "r") as f: |
| 52 | + data = json.load(f) |
44 | 53 |
|
45 | | - # assert len(output.times) == 61, f"not 61 fields for {dirName}" |
46 | | - # if len(output.times) == 61: |
47 | | - # start = 20 |
48 | | - # else: |
49 | | - # start = 60 |
50 | | - start = 20 |
| 54 | + df.loc[i, "Ra"] = data["infos"]["Ra"] |
51 | 55 |
|
52 | | - spectrum = output.getSpectrum( |
53 | | - which="all", zVal="all", |
54 | | - start=start, batchSize=None) |
55 | | - kappa = output.kappa |
| 56 | + spectrum = data["spectrum"] |
| 57 | + kappa = data["spectrum"]["kappa"] |
56 | 58 |
|
57 | 59 | for name in ["u", "uv", "uh", "b", "p"]: |
58 | 60 | check = checkDNS(spectrum[name], kappa) |
|
70 | 72 | plt.ylabel("quadratic coefficient $c_2$") |
71 | 73 | plt.tight_layout() |
72 | 74 |
|
73 | | -# df.columns = ["$"+label+"$" for label in df.columns] |
| 75 | +df.columns = ["$"+label+"$" for label in df.columns] |
| 76 | +print(df.to_markdown(index=False)) |
0 commit comments