Off fault receivers#

Introduction#

Receivers can be configured using the namelist output. Here is a commented example:

&Output
receiverFormat = 'csv' ! Can be 'hdf5' or 'csv'
pickdt = 0.01 ! Pickpoint Sampling
pickDtType = 1 ! Pickpoint Type
RFileName = 'receivers.dat' ! Record Points in extra file
/

A run writes the receivers given in RFileName; ReceiverOutput = 0 switches them off, and without RFileName, a run writes none.

If receiverFormat = 'csv' (the default), each receiver trace is written to a separate .dat file. If receiverFormat = 'hdf5', all of them go into a single file, -receivers.h5; see The HDF5 receiver file below for what it holds.

If pickDtType = 2, the output is generated every N time steps, where N is set by pickdt. If pickDtType = 1, output is generated every pickdt second.

receivers.dat is an ASCII file describing the coordinates of the receivers in the form:

x1 y1 z1
x2 y2 z2
(...)
xn yn zn

The receivers files contain the time-histories of the stress tensor (6 variables) and the particle velocities (3). Currently, there is no way to write only a subset of these variables.

With several simulations (fused ones, or more with SimCount), a sample of a text file takes a row per simulation, and the second column, SimulationIndex, says which one, counted from zero:

VARIABLES = "Time","SimulationIndex","s_xx","s_yy","s_zz","s_xy","s_yz","s_xz","v1","v2","v3"

SeisSol used to write a column per quantity and simulation instead (v10, v11, …); postprocessing/science/widen_fused_receivers.py converts the files to that layout for tools that expect it.

The variable ReceiverOutputInterval (in the section Output of the Parameter file) controls the frequency of flushing receiver time-histories. If not specified, they are written at the end of the simulation.

The HDF5 receiver file#

Everything sits under an HDF5 group named receivers.

What a receiver records follows from the material of the element it sits in, so not all of them record the same quantities. The receivers are therefore gathered into groups that share a quantity set, and each group becomes a dataset group0, group1, … of its own. A run in which every receiver records the same quantities – the usual case – has exactly one of them.

A dataset is indexed by sample and by row, and a row is one receiver of one simulation, so a run of several simulations has a row per receiver and simulation:

/receivers/group0        (samples, rows)   compound

One element is a whole sample of one row, as a compound whose members are the quantities: Time first, then the material quantities, then the derived ones if ReceiverComputeRotation or ReceiverComputeStrainRate are on. That is the same memory as a (sample, row, quantity) array of numbers, with the quantity axis named rather than numbered, so the names and the types come out of the file itself. All the samples of one row lie together, which is the access a post-processing step usually wants. A receiver that took fewer samples than the longest one of its dataset leaves the rest of its column at a quiet NaN.

Two attributes describe a dataset:

Quantities

the quantity set it holds, in the form the grouping reads back

NumberOfPoints

how many rows it holds over all ranks, i.e. receivers times simulations

Beside the datasets, and written once, are the columns describing the rows, in the order the ranks contributed them:

/receivers/Index           (rows, 2)    group and row within that group
/receivers/PointId         (rows,)      the receiver's line in the receiver file
/receivers/SimulationIndex (rows,)      which simulation the row holds
/receivers/Coordinates     (rows, 3)    where it sits

The rows are renumbered so that every rank owns one run of each group; Index is what leads from a line of the receiver file back to the row of the dataset that holds it.

With numpy and h5py, reading the trace of the receiver on line n of the receiver file, counted from zero, in simulation s (zero with a single simulation) is therefore:

import h5py

with h5py.File("output-receivers.h5") as f:
    receivers = f["receivers"]
    index = receivers["Index"][:]
    row = ((receivers["PointId"][:] == n) & (receivers["SimulationIndex"][:] == s)).nonzero()[0][0]
    group, column = index[row]
    trace = receivers[f"group{group}"][:, column]
    time = trace["Time"]
    v1 = trace["v1"]

Storage chunking#

How far a storage chunk reaches along the sample axis can be set with receiversamplechunk in the Output section; zero, the default, lets the writer take one write as one chunk. The chunking is settled when the file is created while the number of samples a write carries varies as soon as pickdt does not divide ReceiverOutputInterval, so a run that is read back sample-wise rather than receiver-wise may want it given.

Rotational Output#

You can additionally choose to write the rotation of the velocity field by setting ReceiverComputeRotation=1 in the parameter file. The rotation of the vector field is defined as \(\text{rot} v = \begin{pmatrix} \partial_2 v_3 - \partial_3 v_2 \\ \partial_3 v_1 - \partial_1 v_3 \\ \partial_1 v_2 - \partial_2 v_1 \\ \end{pmatrix}\). The velocity is the particle velocity of the material: that of the solid for poroelastic materials, and that of the fluid for (visco)acoustic ones.

Strain Rate Output#

Furthermore, you can also output the strain rate by setting ReceiverComputeStrainRate=1. It is the symmetric part of the gradient of the same velocity, \(\dot\varepsilon_{ij} = \frac{1}{2}(\partial_j v_i + \partial_i v_j)\), written as epsxx, epsxy, epsxz, epsyy, epsyz, epszz; with fused simulations, they are in the row of their simulation, as the other quantities are.

Placing free-surface receivers#

Placing receivers on the free-surface requires special care when a realistic topography is used. The procedure to move receivers exactly to the surface is described here.

Compiling place_receivers on SuperMUC#

Load the relevant modules.

git submodule update --init
mkdir build && cd build
cmake ..
make -j