|
35 | 35 | "metadata": {},
|
36 | 36 | "outputs": [],
|
37 | 37 | "source": [
|
38 |
| - "!ls /anvil/projects/x-phy220105/cwsmith/vlabApps/gkyldataset" |
| 38 | + "!ls /anvil/projects/x-phy220105/gkylMarch2025/vlabApps/gemReconnection" |
39 | 39 | ]
|
40 | 40 | },
|
41 | 41 | {
|
|
46 | 46 | "outputs": [],
|
47 | 47 | "source": [
|
48 | 48 | "from pathlib import Path\n",
|
49 |
| - "import matplotlib.pyplot as plt \n", |
50 |
| - "\n", |
51 |
| - "import os\n", |
52 |
| - "\n", |
| 49 | + "import matplotlib.pyplot as plt\n", |
53 | 50 | "import postgkyl as pg\n",
|
54 | 51 | "\n",
|
55 |
| - "data_base_path = \"/anvil/projects/x-phy220105/cwsmith/vlabApps/gkyldataset\"\n", |
| 52 | + "data_base_path = \"/anvil/projects/x-phy220105/gkylMarch2025/vlabApps/gemReconnection\"\n", |
56 | 53 | "run = Path.cwd()\n",
|
57 | 54 | "\n",
|
58 | 55 | "def getModelType():\n",
|
59 |
| - " frame = 0 \n", |
| 56 | + " frame = 0\n", |
60 | 57 | " models = [\"5m\", \"10m\"]\n",
|
61 | 58 | " for model in models:\n",
|
62 |
| - " path = Path(f\"{data_base_path}/rt-{model}-gem_field_{frame}.bp\")\n", |
| 59 | + " path = Path(f\"{data_base_path}/rt_{model}_gem_gzero-field_{frame}.gkyl\")\n", |
63 | 60 | " if path.is_file():\n",
|
64 | 61 | " return model\n",
|
65 |
| - " error = \"Failed to find input ADIOS file rt-5m-gem_field_0.bp or rt-10m-gem_field_0.bp.\"\n", |
| 62 | + " error = \"Failed to find input file \" + str(path)\n", |
66 | 63 | " assert False, error"
|
67 | 64 | ]
|
68 | 65 | },
|
|
73 | 70 | "metadata": {},
|
74 | 71 | "outputs": [],
|
75 | 72 | "source": [
|
76 |
| - "frame = 0 \n", |
| 73 | + "frame = 0\n", |
77 | 74 | "model = getModelType()\n",
|
78 |
| - "filename = run / f\"{data_base_path}/rt-{model}-gem_field_{frame}.bp\"\n", |
| 75 | + "filename = run / f\"{data_base_path}/rt_{model}_gem_gzero-field_{frame}.gkyl\"\n", |
79 | 76 | "filename = str(filename)\n",
|
80 | 77 | "print(filename)"
|
81 | 78 | ]
|
|
89 | 86 | "source": [
|
90 | 87 | "gdata = pg.GData(filename)\n",
|
91 | 88 | "\n",
|
92 |
| - "vals = gdata.getValues() # cell-center values, shape is Ny * Nx * Ncomponents\n", |
93 |
| - "grid = gdata.getGrid() # cell corner coordinates\n", |
94 |
| - "ndim = gdata.getNumDims() # number of spatial dimensions\n", |
| 89 | + "vals = gdata.get_values() # cell-center values, shape is Ny * Nx * Ncomponents\n", |
| 90 | + "grid = gdata.get_grid() # cell corner coordinates\n", |
| 91 | + "ndim = gdata.get_num_dims() # number of spatial dimensions\n", |
95 | 92 | "\n",
|
96 | 93 | "assert len(vals.shape) == ndim+1 and len(grid) == ndim\n",
|
97 | 94 | "\n",
|
98 |
| - "icomp = 3 \n", |
| 95 | + "icomp = 3\n", |
99 | 96 | "compName = r'$E_z^2$'\n",
|
100 | 97 | "fileName = \"E_z.png\"\n",
|
101 | 98 | "\n",
|
|
110 | 107 | "ax.set_xlabel('x')\n",
|
111 | 108 | "ax.set_ylabel('y')\n",
|
112 | 109 | "ax.set_title(compName)\n",
|
113 |
| - "ax.set_aspect(1)" |
| 110 | + "ax.set_aspect(1)\n", |
| 111 | + "\n", |
| 112 | + "plt.savefig(fileName)" |
114 | 113 | ]
|
115 | 114 | },
|
116 | 115 | {
|
|
131 | 130 | "%stop_runtime test_cpu\n",
|
132 | 131 | "%switch_runtime local"
|
133 | 132 | ]
|
| 133 | + }, |
| 134 | + { |
| 135 | + "cell_type": "code", |
| 136 | + "execution_count": null, |
| 137 | + "id": "5d87f6d9-2547-473d-987a-af5306d6f00b", |
| 138 | + "metadata": {}, |
| 139 | + "outputs": [], |
| 140 | + "source": [] |
134 | 141 | }
|
135 | 142 | ],
|
136 | 143 | "metadata": {
|
|
0 commit comments