diff --git a/apps/gpu/LidDrivenCavityGPU/LidDrivenCavity.cpp b/apps/gpu/LidDrivenCavityGPU/LidDrivenCavity.cpp
index 836374dfa24492e52a14fb9637a3b49a854b30fe..0d927d7aa753176f870a90d3ebc3a2e8ef7a6bdd 100644
--- a/apps/gpu/LidDrivenCavityGPU/LidDrivenCavity.cpp
+++ b/apps/gpu/LidDrivenCavityGPU/LidDrivenCavity.cpp
@@ -94,7 +94,7 @@ int main(int argc, char *argv[])
         //////////////////////////////////////////////////////////////////////////
         // Simulation parameters
         //////////////////////////////////////////////////////////////////////////
-        std::string path("/output/DrivenCavity");
+        std::string path("./output/DrivenCavity");
         std::string simulationName("LidDrivenCavity");
 
         const real L        = 1.0;
@@ -103,8 +103,8 @@ int main(int argc, char *argv[])
         const real dt       = (real)0.5e-3;
         const uint nx       = 64;
 
-        const uint timeStepOut = 10000;
-        const uint timeStepEnd = 250000;
+        const uint timeStepOut = 1;
+        const uint timeStepEnd = 10;
 
         // switch between LBM and GKS solver here
         // LbmOrGks lbmOrGks = GKS;
diff --git a/src/gpu/GridGenerator/geometries/Arrow/ArrowImp.h b/src/gpu/GridGenerator/geometries/Arrow/ArrowImp.h
index ef145b7def48803b7e2d043f7a5862ee21f954c4..1fb509e0c6092dd3f00d4abf1849014191425db2 100644
--- a/src/gpu/GridGenerator/geometries/Arrow/ArrowImp.h
+++ b/src/gpu/GridGenerator/geometries/Arrow/ArrowImp.h
@@ -36,7 +36,6 @@
 #include <memory>
 
 #include "global.h"
-#include "GridGenerator_export.h"
 
 #include "Arrow.h"
 
diff --git a/src/gpu/GridGenerator/geometries/Cuboid/Cuboid.cpp b/src/gpu/GridGenerator/geometries/Cuboid/Cuboid.cpp
index e64a202ca9bcd5a33fcc9ba85e7bd35fa67a1d4e..7b0dbcdbdcbd679f1eb47ed5db7d828da8c31767 100644
--- a/src/gpu/GridGenerator/geometries/Cuboid/Cuboid.cpp
+++ b/src/gpu/GridGenerator/geometries/Cuboid/Cuboid.cpp
@@ -113,18 +113,12 @@ double Cuboid::getMaximum(double x1, double x2)
 bool Cuboid::isPointInObject(const double& x1, const double& x2, const double& x3, const double& minOffset, const double& maxOffset)
 {
     //false, if 'not in Object' or 'on Boundary'!
-    if (vf::Math::lessEqual((real)x1, (real)this->getX1Minimum() + (real)minOffset))
-        return false;
-    if (vf::Math::lessEqual((real)x2, (real)this->getX2Minimum() + (real)minOffset))
-        return false;
-    if (vf::Math::lessEqual((real)x3, (real)this->getX3Minimum() + (real)minOffset))
-        return false;
-    if (vf::Math::greaterEqual((real)x1, (real)this->getX1Maximum() - (real)maxOffset))
-        return false;
-    if (vf::Math::greaterEqual((real)x2, (real)this->getX2Maximum() - (real)maxOffset))
-        return false;
-    if (vf::Math::greaterEqual((real)x3, (real)this->getX3Maximum() - (real)maxOffset))
-        return false;
+    if (vf::Math::lessEqual(   (real)x1, (real)this->getX1Minimum() + (real)minOffset))  return false;
+    if (vf::Math::lessEqual(   (real)x2, (real)this->getX2Minimum() + (real)minOffset))  return false;
+    if (vf::Math::lessEqual(   (real)x3, (real)this->getX3Minimum() + (real)minOffset))  return false;
+    if (vf::Math::greaterEqual((real)x1, (real)this->getX1Maximum() - (real)maxOffset))  return false;
+    if (vf::Math::greaterEqual((real)x2, (real)this->getX2Maximum() - (real)maxOffset))  return false;
+    if (vf::Math::greaterEqual((real)x3, (real)this->getX3Maximum() - (real)maxOffset))  return false;
 
     return true;
 }
diff --git a/src/gpu/GridGenerator/geometries/Sphere/Sphere.h b/src/gpu/GridGenerator/geometries/Sphere/Sphere.h
index ba5821f5bfed5b4d25c1ee3c5abecb168db462e7..03b9ef9fd101f19dbaff7d4e4109000cce6e3c49 100644
--- a/src/gpu/GridGenerator/geometries/Sphere/Sphere.h
+++ b/src/gpu/GridGenerator/geometries/Sphere/Sphere.h
@@ -34,7 +34,6 @@
 #define SPHERE_H
 
 #include "global.h"
-#include "GridGenerator_export.h"
 #include "geometries/Object.h"
 
 class GRIDGENERATOR_EXPORT Sphere : public Object
diff --git a/src/gpu/GridGenerator/geometries/Triangle/Triangle.h b/src/gpu/GridGenerator/geometries/Triangle/Triangle.h
index 0017d2f71145f2608976a95018816bf81cef44b7..0c62f2c0db5ced3c749c2ffd6196087192aab3df 100644
--- a/src/gpu/GridGenerator/geometries/Triangle/Triangle.h
+++ b/src/gpu/GridGenerator/geometries/Triangle/Triangle.h
@@ -36,7 +36,6 @@
 #include <memory>
 
 #include "global.h"
