Skip to content

Commit 67d3d4b

Browse files
committed
DOCS: Demonstrate use of pylith_eqinfo in examples/strikeslip-2d and examples/crustal-strikeslip-*.
1 parent 209f9d1 commit 67d3d4b

File tree

3 files changed

+149
-0
lines changed

3 files changed

+149
-0
lines changed

docs/user/examples/crustal-strikeslip-2d/step01-slip.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,61 @@ At the end of the output written to the terminal, we see that the solver advance
142142
The linear solve converged after 19 iterations and the norm of the residual met the absolute convergence tolerance (`ksp_atol`) .
143143
The nonlinear solve converged in 1 iteration, which we expect because this is a linear problem, and the residual met the absolute convergence tolerance (`snes_atol`).
144144

145+
### Earthquake rupture parameters
146+
147+
We use the `pylith_eqinfo` utility to compute rupture information, such as earthquake magnitude, seismic moment, seismic potency, and average slip.
148+
For 2D simulations, the average slip provides the most useful information.
149+
[`pylith_eqinfo`](../../run-pylith/utilities.md) is a Pyre application and you specify parameters using `cfg` files and the command line.
150+
It writes results to a Python script for use in post-processing of simulation results.
151+
152+
The file `eqinfoapp.cfg` holds the parameters for `pylith_eqinfo` in this example.
153+
By default, `pylith_eqinfo` extracts information for the final time step in the output file.
154+
In order to compute the seismic moment and moment magnitude, we need the shear modulus, which in this case is uniform over the domain.
155+
Consquently, we specify the density and shear wave speed using a `UniformDB` in `eqinfoapp.cfg`.
156+
157+
```{code-block} console
158+
---
159+
caption: Run `pylith_eqinfo` for the Step 1 simulation.
160+
---
161+
$ pylith_eqinfo
162+
```
163+
164+
```{code-block} python
165+
---
166+
caption: Contents of `output/step01_slip-eqinfo.py` generated by `pylith_eqinfo`. The `all` object includes earthquake rupture information combined from the three the individual faults. The average slip matches the uniform slip prescribed on each fault.
167+
---
168+
class RuptureStats(object):
169+
pass
170+
all = RuptureStats()
171+
all.timestamp = [ 3.155760e+07]
172+
all.ruparea = [ 5.387992e+04]
173+
all.potency = [ 1.733080e+05]
174+
all.moment = [ 3.899430e+15]
175+
all.avgslip = [ 3.216560e+00]
176+
all.mommag = [ 4.360667e+00]
177+
main_fault = RuptureStats()
178+
main_fault.timestamp = [ 3.155760e+07]
179+
main_fault.ruparea = [ 3.577375e+04]
180+
main_fault.potency = [ 1.430950e+05]
181+
main_fault.moment = [ 3.219637e+15]
182+
main_fault.avgslip = [ 4.000000e+00]
183+
main_fault.mommag = [ 4.305205e+00]
184+
east_branch = RuptureStats()
185+
east_branch.timestamp = [ 3.155760e+07]
186+
east_branch.ruparea = [ 5.999357e+03]
187+
east_branch.potency = [ 5.999357e+03]
188+
east_branch.moment = [ 1.349855e+14]
189+
east_branch.avgslip = [ 1.000000e+00]
190+
east_branch.mommag = [ 3.386858e+00]
191+
west_branch = RuptureStats()
192+
west_branch.timestamp = [ 3.155760e+07]
193+
west_branch.ruparea = [ 1.210682e+04]
194+
west_branch.potency = [ 2.421364e+04]
195+
west_branch.moment = [ 5.448068e+14]
196+
west_branch.avgslip = [ 2.000000e+00]
197+
west_branch.mommag = [ 3.790828e+00]
198+
```
199+
145200
## Visualizing the results
146201

147202
The `output` directory contains the simulation output.

docs/user/examples/crustal-strikeslip-3d/step01-slip.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,58 @@ At the end of the output written to the terminal, we see that the solver advance
111111
The linear solve converged after 88 iterations and the norm of the residual met the absolute convergence tolerance (`ksp_atol`) .
112112
The nonlinear solve converged in 1 iteration, which we expect because this is a linear problem, and the residual met the absolute convergence tolerance (`snes_atol`).
113113

