Commit 75235d4e authored by Moritz's avatar Moritz

removed that the size of the vectorfield file is a power of 2

parent c4b3f5b2
......@@ -62,23 +62,14 @@ namespace Teamproject {
#region vector
private void SquareGridVEC() {
//find highest dimension
int highestDim = 0;
//find highest dimension -> used as size for all dimensions
int maxDimCount = 0;
if (_gridsize.x >= _gridsize.y && _gridsize.x >= _gridsize.z)
highestDim = (int)_gridsize.x;
maxDimCount = (int)_gridsize.x;
if (_gridsize.y >= _gridsize.x && _gridsize.y >= _gridsize.z)
highestDim = (int)_gridsize.y;
maxDimCount = (int)_gridsize.y;
if (_gridsize.z >= _gridsize.y && _gridsize.z >= _gridsize.x)
highestDim = (int)_gridsize.z;
//find next highest dimension count, that is a result of 2^n
int maxDimCount = 0;
for (int i = 0; i < 10; i++) {
if(Math.Pow(2, i) > highestDim) {
maxDimCount = (int)Math.Pow(2, i);
break;
}
}
maxDimCount = (int)_gridsize.z;
//number of indices that have to be filled in each dimension
int xFill, yFill, zFill;
......@@ -141,23 +132,14 @@ namespace Teamproject {
#region float
private void SquareGridFLOAT() {
//find highest dimension
int highestDim = 0;
//find highest dimension -> used as size for all dimensions
int maxDimCount = 0;
if (_gridsize.x >= _gridsize.y && _gridsize.x >= _gridsize.z)
highestDim = (int)_gridsize.x;
maxDimCount = (int)_gridsize.x;
if (_gridsize.y >= _gridsize.x && _gridsize.y >= _gridsize.z)
highestDim = (int)_gridsize.y;
maxDimCount = (int)_gridsize.y;
if (_gridsize.z >= _gridsize.y && _gridsize.z >= _gridsize.x)
highestDim = (int)_gridsize.z;
//find next highest dimension count, that is a result of 2^n
int maxDimCount = 0;
for (int i = 0; i < 10; i++) {
if (Math.Pow(2, i) > highestDim) {
maxDimCount = (int)Math.Pow(2, i);
break;
}
}
maxDimCount = (int)_gridsize.z;
//number of indices that have to be filled in each dimension
int xFill, yFill, zFill;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment