-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathregion.h
More file actions
92 lines (75 loc) · 2.14 KB
/
Copy pathregion.h
File metadata and controls
92 lines (75 loc) · 2.14 KB
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
#ifndef REGION_H
#define REGION_H
#include <iostream>
#include "fluid.h"
#define DEBUG 0
extern double rotation_angle;
enum OBJ
{
CYLINDER,
SQUARE,
DIAMOND,
NACA,
ROTOR,
MULTI_OBJECTS
};
// #define CALL_SET_OBSTACLE(object,ptrToMember) (object.*ptrToMember)
// class Region;
// typedef void (Region::*SET_OBSTACLE)(double, double, bool);
using namespace std;
class Region
{
public:
Region(int _height, int _width, double _simHeight = 1.1);
// Region(shared_ptr<Region> r){this=r;}
double cX(double x)
{
return x * cScale;
}
double cY(double y)
{
return height - y * cScale;
}
void setupRegion(int _RegionNr = 0, double _overRelaxation = 1.9, int _resolution = 50, double _density = 1000, int _numThreads = 4);
void setObstacle(double x, double y, bool reset);
void setObstacleCylinder(double x, double y, bool reset);
void setObstacleSquare(double x, double y, bool reset);
void setObstacleDiamond(double x, double y, bool reset);
void setObstacleNaca(double x, double y, bool reset);
void setObstacleRotor(double x, double y, bool reset);
void setObstacleMultiObjectsComponent(double x, double y, bool reset);
void updateRegionSize(int _height, int _width);
void update();
void sayhello() { cout << "hello! " << text << endl; }
string text = "";
double gravity = -9.81;
double dt = 1.0 / 60.0;
int numIters = 40;
int frameNr = 0;
double overRelaxation = 1.9;
double obstacleX = 0.0;
double obstacleY = 0.0;
double characteristic_length = 0.15;
bool paused = false;
int RegionNr = 0;
bool showObstacle = false;
bool showObstaclePosition = false;
bool showStreamlines = false;
bool showVelocity = false;
bool showXVelocity = false;
bool showYVelocity = false;
bool showVelocityVectors = false;
bool showPressure = false;
bool showTracer = true;
shared_ptr<Fluid> fluid;
int height;
int width;
double simHeight;
double cScale;
double simWidth;
int resolution;
int numThreads;
OBJ obstacle;
};
OBJ indexToOBJ(int index);
#endif // Region_H