This code can be used to compute dispersion curves:
Code: Select all
#include "qtblayeredmodel.h"
#include "qtbrayleigh.h"
#include "qtbdispersion.h"
...
QtbLayeredModel m
// Set parameters of the layered model: Vp, Vs and Rho
...
// Sampling in angular frequency (2 pi frequency)
// x items control the sample of the dispersion curve
QVector<double> x;
// Creates a Rayleigh proxy for computing Rayleigh
// dispersion curves (another exists for Love).
// This object can compute the propagator matrix for
// Rayleigh wave across the medium for any couple
// (frequency,slowness).
QtbRayleigh modelRayleigh( m );
// Creates an object in charge of following dispersion modes
QtbDispersion dispersion (nRayleigh, &x);
// Effectively computes the dispersion curve using the Rayleigh
// proxy. The '0' is to switch off the ellipticity computation.
dispersion.calculate( modelRayleigh, 0 );