Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions quakeworx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@
The files in this directory have been adjusted compared to the "standard" SeisSol training repository to be readily used for a science gateway for seismic simulations: [Quakeworx Kick-off: Advancing Earthquake Science and Cybertraining in Seismology](https://quakeworx.org/events/quakeworx-kick-off-workshop)

The simplest way to access the input files for the Gateway is by running ``git clone https://github.com/SeisSol/Training.git`` from your terminal locally. Make sure to navigate into the folder _quakeworx_ when uploading the input files to the SeisSol App from the Gateway.

For more information about the Quakeworx science gateway, please see [Quakeworx overview](https://qwx1.2.onescienceway.com/overview).
22 changes: 13 additions & 9 deletions quakeworx/earthquake-tsunami/ttpv_qwx.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"source": [
"## Mesh\n",
"\n",
"SeisSol uses unstructured tetrahedral meshes to incorporate complex 3D bathymetry and topography and the complex fault geometries. We provide two down-scaled meshes for this training. A very small 18k mesh for TTPV1 with limited horizontal extent, and a 225k mesh for TTPV2. We recommend to **start with TTPV1**."
"SeisSol uses unstructured tetrahedral meshes to incorporate complex 3D bathymetry and topography and the complex fault geometries. We provide two down-scaled meshes for this training. A very small **18k element mesh for TTPV1** with limited horizontal extent, and a **225k element mesh for TTPV2**. We recommend to **start with TTPV1**."
]
},
{
Expand Down Expand Up @@ -182,7 +182,7 @@
"metadata": {},
"outputs": [],
"source": [
"# Asssuming you job name was \"SeisSol_TTPV1\"\n",
"# Asssuming your job name was \"SeisSol_TTPV1\"\n",
"job_name = \"SeisSol_TTPV1\""
]
},
Expand Down Expand Up @@ -226,15 +226,15 @@
"metadata": {},
"outputs": [],
"source": [
"def plot_fault(xdmfFilename, ndt=None, var=\"ASl\", vmin=None, vmax=None, cmap=\"magma_r\"):\n",
"def plot_fault(xdmfFilename, timestep=None, var=\"ASl\", vmin=None, vmax=None, cmap=\"magma_r\"):\n",
" \"\"\"\n",
" Visualize a SeisSol fault field (e.g., ASl, SRd, Vr, etc.) on the fault mesh.\n",
"\n",
" Parameters\n",
" ----------\n",
" xdmfFilename : str\n",
" Path to the fault output .xdmf file.\n",
" ndt : int or None, optional\n",
" timestep : int or None, optional\n",
" Output timestep. If None, selects last timestep automatically.\n",
" var : str, optional\n",
" Fault field to visualize (default: \"ASl\").\n",
Expand All @@ -246,12 +246,12 @@
"\n",
" # --- Load SeisSol fault output ---\n",
" sx = seisx.seissolxdmf(xdmfFilename)\n",
" if ndt is None:\n",
" ndt = sx.ReadNdt() - 1 # last timestep\n",
" if timestep is None:\n",
" timestep = sx.ReadNdt() - 1 # last timestep\n",
"\n",
" xyz = sx.ReadGeometry()\n",
" connect = sx.ReadConnect()\n",
" field = sx.ReadData(var, ndt)\n",
" field = sx.ReadData(var, timestep)\n",
"\n",
" # --- Colormap limits ---\n",
" if vmin is None:\n",
Expand Down Expand Up @@ -370,7 +370,7 @@
"metadata": {},
"outputs": [],
"source": [
"def plot_surface(xdmfFilename, timestep, var=\"u3\", select_flag=3, vmin=None,vmax=None):\n",
"def plot_surface(xdmfFilename, timestep=None, var=\"u3\", select_flag=3, vmin=None,vmax=None, cmap=\"seismic\"):\n",
" \"\"\"\n",
" Plot a SeisSol surface variable filtered by locationFlag.\n",
"\n",
Expand All @@ -390,10 +390,14 @@
" 3 = free surface with gravity (default)\n",
" vmin, vmax : float, optional\n",
" Color limits. If None, use data min/max.\n",
" cmap : str\n",
" Matplotlib colormap name (e.g., \"magma_r\", \"viridis\", \"Oranges\").\n",
" \"\"\"\n",
"\n",
" # --- Read mesh and data ---\n",
" sx = seisx.seissolxdmf(xdmfFilename)\n",
" if timestep is None:\n",
" timestep = sx.ReadNdt() - 1 # last timestep\n",
"\n",
" xyz = sx.ReadGeometry() # (nNodes, 3)\n",
" connect = sx.ReadConnect() # (nTriangles, 3)\n",
Expand Down Expand Up @@ -421,7 +425,7 @@
" # --- Plotting ---\n",
" fig, ax = plt.subplots(figsize=(8, 7))\n",
"\n",
" tpc = ax.tripcolor(x, y, connect_f, facecolors=U_f, cmap=\"seismic\", rasterized=True, vmin=vmin, vmax=vmax)\n",
" tpc = ax.tripcolor(x, y, connect_f, facecolors=U_f, cmap=cmap, rasterized=True, vmin=vmin, vmax=vmax)\n",
"\n",
" ax.set_xlabel(\"x [m]\")\n",
" ax.set_ylabel(\"y [m]\")\n",
Expand Down
Loading
Loading