Initial Conditions#

Currently we provide the following initial conditions:

Initial Conditions via Easi#

You can input your initial conditions via an easi file. For that, set

&IniCondition
cICType = 'easi'
filename = '$INIFILE'
hastime = 1

Then, input the initial condition into the easi file $INIFILE. For the variable names, use the same as used in the output. For example, for elastic (and viscoelastic etc.), a (rather nonsensical) constant initial condition looks as follows:

!ConstantMap
map:
  s_xx: 1
  s_yy: 4
  s_zz: 9
  s_xy: 16
  s_xz: 25
  s_yz: 36
  v1: 49
  v2: 64
  v3: 81

Of course, one may use Lua functions or ASAGI as input as well for several variables. The parameter hastime indicates that the easi file has t as a time input variable besides the spatial coordinates (x,y,z). This way, the easi boundary condition can be used for comparing against after time has passed (e.g. for convergence tests). However, it requires easi 1.5.0 or higher to function correctly.

As a caveat, the Easi initial condition does not support the analytical boundary condition; SeisSol stops during the initialization if the mesh has analytical faces.

Hard-Coded Initial Conditions#

Since the old days, some initial conditions were hard coded into SeisSol. To select these, it suffices to set

&IniCondition
cICType = '$NAME'

where $NAME is the name of one of the following inital conditions.

Zero (Zero)#

All quantities are set to zero. This is the standard case to work with point sources or dynamic rupture.

Planar wave (Planarwave)#

A planar wave for convergence tests. The inital values are computed such that a planar wave in a unit cube is imposed. Its wave vector \(k\) is \((\pi, \pi, \pi)\), unless kVec in the IniCondition section sets another one, as described for the travelling wave below. Along every axis with \(k_i \neq 0\), the mesh has to span a whole number of wavelengths \(2\pi / |k_i|\). For elastic, anisotropic and viscoelastic materials, we impose a P and an S wave travelling in opposite directions. For poroelastic materials, we impose a slow P and an S wave travelling in one direction and a fast P wave travelling in opposite direction. For acoustic and viscoacoustic materials, we impose a P wave. This scenario needs periodic boundary conditions to make sense. After the simulation is finished the errors between the analytic solution and the numerical one are plotted in the \(L^1\)-, \(L^2\)- and \(L^\infty\)-norm.

SeisSol does not generate such meshes itself (the cubegenerator mesh format is currently disabled). Generate a periodic mesh in the PUML format instead; Mesh Input Formats describes how to give the periodic connectivity.

Superimposed planar wave (SuperimposedPlanarwave)#

Superimposed three planar waves travelling in different directions. This is especially interesting in the case of directional dependent properties such as for anisotropic materials.

Travelling wave (Travelling)#

Impose one period of a sinusoidal planar wave as initial condition, see for example the video below. There, we impose a P wave travelling to the left. The wave speed at the top and bottom is \(2 m/s\) and \(2.83 m/s\) in the middle.

Travelling wave GIF

Fig. 2 Travelling wave example, wave speed is higher in the middle than at the top and bottom.#

The Travelling wave can be configured in the parameter file (in the IniCondition section):

  • origin = 0 0 0 describes a point on the (initially) planar wave.

  • kVec = 6.283 0 0 is the wave vector. The wavelength can be computed as \(\lambda = 2\pi / \|k\|\). In this case it travels in the direction of the x-axis, the wave length is \(1 m\).

  • ampField = 2 0 0 0 0 0 0 1 0 describes the amplitudes of the different wave modes. We can impose a P wave and two S waves with different polarizations travelling either in the same direction (+) or in the opposite direction (-) of \(k\). Note: there are three non propagating modes (N). The entries of \(k\) are -P -S -S N N N +S +S +P. In this example, we impose a P wave travelling in the opposite direction as \(k\) with relative amplitude \(2\) and an S wave travelling towards the same direction as \(k\) with relative amplitude \(1\).

The travelling wave is not available for viscoelastic and viscoacoustic materials.

Acoustic travelling wave with ITM (AcousticTravellingwithITM)#

An acoustic plane wave travelling in x-direction, with the wave number k given in the IniCondition section. With ITMEnable = 1, it switches at the times of the instantaneous time mirror (ITM) configured by the ITM* parameters in the equations section, keeping the pressure continuous and scaling the velocity by ITMVelocityScalingFactor, independent of ITMReflectionType; this has not been validated against the ITM that SeisSol computes, which changes the material instead. With ITMEnable = 0, the ITM parameters are ignored and the wave is a plain travelling wave. It needs a fluid: the elastic equations with \(\mu = 0\), or the acoustic equations. The acoustic equations do not support the mirror itself (SeisSol rejects ITMEnable = 1 there), so use ITMEnable = 0 with them.

Scholte (Scholte)#

A Scholte wave to test elastic-acoustic coupling. It needs a solid next to a fluid, i.e. the elastic equations with an acoustic (\(\mu = 0\)) region; other equations reject it.

Snell (Snell)#

Snells law to test elastic-acoustic coupling. It needs a solid next to a fluid, i.e. the elastic equations with an acoustic (\(\mu = 0\)) region; other equations reject it.

Ocean (Ocean_0, Ocean_1, Ocean_2)#

An uncoupled ocean test case for acoustic equations, in one of three modes; Ocean_0 is the gravity mode. It needs a fluid: the elastic equations with \(\mu = 0\), or the acoustic equations.

Pressure injection (PressureInjection)#

A Gaussian perturbation of the fluid pressure, \(p = m \exp(-w \|x - x_0\|^2)\), for poroelastic materials only. It is configured by origin (\(x_0\)), magnitude (\(m\)) and width (\(w\)) in the IniCondition section.

How to implement a new hard-coded initial condition?#

Alternatively, you can implement a new initial condition in the code itself.

For that, derive a class from

seissol::physics::InitialFieldOf<YourField>

and implement the method

template <typename RealT>
void evaluateIn(double time,
                const std::array<double, 3>* points,
                std::size_t count,
                const CellMaterialData& materialData,
                yateto::DenseTensorView<2, RealT, unsigned>& dofsQP) const;

Here dofsQP(i,j) is the value of the \(j^\text{th}\) quantity at the points[i]. The quantities are those of the configuration the cells compute in; e.g. the velocity starts at the velocityOffset of its configLayout.

Furthermore, you will also need to add the new initial condition to the parameter file parser in src/Initializer/Parameters/InitializationParameters.cpp, and register it in src/Physics/Scenario/Registry.cpp, with the materials it is meaningful for; SeisSol rejects it for all others.