#ifndef __JACOUSTICS__JABSTRACTSOUNDVELOCITY__ #define __JACOUSTICS__JABSTRACTSOUNDVELOCITY__ /** * \file * * Abstract sound velocity. * \author mdejong */ namespace JACOUSTICS {} namespace JPP { using namespace JACOUSTICS; } namespace JACOUSTICS { /** * Interface for depth dependend velocity of sound. * * Note that the z-axis is pointing upwards. */ struct JAbstractSoundVelocity { /** * Virtual destructor. */ virtual ~JAbstractSoundVelocity() {} /** * Get velocity of sound. * * \return velocity [m/s] */ virtual double operator()() const = 0; /** * Get velocity of sound at given depth relative to seabed. * * \param z depdth [m] * \return velocity [m/s] */ virtual double operator()(const double z) const { return (*this)(); } /** * Get distance travelled by sound. * * \param t_s time [s] * \param z1 depth [m] * \param z2 depth [m] * \return distance [m] */ virtual double getDistance(const double t_s, const double z1, const double z2) const = 0; /** * Get propagation time of sound. * * \param D_m distance [m] * \param z1 depth [m] * \param z2 depth [m] * \return time [s] */ virtual double getTime(const double D_m, const double z1, const double z2) const = 0; /** * Get inverse velocity of sound. * * \param D_m distance [m] * \param z1 depth [m] * \param z2 depth [m] * \return inverse velocity [s/m] */ virtual double getInverseVelocity(const double D_m, const double z1, const double z2) const = 0; }; } #endif