-#include "GridGenerator_export.h"
 #include "geometries/Vertex/Vertex.h"
 
 class TriangleMemento;
diff --git a/src/gpu/GridGenerator/geometries/TriangularMesh/TriangularMesh.h b/src/gpu/GridGenerator/geometries/TriangularMesh/TriangularMesh.h
index 2d31de98bf1f5530ada555e548ac6bb40e5e51b7..beb1c3a05b25904446e72a62196bcf6213fb0691 100644
--- a/src/gpu/GridGenerator/geometries/TriangularMesh/TriangularMesh.h
+++ b/src/gpu/GridGenerator/geometries/TriangularMesh/TriangularMesh.h
@@ -37,7 +37,6 @@
 #include <vector>
 #include <string>
 #include <memory>
-#include "GridGenerator_export.h"
 #include "global.h"
 
 #include "geometries/Triangle/Triangle.h"
diff --git a/src/gpu/GridGenerator/geometries/TriangularMesh/TriangularMeshStrategy.h b/src/gpu/GridGenerator/geometries/TriangularMesh/TriangularMeshStrategy.h
index 573a464844ac769ebd1127c666481b87f363099f..b98d531599ff897da0ad596a7d46e1393a456aac 100644
--- a/src/gpu/GridGenerator/geometries/TriangularMesh/TriangularMeshStrategy.h
+++ b/src/gpu/GridGenerator/geometries/TriangularMesh/TriangularMeshStrategy.h
@@ -34,7 +34,6 @@
 #define TriangularMeshStrategy_H
 
 #include "global.h"
-#include "GridGenerator_export.h"
 
 class GridImp;
 class TriangularMesh;
diff --git a/src/gpu/GridGenerator/geometries/TriangularMesh/triangleNeighborFinder/TriangleNeighborFinder.h b/src/gpu/GridGenerator/geometries/TriangularMesh/triangleNeighborFinder/TriangleNeighborFinder.h
index b0dda279c5f95a621b5875e78b5cdb7479b98a54..2b42ff3ad2dacaade3bbc8da4f6d4b3c61b14442 100644
--- a/src/gpu/GridGenerator/geometries/TriangularMesh/triangleNeighborFinder/TriangleNeighborFinder.h
+++ b/src/gpu/GridGenerator/geometries/TriangularMesh/triangleNeighborFinder/TriangleNeighborFinder.h
@@ -33,8 +33,7 @@
 #ifndef TriangleNeighborFinder_h
 #define TriangleNeighborFinder_h
 
