-
Notifications
You must be signed in to change notification settings - Fork 0
/
unused.cpp
140 lines (135 loc) · 7.3 KB
/
unused.cpp
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
/*
* unused.cpp
*
* Created on: Jun 3, 2013
* Author: frost
*
* Here the unused code is stored. Sometimes it becomes useful,
* so i don't want to delete it.
*/
/** Smoothing **/
/* X axis */
// int pointNum = 4; // Should be even, number of interpolating points
// for (j = 0; j < max_j; j++) {
// for (i = i_sn-10; i < i_sn-3; i++) {
// if (cell.at(n+1).at(i).at(j).type != 18 &&
// cell.at(n+1).at(i+1).at(j).type != 18 &&
// cell.at(n+1).at(i+2).at(j).type != 18 &&
// cell.at(n+1).at(i-1).at(j).type != 18 &&
// cell.at(n+1).at(i-2).at(j).type != 18) {
// double xPoints[pointNum];
// double VxPoints[pointNum]; double VxPointsLin[pointNum]; double VxPointsQuad[pointNum]; double VxPointsCub[pointNum];
// double VrPoints[pointNum]; double VrPointsLin[pointNum]; double VrPointsQuad[pointNum]; double VrPointsCub[pointNum];
// double PPoints[pointNum]; double PPointsLin[pointNum]; double PPointsQuad[pointNum]; double PPointsCub[pointNum];
// double ePoints[pointNum]; double ePointsLin[pointNum]; double ePointsQuad[pointNum]; double ePointsCub[pointNum];
// double rhoPoints[pointNum]; double rhoPointsLin[pointNum]; double rhoPointsQuad[pointNum]; double rhoPointsCub[pointNum];
// for (int iter = 0; iter < pointNum; iter++) {
// int current_i = iter < pointNum/2 ? i - pointNum/2 + iter : i - pointNum/2 + iter + 1;
// xPoints[iter] = current_i * dx;
// VxPoints[iter] = cell.at(n+1).at(current_i).at(j).Vx[0];
// VrPoints[iter] = cell.at(n+1).at(current_i).at(j).Vr[0];
// PPoints[iter] = cell.at(n+1).at(current_i).at(j).P[0];
// ePoints[iter] = cell.at(n+1).at(current_i).at(j).e;
// rhoPoints[iter] = cell.at(n+1).at(current_i).at(j).rho;
// }
// cubic_nak ( pointNum, xPoints, VxPoints, VxPointsLin, VxPointsQuad, VxPointsCub );
// cubic_nak ( pointNum, xPoints, VrPoints, VrPointsLin, VrPointsQuad, VrPointsCub );
// cubic_nak ( pointNum, xPoints, PPoints, PPointsLin, PPointsQuad, PPointsCub );
// cubic_nak ( pointNum, xPoints, ePoints, ePointsLin, ePointsQuad, ePointsCub );
// cubic_nak ( pointNum, xPoints, rhoPoints, rhoPointsLin, rhoPointsQuad, rhoPointsCub );
//
// cell.at(n+1).at(i).at(j).Vx[0] = spline_eval ( pointNum, xPoints, VxPoints, VxPointsLin, VxPointsQuad, VxPointsCub, i*dx );
// cell.at(n+1).at(i).at(j).Vr[0] = spline_eval ( pointNum, xPoints, VrPoints, VrPointsLin, VrPointsQuad, VrPointsCub, i*dx );
// cell.at(n+1).at(i).at(j).P[0] = spline_eval ( pointNum, xPoints, PPoints, PPointsLin, PPointsQuad, PPointsCub, i*dx );
// cell.at(n+1).at(i).at(j).e = spline_eval ( pointNum, xPoints, ePoints, ePointsLin, ePointsQuad, ePointsCub, i*dx );
// cell.at(n+1).at(i).at(j).rho = spline_eval ( pointNum, xPoints, rhoPoints, rhoPointsLin, rhoPointsQuad, rhoPointsCub, i*dx );
// }
// }
// }
// int pointNum = 4; // Should be even, number of interpolating points
// for (j = 0; j < max_j; j++) {
// for (i = 1+pointNum/2; i < i_sn-1-pointNum/2; i++) {
// if (cell.at(n+1).at(i).at(j).type != 18 &&
// cell.at(n+1).at(i+1).at(j).type != 18 &&
// cell.at(n+1).at(i+2).at(j).type != 18 &&
// cell.at(n+1).at(i-1).at(j).type != 18 &&
// cell.at(n+1).at(i-2).at(j).type != 18) {
// double xPoints[pointNum];
// double VxPoints[pointNum]; double VxPointsLin[pointNum]; double VxPointsQuad[pointNum]; double VxPointsCub[pointNum];
// double VrPoints[pointNum]; double VrPointsLin[pointNum]; double VrPointsQuad[pointNum]; double VrPointsCub[pointNum];
// double PPoints[pointNum]; double PPointsLin[pointNum]; double PPointsQuad[pointNum]; double PPointsCub[pointNum];
// double ePoints[pointNum]; double ePointsLin[pointNum]; double ePointsQuad[pointNum]; double ePointsCub[pointNum];
// for (int iter = 0; iter < pointNum; iter++) {
// int current_i = iter < pointNum/2 ? i - pointNum/2 + iter : i - pointNum/2 + iter + 1;
// xPoints[iter] = current_i * dx;
// VxPoints[iter] = cell.at(n+1).at(current_i).at(j).Vx[0];
// VrPoints[iter] = cell.at(n+1).at(current_i).at(j).Vr[0];
// PPoints[iter] = cell.at(n+1).at(current_i).at(j).P[0];
// ePoints[iter] = cell.at(n+1).at(current_i).at(j).e;
// }
// cubic_nak ( pointNum, xPoints, VxPoints, VxPointsLin, VxPointsQuad, VxPointsCub );
// cubic_nak ( pointNum, xPoints, VrPoints, VrPointsLin, VrPointsQuad, VrPointsCub );
// cubic_nak ( pointNum, xPoints, PPoints, PPointsLin, PPointsQuad, PPointsCub );
// cubic_nak ( pointNum, xPoints, ePoints, ePointsLin, ePointsQuad, ePointsCub );
//
// cell.at(n+1).at(i).at(j).Vx[0] = spline_eval ( pointNum, xPoints, VxPoints, VxPointsLin, VxPointsQuad, VxPointsCub, i*dx );
// cell.at(n+1).at(i).at(j).Vr[0] = spline_eval ( pointNum, xPoints, VrPoints, VrPointsLin, VrPointsQuad, VrPointsCub, i*dx );
// cell.at(n+1).at(i).at(j).P[0] = spline_eval ( pointNum, xPoints, PPoints, PPointsLin, PPointsQuad, PPointsCub, i*dx );
// cell.at(n+1).at(i).at(j).e = spline_eval ( pointNum, xPoints, ePoints, ePointsLin, ePointsQuad, ePointsCub, i*dx );
// }
// }
// }
/* Y axis */
//~ for (i = 0; i < max_i; i++) {
//~ for (j = 0; j < max_j; j++) {
//~ switch (cell.at(n+1).at(i).at(j).type) {
//~ // type 0 --> free cell
//~ case 0:
//~ cell.at(n+1).at(i).at(j).Vr[0] = 0.1*cell.at(n+1).at(i).at(j-1).Vr[0] + 0.8*cell.at(n+1).at(i).at(j).Vr[0] + 0.1*cell.at(n+1).at(i).at(j+1).Vr[0];
//~ break;
//~
//~ // type 15 --> top and left borders closed
//~ case 15:
//~ cell.at(n+1).at(i).at(j).Vr[0] = 0.1*cell.at(n+1).at(i).at(j-1).Vr[0] + 0.8*cell.at(n+1).at(i).at(j).Vr[0] - 0.1*cell.at(n+1).at(i).at(j+1).Vr[0];
//~ break;
//~
//~ // type 17 --> left border closed
//~ case 17:
//~ cell.at(n+1).at(i).at(j).Vr[0] = 0.1*cell.at(n+1).at(i).at(j-1).Vr[0] + 0.8*cell.at(n+1).at(i).at(j).Vr[0] + 0.1*cell.at(n+1).at(i).at(j+1).Vr[0];
//~ break;
//~
//~ // type 16 --> bottom and left borders closed
//~ case 16:
//~ cell.at(n+1).at(i).at(j).Vr[0] = 0.1*cell.at(n+1).at(i).at(j-1).Vr[0] + 0.8*cell.at(n+1).at(i).at(j).Vr[0] + 0.1*cell.at(n+1).at(i).at(j+1).Vr[0];
//~ break;
//~
//~ // type 13 --> top border closed
//~ case 13:
//~ cell.at(n+1).at(i).at(j).Vr[0] = 0.1*cell.at(n+1).at(i).at(j-1).Vr[0] + 0.8*cell.at(n+1).at(i).at(j).Vr[0] - 0.1*cell.at(n+1).at(i).at(j+1).Vr[0];
//~ break;
//~
//~ // type 14 --> bottom border closed
//~ case 14:
//~ cell.at(n+1).at(i).at(j).Vr[0] = 0.1*cell.at(n+1).at(i).at(j-1).Vr[0] + 0.8*cell.at(n+1).at(i).at(j).Vr[0] + 0.1*cell.at(n+1).at(i).at(j+1).Vr[0];
//~ break;
//~
//~ // type 19 --> right border closed
//~ case 19:
//~ cell.at(n+1).at(i).at(j).Vr[0] = 0.1*cell.at(n+1).at(i).at(j-1).Vr[0] + 0.8*cell.at(n+1).at(i).at(j).Vr[0] + 0.1*cell.at(n+1).at(i).at(j+1).Vr[0];
//~ break;
//~
//~ // type 21 --> bottom and right borders closed
//~ case 21:
//~ cell.at(n+1).at(i).at(j).Vr[0] = 0.1*cell.at(n+1).at(i).at(j-1).Vr[0] + 0.8*cell.at(n+1).at(i).at(j).Vr[0] + 0.1*cell.at(n+1).at(i).at(j+1).Vr[0];
//~ break;
//~
//~ // type 20 --> top and right borders closed
//~ case 20:
//~ cell.at(n+1).at(i).at(j).Vr[0] = 0.1*cell.at(n+1).at(i).at(j-1).Vr[0] + 0.8*cell.at(n+1).at(i).at(j).Vr[0] - 0.1*cell.at(n+1).at(i).at(j+1).Vr[0];
//~ break;
//~
//~ default:
//~ break;
//~ }
//~ }
//~ }