summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Temparray.cpp16
-rw-r--r--Temparray.h2
-rw-r--r--main.cpp3
4 files changed, 20 insertions, 2 deletions
diff --git a/.gitignore b/.gitignore
index a748af4..ffb4888 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,3 +9,4 @@
*.win
*.dev
*.o
+*.dll
diff --git a/Temparray.cpp b/Temparray.cpp
index e7d8b42..b47cf4b 100644
--- a/Temparray.cpp
+++ b/Temparray.cpp
@@ -84,7 +84,14 @@ void Temparray::calcTemp(){
}
tau12 = capacity * thermalresistance;
tau21 = capacity2 * thermalresistance;
- std::cerr << tau12 << "\n" << tau21 << std::endl;
+
+ temperaturenew(i, j, k, l, m) =
+ temperatureold(i, j, k, l, m) - ((temperatureold(i, j, k, l, m) -
+ temperatureold(i, j, k, l-1, m))*(1-exp(1/tau12)));
+ temperaturenew(i, j, k, l-1, m) =
+ temperatureold(i, j, k, l-1, m) + ((temperatureold(i, j, k, l, m) -
+ temperatureold(i, j, k, l-1, m))*(1-exp(1/tau21)));
+
}
@@ -92,6 +99,13 @@ void Temparray::calcTemp(){
}
}
}
+ for(int i = 0; i < sx; ++i) {
+ for(int j = 0; j < sy; ++j) {
+ for(int k = 0; k < sz; ++k) {
+ for(int l = 0; l < 6; ++l) {
+ for(int m = 0; m < 4; m++) {temperatureold(i, j, k, l, m)=temperaturenew(i, j, k, l, m);}}}}}
+ std::cerr << temperaturenew(2, 2, 2, 2, 2) << std::endl;
+ std::cerr << temperaturenew(2, 2, 2, 3, 2) << std::endl;
}
std::list<Triangle> Temparray::getTriangles(){
diff --git a/Temparray.h b/Temparray.h
index 13e858d..04250c4 100644
--- a/Temparray.h
+++ b/Temparray.h
@@ -5,6 +5,7 @@
#include "gl.h"
#include "Triangle.h"
#include <list>
+#include <math.h>
class Temparray
{
@@ -51,6 +52,7 @@ class Temparray
}
}
}
+ temperatureold(2, 2, 2, 2, 2) = 90;
}
/* void calcAverage(){
float tempcache = 0;
diff --git a/main.cpp b/main.cpp
index 27e4983..3a55b46 100644
--- a/main.cpp
+++ b/main.cpp
@@ -11,7 +11,8 @@
#include <unistd.h>
#endif
-#define MIN_FRAME_DELTA 16
+//#define MIN_FRAME_DELTA 16
+#define MIN_FRAME_DELTA 1000
#define DEFAULT_WIDTH 640
#define DEFAULT_HEIGHT 640