X-Git-Url: http://git.treefish.org/~alex/seamulator.git/blobdiff_plain/e19dd20d04a2a92b3d91bd25a69210a2351b08c9..6614482a641f4aaf5ccf53641429134b7c8298c1:/sea.h diff --git a/sea.h b/sea.h index 6e24ac3..798b92d 100644 --- a/sea.h +++ b/sea.h @@ -1,17 +1,22 @@ #pragma once +#include #include #include +#include + #include "seafwd.h" -#include "complexpair.h" #include "watersurfacefwd.h" class Sea { public: Sea(WaterSurfacePtr surface); + ~Sea(); + Sea(const Sea&) = delete; + Sea& operator=(const Sea&) = delete; void update(); private: @@ -24,11 +29,14 @@ class Sea std::random_device m_randomDevice; std::mt19937 m_randomGenerator; std::normal_distribution<> m_normalDistribution; - std::vector m_fourierAmplitudes; + std::vector> m_fourierAmplitudes; + fftw_complex *m_fftwIn, *m_fftwOut; + fftw_plan m_fftwPlan; + std::chrono::time_point m_startTime; double phillipsSpectrum(double k_x, double k_y) const; - ComplexPair generateFourierAmplitude(double k_x, double k_y); - ComplexPair& fourierAmplitudeAt(int n, int m); + std::complex& fourierAmplitudeAt(int n, int m); void generateFourierAmplitudes(); double spatialFrequencyForIndex(int n) const; + double getRuntime() const; };