Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ocean_intern.h « intern « blenkernel « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9fc9e6fe00d914b55af745b1f3338fdab291d968 (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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/* SPDX-License-Identifier: GPL-2.0-or-later */

#pragma once

/** \file
 * \ingroup bke
 */

#ifdef __cplusplus
extern "C" {
#endif

#ifdef WITH_OCEANSIM
#  include "BLI_threads.h"
#  include "fftw3.h"
#  define GRAVITY 9.81f

typedef struct Ocean {
  /* ********* input parameters to the sim ********* */
  float _V;
  float _l;
  float _w;
  float _A;
  float _damp_reflections;
  float _wind_alignment;
  float _depth;

  float _wx;
  float _wz;

  float _L;

  /* dimensions of computational grid */
  int _M;
  int _N;

  /* spatial size of computational grid */
  float _Lx;
  float _Lz;

  float normalize_factor; /* init w */
  float time;

  short _do_disp_y;
  short _do_normals;
  short _do_spray;
  short _do_chop;
  short _do_jacobian;

  /* Which spectral model we are using. */
  int _spectrum;

  /* JONSWAP common parameters. */
  float _fetch_jonswap;
  float _sharpen_peak_jonswap;

  /* mutex for threaded texture access */
  ThreadRWMutex oceanmutex;

  /* ********* sim data arrays ********* */

  /* two dimensional arrays of complex */
  fftw_complex *_fft_in;     /* init w   sim w */
  fftw_complex *_fft_in_x;   /* init w   sim w */
  fftw_complex *_fft_in_z;   /* init w   sim w */
  fftw_complex *_fft_in_jxx; /* init w   sim w */
  fftw_complex *_fft_in_jzz; /* init w   sim w */
  fftw_complex *_fft_in_jxz; /* init w   sim w */
  fftw_complex *_fft_in_nx;  /* init w   sim w */
  fftw_complex *_fft_in_nz;  /* init w   sim w */
  fftw_complex *_htilda;     /* init w   sim w (only once) */

  /* fftw "plans" */
  fftw_plan _disp_y_plan; /* init w   sim r */
  fftw_plan _disp_x_plan; /* init w   sim r */
  fftw_plan _disp_z_plan; /* init w   sim r */
  fftw_plan _N_x_plan;    /* init w   sim r */
  fftw_plan _N_z_plan;    /* init w   sim r */
  fftw_plan _Jxx_plan;    /* init w   sim r */
  fftw_plan _Jxz_plan;    /* init w   sim r */
  fftw_plan _Jzz_plan;    /* init w   sim r */

  /* two dimensional arrays of float */
  double *_disp_y; /* init w   sim w via plan? */
  double *_N_x;    /* init w   sim w via plan? */
  /* all member of this array has same values,
   * so convert this array to a float to reduce memory usage (MEM01). */
  // float * _N_y;
  double _N_y;     /*          sim w ********* can be rearranged? */
  double *_N_z;    /* init w   sim w via plan? */
  double *_disp_x; /* init w   sim w via plan? */
  double *_disp_z; /* init w   sim w via plan? */

  /* two dimensional arrays of float */
  /* Jacobian and minimum eigenvalue */
  double *_Jxx; /* init w   sim w */
  double *_Jzz; /* init w   sim w */
  double *_Jxz; /* init w   sim w */

  /* one dimensional float array */
  float *_kx; /* init w   sim r */
  float *_kz; /* init w   sim r */

  /* two dimensional complex array */
  fftw_complex *_h0;       /* init w   sim r */
  fftw_complex *_h0_minus; /* init w   sim r */

  /* two dimensional float array */
  float *_k; /* init w   sim r */
} Ocean;
#else
/* stub */
typedef struct Ocean {
  /* need some data here, C does not allow empty struct */
  int stub;
} Ocean;
#endif

#ifdef __cplusplus
}
#endif