-#include "GridGenerator/global.h"
-#include "GridGenerator_export.h"
+#include "global.h"
 #include <vector>
 
 struct IDS {
diff --git a/src/gpu/GridGenerator/geometries/Vertex/Vertex.h b/src/gpu/GridGenerator/geometries/Vertex/Vertex.h
index 7b27d853f652459143699204c59a5843de6eaf39..ec5fc0f1ced64f7757de26deaf3053504e29d7c6 100644
--- a/src/gpu/GridGenerator/geometries/Vertex/Vertex.h
+++ b/src/gpu/GridGenerator/geometries/Vertex/Vertex.h
@@ -37,7 +37,7 @@
 #include <memory>
 #include <ostream>
 
-#include "global.h"
+#include "gpu/GridGenerator/global.h"
 
 struct GRIDGENERATOR_EXPORT Vertex
 {
diff --git a/src/gpu/GridGenerator/geometries/VerticalCylinder/VerticalCylinder.h b/src/gpu/GridGenerator/geometries/VerticalCylinder/VerticalCylinder.h
index 24d9383bf5628e46b1d634874f79ceb73eaa6cae..e995d2ba16eba17930401c99c260f81b9c6077b4 100644
--- a/src/gpu/GridGenerator/geometries/VerticalCylinder/VerticalCylinder.h
+++ b/src/gpu/GridGenerator/geometries/VerticalCylinder/VerticalCylinder.h
@@ -34,7 +34,6 @@
 #define VERTICAL_CYLINDER_H
 
 #include "global.h"
-#include "GridGenerator_export.h"
 #include "geometries/Object.h"
 
 class GRIDGENERATOR_EXPORT VerticalCylinder : public Object
diff --git a/src/gpu/GridGenerator/grid/BoundaryConditions/Side.cpp b/src/gpu/GridGenerator/grid/BoundaryConditions/Side.cpp
index 4c5161acb778c05402301a10462220aeea5e73f4..330f400b34473102c0bbe4b2e80d3d5272dd1d3c 100644
--- a/src/gpu/GridGenerator/grid/BoundaryConditions/Side.cpp
+++ b/src/gpu/GridGenerator/grid/BoundaryConditions/Side.cpp
@@ -53,7 +53,7 @@ void Side::addIndices(SPtr<Grid> grid, SPtr<BoundaryCondition> boundaryCondition
                                             || grid->getFieldEntry(index) == vf::gpu::FLUID_CFC
                                             || grid->getFieldEntry(index) == vf::gpu::FLUID_CFF
                                             || grid->getFieldEntry(index) == vf::gpu::FLUID_FCC
-                                            || grid->getFieldEntry(index) == vf::gpu::FLUID_FCF ) )
+                                            || grid->getFieldEntry(index) == vf::gpu::FLUID_FCF ))
             {
                 grid->setFieldEntry(index, boundaryCondition->getType());
                 boundaryCondition->indices.push_back(index);
@@ -133,6 +133,7 @@ void Side::setQs(SPtr<Grid> grid, SPtr<BoundaryCondition> boundaryCondition, uin
             qNode[dir] = 0.5;
         else
             qNode[dir] = -1.0;
+
     }
 
     boundaryCondition->qs.push_back(qNode);
@@ -149,6 +150,7 @@ uint Side::getIndex(SPtr<Grid> grid, std::string coord, real constant, real v1,
     return INVALID_INDEX;
 }
 
+
 void Geometry::addIndices(std::vector<SPtr<Grid> > grids, uint level, SPtr<BoundaryCondition> boundaryCondition)
 {
     auto geometryBoundaryCondition = std::dynamic_pointer_cast<GeometryBoundaryCondition>(boundaryCondition);
@@ -188,6 +190,8 @@ void Geometry::addIndices(std::vector<SPtr<Grid> > grids, uint level, SPtr<Bound
     }
 }
 
+
+
 void MX::addIndices(std::vector<SPtr<Grid> > grid, uint level, SPtr<BoundaryCondition> boundaryCondition)
 {
     real startInner = grid[level]->getStartY();
@@ -277,6 +281,6 @@ void PZ::addIndices(std::vector<SPtr<Grid> > grid, uint level, SPtr<BoundaryCond
     real coordinateNormal = grid[level]->getEndZ() - grid[level]->getDelta();
 
     if( coordinateNormal < grid[0]->getEndZ() - grid[0]->getDelta() ) return;
-
+    
     Side::addIndices(grid[level], boundaryCondition, "z", coordinateNormal, startInner, endInner, startOuter, endOuter);
 }
diff --git a/src/gpu/GridGenerator/grid/Cell.h b/src/gpu/GridGenerator/grid/Cell.h
index a7a64917025742217be88e7ebe1ccc9e669fc7c0..f39bd4a7bb13be0d768e092276194e6bad16dcff 100644
--- a/src/gpu/GridGenerator/grid/Cell.h
+++ b/src/gpu/GridGenerator/grid/Cell.h
@@ -33,7 +33,7 @@
 #ifndef CELL_H
 #define CELL_H
 
-#include "global.h"
+#include "gpu/GridGenerator/global.h"
 
 struct Point
 {
diff --git a/src/gpu/GridGenerator/grid/Field.h b/src/gpu/GridGenerator/grid/Field.h
index 002c8c108bd405f4077cd2779f5e59232135ace9..08fff6da7c5a3f431138dc5039b4d234493ae4b8 100644
--- a/src/gpu/GridGenerator/grid/Field.h
+++ b/src/gpu/GridGenerator/grid/Field.h
@@ -33,7 +33,7 @@
 #ifndef FIELD_H
 #define FIELD_H
 
-#include "global.h"
+#include "gpu/GridGenerator/global.h"
 
 struct Vertex;
 
diff --git a/src/gpu/GridGenerator/grid/Grid.h b/src/gpu/GridGenerator/grid/Grid.h
index 3407b23c1efbb4143d06ded7880c26d7c0eb6599..4dcc99c169b269be4dc81a73cfb36e187036f8a2 100644
--- a/src/gpu/GridGenerator/grid/Grid.h
+++ b/src/gpu/GridGenerator/grid/Grid.h
@@ -28,18 +28,18 @@
 //
 //! \file Grid.h
 //! \ingroup grid
-//! \author Soeren Peters, Stephan Lenz, Martin Schönherr
+//! \author Soeren Peters, Stephan Lenz, Martin Sch�nherr
 //=======================================================================================
 #ifndef GRID_H
 #define GRID_H
 
 #include "Core/LbmOrGks.h"
 
-#include "global.h"
+#include "gpu/GridGenerator/global.h"
 
-#include "geometries/Vertex/Vertex.h"
+#include "gpu/GridGenerator/geometries/Vertex/Vertex.h"
 
-#include "grid/Cell.h"
+#include "gpu/GridGenerator/grid/Cell.h"
 
 class TriangularMesh;
 struct Vertex;
@@ -165,7 +165,7 @@ public:
     virtual uint getSendIndex(int direction, uint index)    = 0;
     virtual uint getReceiveIndex(int direction, uint index) = 0;
 
-    virtual void repairCommunicationInices(int direction) = 0;
+    virtual void repairCommunicationIndices(int direction) = 0;
 
 };
 
diff --git a/src/gpu/GridGenerator/grid/GridBuilder/GridBuilder.h b/src/gpu/GridGenerator/grid/GridBuilder/GridBuilder.h
index 57290025c3f6e48554e1dafe9bd101ae237b3288..90713bfef308d0410a32d67aad4b2bea56a19169 100644
--- a/src/gpu/GridGenerator/grid/GridBuilder/GridBuilder.h
+++ b/src/gpu/GridGenerator/grid/GridBuilder/GridBuilder.h
@@ -28,7 +28,7 @@
 //
 //! \file GridBuilder.h
 //! \ingroup grid
-//! \author Soeren Peters, Stephan Lenz, Martin Schönherr
+//! \author Soeren Peters, Stephan Lenz, Martin Sch�nherr
 //=======================================================================================
 #ifndef GridBuilder_H
 #define GridBuilder_H
@@ -37,7 +37,7 @@
 #include <string>
 #include <memory>
 
-#include "GridGenerator/global.h"
+#include "gpu/GridGenerator/global.h"
 
 #define GEOMQS 6
 #define INLETQS 0
@@ -124,5 +124,4 @@ public:
     virtual void getReceiveIndices(int *sendIndices, int direction, int level) = 0;
 };
 
-#endif
-
+#endif
\ No newline at end of file
diff --git a/src/gpu/GridGenerator/grid/GridBuilder/LevelGridBuilder.cpp b/src/gpu/GridGenerator/grid/GridBuilder/LevelGridBuilder.cpp
index aa593ad7ffc4daecb3a05ab0cc41865a09594933..41d2cf5af9af2029c0200e4aae311e2a7717c6cb 100644
--- a/src/gpu/GridGenerator/grid/GridBuilder/LevelGridBuilder.cpp
+++ b/src/gpu/GridGenerator/grid/GridBuilder/LevelGridBuilder.cpp
@@ -34,6 +34,7 @@
 
 #include <stdio.h>
 #include <iostream>
+#include <algorithm>
 
 #include "geometries/Arrow/ArrowImp.h"
 #include "geometries/BoundingBox/BoundingBox.h"
@@ -84,7 +85,6 @@ void LevelGridBuilder::setSlipBoundaryCondition(SideType sideType, real nomalX,
     slipBoundaryCondition->side->addIndices(grids, 0, slipBoundaryCondition);
 
     slipBoundaryCondition->fillSlipNormalLists();
-
     boundaryConditions[0]->slipBoundaryConditions.push_back(slipBoundaryCondition);
 
     *logging::out << logging::Logger::INFO_INTERMEDIATE << "Set Slip BC on level " << 0 << " with " << (int)slipBoundaryCondition->indices.size() << "\n";
@@ -96,38 +96,41 @@ void LevelGridBuilder::setVelocityBoundaryCondition(SideType sideType, real vx,
         setVelocityGeometryBoundaryCondition(vx, vy, vz);
     else
     {
-        SPtr<VelocityBoundaryCondition> velocityBoundaryCondition = VelocityBoundaryCondition::make(vx, vy, vz);
+        for (uint level = 0; level < getNumberOfGridLevels(); level++)
+        {
+            SPtr<VelocityBoundaryCondition> velocityBoundaryCondition = VelocityBoundaryCondition::make(vx, vy, vz);
 
-        auto side = SideFactory::make(sideType);
+            auto side = SideFactory::make(sideType);
 
-        velocityBoundaryCondition->side = side;
-        velocityBoundaryCondition->side->addIndices(grids, 0, velocityBoundaryCondition);
+            velocityBoundaryCondition->side = side;
+            velocityBoundaryCondition->side->addIndices(grids, level, velocityBoundaryCondition);
 
-        velocityBoundaryCondition->fillVelocityLists();
+            velocityBoundaryCondition->fillVelocityLists();
 
-        boundaryConditions[0]->velocityBoundaryConditions.push_back(velocityBoundaryCondition);
+            boundaryConditions[level]->velocityBoundaryConditions.push_back(velocityBoundaryCondition);
 
-        *logging::out << logging::Logger::INFO_INTERMEDIATE << "Set Velocity BC on level " << 0 << " with " << (int)velocityBoundaryCondition->indices.size() <<"\n";
+            *logging::out << logging::Logger::INFO_INTERMEDIATE << "Set Velocity BC on level " << level << " with " << (int)velocityBoundaryCondition->indices.size() <<"\n";
+        }
     }
 }
 
 void LevelGridBuilder::setVelocityGeometryBoundaryCondition(real vx, real vy, real vz)
 {
     geometryHasValues = true;
-    
+
     for (uint level = 0; level < getNumberOfGridLevels(); level++)
     {
-        if (boundaryConditions[level]->geometryBoundaryCondition != nullptr)
-        {
-            boundaryConditions[level]->geometryBoundaryCondition->vx = vx;
-            boundaryConditions[level]->geometryBoundaryCondition->vy = vy;
-            boundaryConditions[level]->geometryBoundaryCondition->vz = vz;
-            boundaryConditions[level]->geometryBoundaryCondition->side->addIndices(grids, level, boundaryConditions[level]->geometryBoundaryCondition);
+		if (boundaryConditions[level]->geometryBoundaryCondition != nullptr)
+		{
+			boundaryConditions[level]->geometryBoundaryCondition->vx = vx;
+			boundaryConditions[level]->geometryBoundaryCondition->vy = vy;
+			boundaryConditions[level]->geometryBoundaryCondition->vz = vz;
+			boundaryConditions[level]->geometryBoundaryCondition->side->addIndices(grids, level, boundaryConditions[level]->geometryBoundaryCondition);
 
             boundaryConditions[level]->geometryBoundaryCondition->fillVelocityLists();
 
             *logging::out << logging::Logger::INFO_INTERMEDIATE << "Set Geometry Velocity BC on level " << level << " with " << (int)boundaryConditions[level]->geometryBoundaryCondition->indices.size() <<"\n";
-        }
+		}
     }
 }
 
@@ -166,8 +169,7 @@ void LevelGridBuilder::setNoSlipBoundaryCondition(SideType sideType)
 
         noSlipBoundaryCondition->fillVelocityLists();
 
-        // effectively just a wrapper for velocityBC with zero velocity. No distinction in GridGenerator.
-        boundaryConditions[level]->velocityBoundaryConditions.push_back(noSlipBoundaryCondition);
+        boundaryConditions[level]->velocityBoundaryConditions.push_back(noSlipBoundaryCondition); //now effectively just a wrapper for velocityBC with zero velocity. No distinction in Gridgenerator.
     }
 }
 
