summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorConstantin Riß <constantin.riss@dre.de>2010-01-17 16:41:35 +0100
committerConstantin Riß <constantin.riss@dre.de>2010-01-17 16:41:35 +0100
commit3ab0acf808ad8aa2f611e4fdc0c643705fae03ff (patch)
treeff921ab2b49bc1d20f7413598e078aeed560c512
parentd312a67a50af1b223a3a865f3db9963c2e4a73f0 (diff)
downloadc3d-3ab0acf808ad8aa2f611e4fdc0c643705fae03ff.tar
c3d-3ab0acf808ad8aa2f611e4fdc0c643705fae03ff.zip
Temperaturberechnung angefangen
-rw-r--r--Temparray.cpp33
-rw-r--r--Temparray.h2
2 files changed, 28 insertions, 7 deletions
diff --git a/Temparray.cpp b/Temparray.cpp
index 16335f9..c03ea48 100644
--- a/Temparray.cpp
+++ b/Temparray.cpp
@@ -35,14 +35,35 @@ Temparray::Temparray(float initialtemp, int x0, int y0, int z0){
}
}
}
- cubehole(0, 0, 0, 0).setColor(vmml::vec4f(1.0, 0.5, 1.0, 1.0),
- vmml::vec4f(0.5, 0.5, 1.0, 1.0),
- vmml::vec4f(1.0, 0.5, 0.0, 1.0),
- vmml::vec4f(0.0, 0.0, 0.0, 1.0));
}
-void Temparray::calcTemp(int x, int y, int z, int line, int pos){
-
+void Temparray::calcTemp(){
+ float specificconductivity = 0.7;
+ float areasmall, areabig, distance, capacity, volume;
+ float meterperunit = 3.0;
+
+ for(int i = 0; i < sx; ++i) {
+ for(int j = 0; j < sy; ++j) {
+ for(int k = 0; k < sz; ++k) {
+ for(int l = 5; l > 0; --l) {
+ for(int m = 0; m < 4; m++) {
+ if(m % 2 == 0) {
+ areasmall = ((cubehole(i, j, k, l).getWidth() + cubehole(i, j, k, l).getInnerWidth())/2)*
+ cubehole(i, j, k, l).getHeight();
+ areabig = ((cubehole(i, j, k, l-1).getWidth() + cubehole(i, j, k, l-1).getInnerWidth())/2)*
+ cubehole(i, j, k, l-1).getHeight();
+ }
+ else if(m % 2 == 1) {
+ areasmall = ((cubehole(i, j, k, l).getDepth()+ cubehole(i, j, k, l).getInnerDepth())/2)*
+ cubehole(i, j, k, l).getHeight();
+ areabig = ((cubehole(i, j, k, l-1).getDepth()+ cubehole(i, j, k, l-1).getInnerDepth())/2)*
+ cubehole(i, j, k, l-1).getHeight();
+ }
+ }
+ }
+ }
+ }
+ }
}
std::list<Triangle> Temparray::getTriangles(){
diff --git a/Temparray.h b/Temparray.h
index cae1e6f..13e858d 100644
--- a/Temparray.h
+++ b/Temparray.h
@@ -12,7 +12,7 @@ class Temparray
Temparray(float initialtemp, int x0, int y0, int z0);
Temparray(){}
~Temparray(){}
- void calcTemp(int x, int y, int z, int line, int pos);
+ void calcTemp();
float& temperatureold(int x, int y, int z, int line, int pos) {
return temparrayold[x*sy*sz*6*4 + y*sz*6*4 + z*6*4 + line*4 + pos];
}