diff options
author | Constantin Riß <constantin.riss@dre.de> | 2010-01-17 20:10:48 +0100 |
---|---|---|
committer | Constantin Riß <constantin.riss@dre.de> | 2010-01-17 20:10:48 +0100 |
commit | 840a16aa8ea4159c874411df0296092c56dde9fb (patch) | |
tree | dd2dae950367ac6be74b308d604c8d968393ba8e | |
parent | ae5ab4efe8b7f785d06d9c0f8d59c868692a13a6 (diff) | |
download | c3d-840a16aa8ea4159c874411df0296092c56dde9fb.tar c3d-840a16aa8ea4159c874411df0296092c56dde9fb.zip |
temperaturaustausch funzt noch nicht richtig
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Temparray.cpp | 16 | ||||
-rw-r--r-- | Temparray.h | 2 | ||||
-rw-r--r-- | main.cpp | 3 |
4 files changed, 20 insertions, 2 deletions
@@ -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; @@ -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 |