-
Notifications
You must be signed in to change notification settings - Fork 7
/
ffd.h
154 lines (135 loc) · 4.26 KB
/
ffd.h
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
///////////////////////////////////////////////////////////////////////////////
///
/// \file ffd.h
///
/// \brief Main routine of Fast Fluid Dynamics
///
/// \author Mingang Jin, Qingyan Chen
/// Purdue University
/// Jin55@purdue.edu, YanChen@purdue.edu
/// Wangda Zuo
/// University of Miami
/// W.Zuo@miami.edu
///
/// \date 8/3/2013
///
///////////////////////////////////////////////////////////////////////////////
#ifndef _FFD_H
#define _FFD_H
#endif
#ifndef _DATA_STRUCTURE_H
#define _DATA_STRUCTURE_H
#include "data_structure.h"
#endif
#ifndef _FFD_DLL_H
#define FFD_DLL_H
#include "ffd_dll.h"
#endif
#ifndef _TIMING_H
#define _TIMING_H
#include "timing.h"
#endif
#ifndef _SOLVER_H
#define _SOLVER_H
#include "solver.h"
#endif
#ifndef _UTILITY_H
#define _UTILITY_H
#include "utility.h"
#endif
#ifndef _DATA_WRITER_H
#define _DATA_WRITER_H
#include "data_writer.h"
#endif
#ifndef _INITIALIZATION_H
#define _INITIALIZATION_H
#include "initialization.h"
#endif
#ifndef _VISUALIZATION_H
#define _VISUALIZATION_H
#include "visualization.h"
#endif
///////////////////////////////////////////////////////////////////////////////
/// Lanuch the FFD simulation through a thread
///
///\param p Pointer to the cosimulaiton data
///
///\return 0 if no error occurred
///////////////////////////////////////////////////////////////////////////////
#ifdef _MSC_VER //Windows
DWORD WINAPI ffd_thread(void *p);
#else //Linux
void ffd_thread(void *p);
#endif
///////////////////////////////////////////////////////////////////////////////
/// Main routine of FFD
///
///\para cosimulation Integer to identify the simulation type
///
///\return 0 if no error occurred
///////////////////////////////////////////////////////////////////////////////
int ffd(int cosimulation);
///////////////////////////////////////////////////////////////////////////////
/// Allcoate memory for variables
///
///\param para Pointer to FFD parameters
///
///\return No return needed
///////////////////////////////////////////////////////////////////////////////
int allocate_memory (PARA_DATA *para);
///////////////////////////////////////////////////////////////////////////////
/// GLUT display callback routines
///
///\return No return needed
///////////////////////////////////////////////////////////////////////////////
static void display_func(void);
///////////////////////////////////////////////////////////////////////////////
/// GLUT idle callback routines
///
///\return No return needed
///////////////////////////////////////////////////////////////////////////////
static void idle_func(void);
///////////////////////////////////////////////////////////////////////////////
/// GLUT keyboard callback routines
///
///\param key Chararcter of the key
///\param x X-position
///\param y Y-Positon
///
///\return No return needed
///////////////////////////////////////////////////////////////////////////////
static void key_func(unsigned char key, int x, int y);
///////////////////////////////////////////////////////////////////////////////
/// GLUT motion callback routines
///
///\param x X-position
///\param y Y-Positon
///
///\return No return needed
///////////////////////////////////////////////////////////////////////////////
static void motion_func(int x, int y);
///////////////////////////////////////////////////////////////////////////////
/// GLUT mouse callback routines
///
///\param button Button of the mouse
///\param x X-position
///\param y Y-Positon
///
///\return No return needed
///////////////////////////////////////////////////////////////////////////////
static void mouse_func(int button, int state, int x, int y);
///////////////////////////////////////////////////////////////////////////////
/// Open_glut_window --- open a glut compatible window and set callbacks
///
///\return No return needed
///////////////////////////////////////////////////////////////////////////////
static void open_glut_window();
///////////////////////////////////////////////////////////////////////////////
/// GLUT reshape callback routines
///
///\param width Width of the window
///\param height Height of the window
///
///\return No return needed
///////////////////////////////////////////////////////////////////////////////
static void reshape_func(int width, int height);