forked from ninnghazad/hipims-ocl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestCaseBase.js
96 lines (75 loc) · 2.96 KB
/
TestCaseBase.js
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
'use strict';
function TestCaseBase (parentDomain) {
this.parentDomain = parentDomain;
};
TestCaseBase.prototype.getGridUsingFormula = function (domainSizeX, domainSizeY, domainResolution, cellFormula, timeValue) {
let domainData = new Float32Array(domainSizeX * domainSizeY);
let domainShiftX = Math.round(domainSizeX / domainResolution) % 2 === 0 ? domainResolution / 2 : 0.0;
let domainShiftY = Math.round(domainSizeY / domainResolution) % 2 === 0 ? domainResolution / 2 : 0.0;
let domainMetadata = {
minX: domainResolution * domainSizeX / -2 + domainShiftX,
maxX: domainResolution * domainSizeX / 2 - domainShiftX,
minY: domainResolution * domainSizeY / -2 + domainShiftY,
maxY: domainResolution * domainSizeY / 2 - domainShiftY,
resolution: domainResolution
};
// Reverse the direction of the Y-axis for these tests to match our LL origin
for (let x = 0; x < domainSizeX; x++ ) {
for (let y = 0; y < domainSizeY; y++) {
let x0 = domainMetadata.minX + x * domainResolution;
let y0 = domainMetadata.maxY - y * domainResolution;
let a = y * domainSizeX + x;
domainData[a] = cellFormula.call(this, x0, y0, timeValue, domainMetadata);
}
}
return domainData;
}
TestCaseBase.prototype.getExtent = function () {
return null;
}
TestCaseBase.prototype.getResolution = function () {
return null;
}
TestCaseBase.prototype.getManningCoefficient = function () {
return null;
}
TestCaseBase.prototype.getVaryingManningCoefficient = function () {
return null;
}
TestCaseBase.prototype.getTopography = function (domainSizeX, domainSizeY, domainResolution) {
return null;
}
TestCaseBase.prototype.getVaryingManningCoefficient = function (domainSizeX, domainSizeY, domainResolution) {
return null;
}
TestCaseBase.prototype.getInitialDepth = function (domainSizeX, domainSizeY, domainResolution) {
return null;
}
TestCaseBase.prototype.getInitialFSL = function (domainSizeX, domainSizeY, domainResolution) {
return null;
}
TestCaseBase.prototype.getInitialVelocityX = function (domainSizeX, domainSizeY, domainResolution) {
return null;
}
TestCaseBase.prototype.getInitialVelocityY = function (domainSizeX, domainSizeY, domainResolution) {
return null;
}
TestCaseBase.prototype.getDepthAtTime = function (domainSizeX, domainSizeY, domainResolution, simulationTime) {
return null;
}
TestCaseBase.prototype.getFSLAtTime = function (domainSizeX, domainSizeY, domainResolution, simulationTime) {
return null;
}
TestCaseBase.prototype.getVelocityXAtTime = function (domainSizeX, domainSizeY, domainResolution, simulationTime) {
return null;
}
TestCaseBase.prototype.getVelocityYAtTime = function (domainSizeX, domainSizeY, domainResolution, simulationTime) {
return null;
}
TestCaseBase.prototype.getFrontPositionAtTime = function (domainSizeX, domainSizeY, domainResolution, simulationTime) {
return null;
}
TestCaseBase.prototype.getFrontVelocityAtTime = function (domainSizeX, domainSizeY, domainResolution, simulationTime) {
return null;
}
module.exports = TestCaseBase;