@@ -293,7 +295,6 @@ uint LevelGridBuilder::getNumberOfNodes(unsigned int level) const
     return grids[level]->getSparseSize();
 }
 
-
 std::shared_ptr<Grid> LevelGridBuilder::getGrid(int level, int box)
 {
     return this->grids[level];
diff --git a/src/gpu/GridGenerator/grid/GridBuilder/LevelGridBuilder.h b/src/gpu/GridGenerator/grid/GridBuilder/LevelGridBuilder.h
index b4a461ec764d0a97efd83ec7f4899814fe99a489..8be699c09e7ea5f37df91a76bbd4bdeed342ce4f 100644
--- a/src/gpu/GridGenerator/grid/GridBuilder/LevelGridBuilder.h
+++ b/src/gpu/GridGenerator/grid/GridBuilder/LevelGridBuilder.h
@@ -38,11 +38,12 @@
 #include <memory>
 #include <array>
 
-#include "global.h"
+#include "gpu/GridGenerator/global.h"
 
-#include "grid/GridBuilder/GridBuilder.h"
-#include "grid/Grid.h"
-#include "grid/NodeValues.h"
+#include "gpu/GridGenerator/grid/GridBuilder/GridBuilder.h"
+#include "gpu/GridGenerator/grid/Grid.h"
+#include "gpu/GridGenerator/grid/GridInterface.h"
+#include "gpu/GridGenerator/grid/NodeValues.h"
 
 struct Vertex;
 class  Grid;
@@ -54,6 +55,7 @@ class BoundingBox;
 class Side;
 class VelocityBoundaryCondition;
 class SlipBoundaryCondition;
+class StressBoundaryCondition;
 class PressureBoundaryCondition;
 class GeometryBoundaryCondition;
 enum class SideType;
@@ -127,6 +129,8 @@ protected:
 
         std::vector<SPtr<SlipBoundaryCondition>> slipBoundaryConditions;
 
+        std::vector<SPtr<StressBoundaryCondition>> stressBoundaryConditions;
+
         std::vector<SPtr<VelocityBoundaryCondition>> velocityBoundaryConditions;
 
         std::vector<SPtr<PressureBoundaryCondition>> pressureBoundaryConditions;
diff --git a/src/gpu/GridGenerator/grid/GridBuilder/MultipleGridBuilder.cpp b/src/gpu/GridGenerator/grid/GridBuilder/MultipleGridBuilder.cpp
index c36a8cb70e6bb36dccb9179b9c014e5fb7464a30..da18a883181069f089e7232c9cd1b4f19cc9dc35 100644
--- a/src/gpu/GridGenerator/grid/GridBuilder/MultipleGridBuilder.cpp
+++ b/src/gpu/GridGenerator/grid/GridBuilder/MultipleGridBuilder.cpp
@@ -49,14 +49,14 @@
 #include "io/GridVTKWriter/GridVTKWriter.h"
 #include "io/STLReaderWriter/STLWriter.h"
 
-MultipleGridBuilder::MultipleGridBuilder() : LevelGridBuilder(), numberOfLayersFine(12), numberOfLayersBetweenLevels(8), subDomainBox(nullptr)
+MultipleGridBuilder::MultipleGridBuilder(SPtr<GridFactory> gridFactory) : LevelGridBuilder(), gridFactory(gridFactory), numberOfLayersFine(12), numberOfLayersBetweenLevels(8), subDomainBox(nullptr)
 {
 
 }
 
-SPtr<MultipleGridBuilder> MultipleGridBuilder::makeShared()
+SPtr<MultipleGridBuilder> MultipleGridBuilder::makeShared(SPtr<GridFactory> gridFactory)
 {
-    return SPtr<MultipleGridBuilder>(new MultipleGridBuilder());
+    return SPtr<MultipleGridBuilder>(new MultipleGridBuilder(gridFactory));
 }
 
 void MultipleGridBuilder::addCoarseGrid(real startX, real startY, real startZ, real endX, real endY, real endZ, real delta)
@@ -195,7 +195,7 @@ void MultipleGridBuilder::addGridToListIfValid(SPtr<Grid> grid)
 
 SPtr<Grid> MultipleGridBuilder::makeGrid(Object* gridShape, real startX, real startY, real startZ, real endX, real endY, real endZ, real delta, uint level) const
 {
-    return GridImp::makeShared(gridShape, startX, startY, startZ, endX, endY, endZ, delta, "D3Q27", level);
+    return gridFactory->makeGrid(gridShape, startX, startY, startZ, endX, endY, endZ, delta, level);
 }
 
 bool MultipleGridBuilder::coarseGridExists() const
diff --git a/src/gpu/GridGenerator/grid/GridBuilder/MultipleGridBuilder.h b/src/gpu/GridGenerator/grid/GridBuilder/MultipleGridBuilder.h
index 839e0036bbc6b0f5d28bec5da3a0abe637b7adca..9627fb0bf7e97a925d4b0ba2c450c507426a48f4 100644
--- a/src/gpu/GridGenerator/grid/GridBuilder/MultipleGridBuilder.h
+++ b/src/gpu/GridGenerator/grid/GridBuilder/MultipleGridBuilder.h
@@ -41,6 +41,7 @@
 #include "global.h"
 
 #include "grid/GridBuilder/LevelGridBuilder.h"
+#include "grid/GridFactory.h"
 #include "grid/distributions/Distribution.h"
 
 class Object;
@@ -49,10 +50,10 @@ class BoundingBox;
 class MultipleGridBuilder : public LevelGridBuilder
 {
 private:
-    GRIDGENERATOR_EXPORT MultipleGridBuilder();
+    GRIDGENERATOR_EXPORT MultipleGridBuilder(SPtr<GridFactory> gridFactory);
 
 public:
-    GRIDGENERATOR_EXPORT static SPtr<MultipleGridBuilder> makeShared();
+    GRIDGENERATOR_EXPORT static SPtr<MultipleGridBuilder> makeShared(SPtr<GridFactory> gridFactory);
 
     GRIDGENERATOR_EXPORT void addCoarseGrid(real startX, real startY, real startZ, real endX, real endY, real endZ, real delta);
     GRIDGENERATOR_EXPORT void addGrid(Object *gridShape);
@@ -103,6 +104,7 @@ private:
     static void emitNoCoarseGridExistsWarning();
     static void emitGridIsNotInCoarseGridWarning();
 
+    SPtr<GridFactory> gridFactory;
     Object *solidObject = nullptr;
 
     uint numberOfLayersFine;
diff --git a/src/gpu/GridGenerator/grid/GridFactory.h b/src/gpu/GridGenerator/grid/GridFactory.h
index b525596fa670a026d60b1297c75ef69c46b23498..53d358d5325390394f1d38694de605e5cc0d2f56 100644
--- a/src/gpu/GridGenerator/grid/GridFactory.h
+++ b/src/gpu/GridGenerator/grid/GridFactory.h
@@ -36,6 +36,7 @@
 #include "global.h"
 
 #include "geometries/Cuboid/Cuboid.h"
+#include "geometries/TriangularMesh/TriangularMeshStrategy.h"
 
 #include "grid/GridImp.h"
 
@@ -54,8 +55,33 @@ public:
 
     SPtr<Grid> makeGrid(Object* gridShape, real startX, real startY, real startZ, real endX, real endY, real endZ, real delta, uint level, const std::string& d3Qxx = "D3Q27")
     {
-        return GridImp::makeShared(gridShape, startX, startY, startZ, endX, endY, endZ, delta, d3Qxx, level);
+        SPtr<GridImp> grid;
+        
+        grid = GridImp::makeShared(gridShape, startX, startY, startZ, endX, endY, endZ, delta, d3Qxx, level);
+
+        grid->setTriangularMeshDiscretizationStrategy(new PointInObjectDiscretizationStrategy());
+
+        return grid;
+    }
+
+    void setTriangularMeshDiscretizationMethod(TriangularMeshDiscretizationMethod triangularMeshDiscretizationMethod)
+    {
+        switch (triangularMeshDiscretizationMethod)
+        {
+        case TriangularMeshDiscretizationMethod::POINT_UNDER_TRIANGLE:
+            triangularMeshDiscretizationStrategy = new PointUnderTriangleStrategy();
+            break;
+        case TriangularMeshDiscretizationMethod::RAYCASTING:
+            triangularMeshDiscretizationStrategy = new RayCastingDiscretizationStrategy();
+            break;
+        case TriangularMeshDiscretizationMethod::POINT_IN_OBJECT:
+            triangularMeshDiscretizationStrategy = new PointInObjectDiscretizationStrategy();
+            break;
+        }
     }
+
+private:
+    TriangularMeshDiscretizationStrategy* triangularMeshDiscretizationStrategy;
 };
 
 
diff --git a/src/gpu/GridGenerator/grid/GridImp.cpp b/src/gpu/GridGenerator/grid/GridImp.cpp
index 0d1a6c3472309ff030e764e4690fc8631ddcee61..66d90b82d670c1d7bb72644a1e8e19829a4e1da4 100644
--- a/src/gpu/GridGenerator/grid/GridImp.cpp
+++ b/src/gpu/GridGenerator/grid/GridImp.cpp
@@ -37,6 +37,7 @@
 #include <iostream>
 #include <omp.h>
 #include <sstream>
+# include <algorithm>
 #include <cmath>
 
 #include "global.h"
@@ -160,24 +161,24 @@ void GridImp::inital(const SPtr<Grid> fineGrid, uint numberOfLayers)
 #pragma omp parallel for
         for (int xIdx = 0; xIdx < (int)this->nx; xIdx++) {
             for (uint yIdx = 0; yIdx < this->ny; yIdx++) {
-                this->fixRefinementIntoWall(xIdx, yIdx, 0, 3);
-                this->fixRefinementIntoWall(xIdx, yIdx, this->nz - 1, -3);
+                this->fixRefinementIntoWall( xIdx, yIdx, 0           ,  3 );
+                this->fixRefinementIntoWall( xIdx, yIdx, this->nz - 1, -3 );
             }
         }
 
 #pragma omp parallel for
         for (int xIdx = 0; xIdx < (int)this->nx; xIdx++) {
             for (uint zIdx = 0; zIdx < this->nz; zIdx++) {
-                this->fixRefinementIntoWall(xIdx, 0, zIdx, 2);
-                this->fixRefinementIntoWall(xIdx, this->ny - 1, zIdx, -2);
+                this->fixRefinementIntoWall( xIdx, 0           , zIdx,  2 );
+                this->fixRefinementIntoWall( xIdx, this->ny - 1, zIdx, -2 );
             }
         }
 
 #pragma omp parallel for
         for (int yIdx = 0; yIdx < (int)this->ny; yIdx++) {
             for (uint zIdx = 0; zIdx < this->nz; zIdx++) {
-                this->fixRefinementIntoWall(0, yIdx, zIdx, 1);
-                this->fixRefinementIntoWall(this->nx - 1, yIdx, zIdx, -1);
+                this->fixRefinementIntoWall( 0           , yIdx, zIdx,  1 );
+                this->fixRefinementIntoWall( this->nx - 1, yIdx, zIdx, -1 );
             }
         }
     }
