2 * Copyright (C) 2016 Alexander Schmidt
4 * This file is part of Seamulator.
6 * Seamulator is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * Seamulator is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with Seamulator. If not, see <http://www.gnu.org/licenses/>.
30 #include "watersurfacefwd.h"
35 Sea(WaterSurfacePtr surface, double windSpeed, double magicConstant);
37 Sea(const Sea&) = delete;
38 Sea& operator=(const Sea&) = delete;
42 static const double GRAVITATIONAL_CONSTANT;
44 WaterSurfacePtr m_surface;
45 double m_windDirection[2];
47 double m_magicConstant;
48 std::random_device m_randomDevice;
49 std::mt19937 m_randomGenerator;
50 std::normal_distribution<> m_normalDistribution;
51 std::vector<std::complex<double>> m_fourierAmplitudes;
52 fftw_complex *m_fftwIn, *m_fftwOut;
54 std::chrono::time_point<std::chrono::system_clock> m_startTime;
56 double phillipsSpectrum(double k_x, double k_y) const;
57 std::complex<double>& fourierAmplitudeAt(int n, int m);
58 void generateFourierAmplitudes();
59 double spatialFrequencyForIndex(int n) const;
60 double getRuntime() const;