114+
### Earthquake rupture parameters
115+
116+
We use the `pylith_eqinfo` utility to compute rupture information, such as earthquake magnitude, seismic moment, seismic potency, and average slip.
117+
The file `eqinfoapp.cfg` holds the parameters for `pylith_eqinfo` in this example.
118+
By default, `pylith_eqinfo` extracts information for the final time step in the output file.
119+
In order to compute the seismic moment and moment magnitude, we need the shear modulus, which in this case is uniform over the domain.
120+
Consquently, we specify the density and shear wave speed using a `UniformDB` in `eqinfoapp.cfg`.
121+
The average slip, rupture area, seismic moment, and seismic potency are all given in SI units.
122+
123+
```{code-block} console
124+
---
125+
caption: Run `pylith_eqinfo` for the Step 1 simulation.
126+
---
127+
$ pylith_eqinfo
128+
```
129+
130+
```{code-block} python
131+
---
132+
caption: Contents of `output/step01_slip-eqinfo.py` generated by `pylith_eqinfo`. The `all` object includes earthquake rupture information combined from the three the individual faults. The average slip matches the uniform slip prescribed on each fault.
133+
---
134+
class RuptureStats(object):
135+
pass
136+
all = RuptureStats()
137+
all.timestamp = [ 3.155760e+07]
138+
all.ruparea = [ 8.140700e+08]
139+
all.potency = [ 2.623065e+09]
140+
all.moment = [ 5.901897e+19]
141+
all.avgslip = [ 3.222162e+00]
142+
all.mommag = [ 7.147328e+00]
143+
main_fault = RuptureStats()
144+
main_fault.timestamp = [ 3.155760e+07]
145+
main_fault.ruparea = [ 5.424291e+08]
146+
main_fault.potency = [ 2.169716e+09]
147+
main_fault.moment = [ 4.881862e+19]
148+
main_fault.avgslip = [ 4.000000e+00]
149+
main_fault.mommag = [ 7.092390e+00]
150+
east_branch = RuptureStats()
151+
east_branch.timestamp = [ 3.155760e+07]
152+
east_branch.ruparea = [ 8.993288e+07]
153+
east_branch.potency = [ 8.993288e+07]
154+
east_branch.moment = [ 2.023490e+18]
155+
east_branch.avgslip = [ 1.000000e+00]
156+
east_branch.mommag = [ 6.170734e+00]
157+
west_branch = RuptureStats()
158+
west_branch.timestamp = [ 3.155760e+07]
159+
west_branch.ruparea = [ 1.817081e+08]
160+
west_branch.potency = [ 3.634162e+08]
161+
west_branch.moment = [ 8.176864e+18]
162+
west_branch.avgslip = [ 2.000000e+00]
163+
west_branch.mommag = [ 6.575058e+00]
164+
```
165+
114166
## Visualizing the results
115167

116168
The `output` directory contains the simulation output.

docs/user/examples/strikeslip-2d/step04-varslip.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,48 @@ At the end of the output written to the terminal, we see that the solver advance
151151
The linear solve converged after 27 iterations and the norm of the residual met the absolute convergence tolerance (`ksp_atol`).
152152
The nonlinear solve converged in 1 iteration, which we expect because this is a linear problem, and the residual met the absolute convergence tolerance (`snes_atol`).
153153

154+
## Earthquake rupture parameters
155+
156+
We use the `pylith_eqinfo` utility to compute rupture information, such as earthquake magnitude, seismic moment, seismic potency, and average slip.
157+
For 2D simulations, the average slip provides the most useful information.
158+
[`pylith_eqinfo`](../../run-pylith/utilities.md) is a Pyre application and you specify parameters using `cfg` files and the command line.
159+
It writes results to a Python script for use in post-processing of simulation results.
160+
161+
The file `eqinfoapp.cfg` holds the parameters for `pylith_eqinfo` in this example.
162+
By default, `pylith_eqinfo` extracts information for the final time step in the output file.
163+
In order to compute the seismic moment and moment magnitude, we need the shear modulus for the fault.
164+
We account for the contrast in rigidity across the fault by using the effective shear modulus from {cite:t}`Wu:Chen:2003` and set the shear wave speed to 3.46 km/s.
165+
166+
167+
```{code-block} console
168+
---
169+
caption: Run `pylith_eqinfo` for the Step 4 simulation.
170+
---
171+
$ pylith_eqinfo
172+
```
173+
174+
```{code-block} python
175+
---
176+
caption: Contents of `output/step04_varslip-eqinfo.py` generated by `pylith_eqinfo`. The `all` object includes earthquake rupture information combined from all of the individual faults.
177+
---
178+
class RuptureStats(object):
179+
pass
180+
all = RuptureStats()
181+
all.timestamp = [ 3.155760e+07]
182+
all.ruparea = [ 6.300870e+04]
183+
all.potency = [ 1.306180e+04]
184+
all.moment = [ 3.909267e+14]
185+
all.avgslip = [ 2.073016e-01]
186+
all.mommag = [ 3.694730e+00]
187+
fault = RuptureStats()
188+
fault.timestamp = [ 3.155760e+07]
189+
fault.ruparea = [ 6.300870e+04]
190+
fault.potency = [ 1.306180e+04]
191+
fault.moment = [ 3.909267e+14]
192+
fault.avgslip = [ 2.073016e-01]
193+
fault.mommag = [ 3.694730e+00]
194+
```
195+
154196
## Visualizing the results
155197

156198
In {numref}`fig:example:strikeslip:2d:step04:solution` we use the `pylith_viz` utility to visualize the y displacement field.

0 commit comments

Comments
 (0)