@@ -186,7 +187,7 @@ void GridImp::inital(const SPtr<Grid> fineGrid, uint numberOfLayers)
 #pragma omp parallel for
     for (int index = 0; index < (int)this->size; index++)
         this->findEndOfGridStopperNode(index);
-
+    
     *logging::out << logging::Logger::INFO_INTERMEDIATE
         << "Grid created: " << "from (" << this->startX << ", " << this->startY << ", " << this->startZ << ") to (" << this->endX << ", " << this->endY << ", " << this->endZ << ")\n"
         << "nodes: " << this->nx << " x " << this->ny << " x " << this->nz << " = " << this->size << "\n";
@@ -440,7 +441,7 @@ void GridImp::findEndOfGridStopperNode(uint index)
         else
             this->field.setFieldEntryToStopperOutOfGridBoundary(index);
     }
-
+    
 	if (isValidEndOfGridBoundaryStopper(index))
 		this->field.setFieldEntryToStopperOutOfGridBoundary(index);
 }
@@ -1167,7 +1168,7 @@ void GridImp::findInvalidBoundaryNodes(uint index)
 // --------------------------------------------------------- //
 void GridImp::mesh(Object* object)
 {
-    TriangularMesh* triangularMesh = dynamic_cast<TriangularMesh*>(object);
+    TriangularMesh *triangularMesh = dynamic_cast<TriangularMesh *>(object);
     if (triangularMesh)
         triangularMeshDiscretizationStrategy->discretize(triangularMesh, this, INVALID_SOLID, FLUID);
     else
@@ -1234,6 +1235,7 @@ void GridImp::closeNeedleCells()
     uint numberOfClosedNeedleCells = 0;
 
     do{
+        numberOfClosedNeedleCells = 0;
 #pragma omp parallel for reduction(+ : numberOfClosedNeedleCells)
         for (int index = 0; index < (int)this->size; index++) {
             if (this->closeCellIfNeedle(index))
@@ -1274,6 +1276,7 @@ void GridImp::closeNeedleCellsThinWall()
     uint numberOfClosedNeedleCells = 0;
 
     do{
+        numberOfClosedNeedleCells = 0;
 #pragma omp parallel for reduction(+ : numberOfClosedNeedleCells)
         for (int index = 0; index < (int)this->size; index++) {
             if (this->closeCellIfNeedleThinWall(index))
@@ -1457,7 +1460,6 @@ void GridImp::calculateQs(const uint index, const Vertex &point, Object* object)
                     
                 this->qPatches[ this->qIndices[index] ] = 0;
 
-				//printf("%d %f \n", this->qIndices[index], subdistance);
 			}
 		}
 	}
@@ -1657,7 +1659,7 @@ uint GridImp::getReceiveIndex(int direction, uint index)
     return this->communicationIndices[direction].receiveIndices[ index ];
 }
 
-void GridImp::repairCommunicationInices(int direction )
+void GridImp::repairCommunicationIndices(int direction)
 {
     this->communicationIndices[direction].sendIndices.insert( this->communicationIndices[direction].sendIndices.end(), 
                                                               this->communicationIndices[direction+1].sendIndices.begin(), 
@@ -1772,18 +1774,18 @@ real GridImp::getMaximumOnNodes(const real &maxExact, const real &decimalStart,
 }
 
 uint GridImp::getXIndex(real x) const 
-{
-    return std::lround((x - startX) / delta);
+{ 
+    return std::lround((x - startX) / delta); 
 }
 
 uint GridImp::getYIndex(real y) const
-{
-    return std::lround((y - startY) / delta);
+{ 
+    return std::lround((y - startY) / delta); 
 }
 
 uint GridImp::getZIndex(real z) const
-{
-	return std::lround((z - startZ) / delta);
+{ 
+    return std::lround((z - startZ) / delta); 
 }
 
 real GridImp::getDelta() const
@@ -1798,7 +1800,7 @@ uint GridImp::getSize() const
 
 uint GridImp::getSparseSize() const
 {
-    return this->sparseSize;
+    return this->sparseSize; 
 }
 
 Field GridImp::getField() const
@@ -1955,7 +1957,7 @@ void GridImp::getNodeValues(real *xCoords, real *yCoords, real *zCoords, uint *n
     geo[0] = GEOSOLID;
 
     int nodeNumber = 0;
-    for (uint i = 0; i < this->getSize(); i++)
+    for (uint i = 0; i < this->size; i++)
     {
         if (this->sparseIndices[i] == -1)
             continue;
@@ -1991,4 +1993,4 @@ void GridImp::print() const
            endX, endY, endZ, size, delta);
     if(this->gridInterface)
         this->gridInterface->print();
-}
\ No newline at end of file
+}
diff --git a/src/gpu/GridGenerator/grid/GridImp.h b/src/gpu/GridGenerator/grid/GridImp.h
index 6d6000b67d08da40349548afeb12028a0b265521..2101d5517e103fdd4fa07191cd8231bb3278d21f 100644
--- a/src/gpu/GridGenerator/grid/GridImp.h
+++ b/src/gpu/GridGenerator/grid/GridImp.h
@@ -37,12 +37,12 @@
 
 #include "Core/LbmOrGks.h"
 
-#include "global.h"
+#include "gpu/GridGenerator/global.h"
 
-#include "grid/distributions/Distribution.h"
-#include "grid/Grid.h"
-#include "grid/Cell.h"
-#include "grid/Field.h" 
+#include "gpu/GridGenerator/grid/distributions/Distribution.h"
+#include "gpu/GridGenerator/grid/Grid.h"
+#include "gpu/GridGenerator/grid/Cell.h"
+#include "gpu/GridGenerator/grid/Field.h" 
 
 class TriangularMesh;
 struct Vertex;
@@ -70,7 +70,7 @@ extern int DIRECTIONS[DIR_END_MAX][DIMENSION];
 
 class GRIDGENERATOR_EXPORT GridImp : public enableSharedFromThis<GridImp>, public Grid
 {
-private:
+protected:
     GridImp() = default;
     GridImp(Object* object, real startX, real startY, real startZ, real endX, real endY, real endZ, real delta, Distribution d, uint level);
 
@@ -126,7 +126,7 @@ private:
 
     TriangularMeshDiscretizationStrategy *triangularMeshDiscretizationStrategy;
 
-    uint numberOfSolidBoundaryNodes;
+    uint numberOfSolidBoundaryNodes = 0;
 
     bool enableFixRefinementIntoTheWall;
 
@@ -209,7 +209,7 @@ public:
     bool isNode(uint index, char type) const;
     bool nodeInNextCellIs(int index, char type) const;
     bool hasAllNeighbors(uint index) const;
-    bool hasNeighborOfType(uint index, char type)const;
+    bool hasNeighborOfType(uint index, char type) const;
     bool cellContainsOnly(Cell &cell, char type) const;
     bool cellContainsOnly(Cell &cell, char typeA, char typeB) const;
 
@@ -246,6 +246,7 @@ public:
     uint getNumberOfNodesCF() const override;
     uint getNumberOfNodesFC() const override;
     void getGridInterfaceIndices(uint *iCellCfc, uint *iCellCff, uint *iCellFcc, uint *iCellFcf) const override;
+
     static void getGridInterface(uint *gridInterfaceList, const uint *oldGridInterfaceList, uint size);
 
     int *getNeighborsX() const override;
@@ -305,7 +306,11 @@ public:
     void findQsPrimitive(Object *object);
 
 private:
-    enum class qComputationStageType { FindSolidBoundaryNodes, ComputeQs } qComputationStage;
+
+    enum class qComputationStageType{
+        FindSolidBoundaryNodes,
+        ComputeQs
+    } qComputationStage;
 
 public:
     void enableFindSolidBoundaryNodes() override
@@ -336,7 +341,7 @@ public:
     uint getSendIndex(int direction, uint index) override;
     uint getReceiveIndex(int direction, uint index) override;
 
-    void repairCommunicationInices(int direction) override;
+    void repairCommunicationIndices(int direction) override;
 
 public:
     struct CommunicationIndices {
diff --git a/src/gpu/GridGenerator/grid/GridInterface.h b/src/gpu/GridGenerator/grid/GridInterface.h
index 303d79d4995ea04fe30b2a004c5738bf9c926cf2..b5f71317e7755a8b6bcfe3da084e0fc9155642f8 100644
--- a/src/gpu/GridGenerator/grid/GridInterface.h
+++ b/src/gpu/GridGenerator/grid/GridInterface.h
@@ -33,7 +33,7 @@
 #ifndef GRID_INTERFACE_H
 #define GRID_INTERFACE_H
 
-#include "global.h"
+#include "gpu/GridGenerator/global.h"
 
 class GridImp;
 
diff --git a/src/gpu/GridGenerator/grid/distributions/Distribution.h b/src/gpu/GridGenerator/grid/distributions/Distribution.h
index abc6d8105c9daeb83f4e31478a55942f48bf5e65..7982abc235b020003526b10c885f4936bf661936 100644
--- a/src/gpu/GridGenerator/grid/distributions/Distribution.h
+++ b/src/gpu/GridGenerator/grid/distributions/Distribution.h
@@ -36,7 +36,7 @@
 #include <vector>
 #include <string>
 
-#include "global.h"
+#include "gpu/GridGenerator/global.h"
 
 #define DIR_END_MAX 27
 
diff --git a/src/gpu/GridGenerator/io/STLReaderWriter/STLReader.cpp b/src/gpu/GridGenerator/io/STLReaderWriter/STLReader.cpp
index 173f79c184c0a455ffd5b27cae59e07fa6dd4fa6..d3eb221265b2f8c79d5aece8729585733c2d60e8 100644
--- a/src/gpu/GridGenerator/io/STLReaderWriter/STLReader.cpp
+++ b/src/gpu/GridGenerator/io/STLReaderWriter/STLReader.cpp
@@ -118,7 +118,7 @@ std::vector<Triangle> STLReader::readASCIISTLWithPatches(const std::string& name
     std::ifstream file;
     file.open(name.c_str(), std::ifstream::in);
 
-    if( !file.is_open() ) throw std::runtime_error(name + "cannot be opened!");
+    if( !file.is_open() ) throw std::runtime_error(name + " cannot be opened!");
 
     uint currentPatchIndex = 0;
 
diff --git a/src/gpu/GridGenerator/io/SimulationFileWriter/SimulationFileWriter.h b/src/gpu/GridGenerator/io/SimulationFileWriter/SimulationFileWriter.h
index d5d2a377b33697704b86f8b78987fd0af75be415..4a4552f74b69949865e233014d74ac7168b36b31 100644
--- a/src/gpu/GridGenerator/io/SimulationFileWriter/SimulationFileWriter.h
+++ b/src/gpu/GridGenerator/io/SimulationFileWriter/SimulationFileWriter.h
@@ -42,7 +42,7 @@
 
 #include "Core/NonCreatable.h"
 
-#include "global.h"
+#include "gpu/GridGenerator/global.h"
 
 class UnstructuredGridBuilder;
 class GridBuilder;