summaryrefslogtreecommitdiff
path: root/src/ocean/ocean.h
blob: 0d2d2c07b8c911f8aca3b377e6c7d923c6c728e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
//
// Created by Michael Foiani on 4/9/24.
//

#ifndef OCEAN_H
#define OCEAN_H

#include <vector>
#include <utility>
#include <Eigen/Dense>


class ocean
{
public:
	ocean();
    void updateVertexAmplitudes(double t);
    std::vector<Eigen::Vector3f> get_vertices();
    std::vector<Eigen::Vector3i> get_faces();
    int getLength() {
        return this->length;
    }
    int getWidth() {
        return this->width;
    }



private:

    const int length = 81; // length of grid
    const int width = 81; // width of grid
	const int N = length * width; // total number of grid points

    const double A = 50.0; // numeric constant for the Phillips spectrum
	const double V = .25; // wind speed
	const std::pair<double, double> omega_wind
		= std::make_pair(1.0, 0.0); // wind direction

	std::vector<std::pair<double, double>> initial_h; // initial height fields for each K
    std::vector<std::pair<double, double>> current_h; // current height fields for each K


	const double D = 1; // Depth below mean water level (for dispersion relation)


	std::pair<double, double> k_index_to_k_vector
	(
		int k_index
	);
	std::pair<double, double> sample_complex_gaussian
		();
	double phillips_spectrum
	(
		int k_index
	);
	std::pair<double, double> amplitude_0
	(
		int k_index
	);
	int k_index_to_negative_k_index
	(
		int k_index
	);
	double omega_dispersion
	(
		double k_magnitude,
		bool is_shallow=false
	);
	std::pair<double, double> exp_complex
	(
		std::pair<double, double> z
	);
	std::pair<double, double> amplitude_t
	(
		double t,
		int k_index
	);
};


#endif //OCEAN_H