From 0f6f6c1ec80f60285a18fd580d78ee1002b67b49 Mon Sep 17 00:00:00 2001
From: Tomas Oberhuber <tomas.oberhuber@fjfi.cvut.cz>
Date: Mon, 28 Jul 2014 20:27:51 +0200
Subject: [PATCH] Implementing the grid traversal.

---
 src/mesh/CMakeLists.txt     |  3 +-
 src/mesh/tnlGridTraversal.h | 91 +++++++++++++++++++++++++++++++++++++
 src/mesh/tnlTraversal.h     | 24 ++++++++++
 3 files changed, 117 insertions(+), 1 deletion(-)
 create mode 100644 src/mesh/tnlGridTraversal.h
 create mode 100644 src/mesh/tnlTraversal.h

diff --git a/src/mesh/CMakeLists.txt b/src/mesh/CMakeLists.txt
index f4a30c311c..8574d3d014 100755
--- a/src/mesh/CMakeLists.txt
+++ b/src/mesh/CMakeLists.txt
@@ -14,6 +14,7 @@ SET( headers tnlGrid.h
              tnlMeshWriterNetgen.h
              tnlMeshInitializer.h
              tnlMeshEntityInitializer.h
-             tnlMeshSuperentityInitializerLayer.h )
+             tnlMeshSuperentityInitializerLayer.h
+             tnlTraversal.h )
 
 INSTALL( FILES ${headers} DESTINATION include/tnl-${tnlVersion}/mesh )
\ No newline at end of file
diff --git a/src/mesh/tnlGridTraversal.h b/src/mesh/tnlGridTraversal.h
new file mode 100644
index 0000000000..e694ddb662
--- /dev/null
+++ b/src/mesh/tnlGridTraversal.h
@@ -0,0 +1,91 @@
+/***************************************************************************
+                          tnlGridTraversal.h  -  description
+                             -------------------
+    begin                : Jul 28, 2014
+    copyright            : (C) 2014 by Tomas Oberhuber
+    email                : tomas.oberhuber@fjfi.cvut.cz
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#ifndef TNLGRIDTRAVERSAL_H_
+#define TNLGRIDTRAVERSAL_H_
+
+#include <mesh/tnlTraversal.h>
+
+template< typename Real,
+          typename Index,
+          typename UserData >
+class tnlTraversal< tnlGrid< 1, Real, tnlHost, Index >, UserData >
+{
+   public:
+      typedef tnlGrid< 1, Real, tnlHost, Index > GridType;
+      typedef Real RealType;
+      typedef tnlHost DeviceType;
+      typedef Index IndexType;
+      typedef UserData UserDataType;
+
+      static void processBoundaryCells( const GridType& grid,
+                                        const UserDataType& userData );
+
+      static void processInteriorCells( const GridType& grid,
+                                        const UserDataType& userData );
+
+      static void processAllCells( const GridType& grid,
+                                   const UserDataType& userData );
+
+      static void processBoundaryVertices( const GridType& grid,
+                                           const UserDataType& userData );
+
+      static void processInteriorVertices( const GridType& grid,
+                                           const UserDataType& userData );
+
+      static void processAllVertices( const GridType& grid,
+                                      const UserDataType& userData );
+
+};
+
+template< typename Real,
+          typename Index,
+          typename UserData >
+class tnlTraversal< tnlGrid< 1, Real, tnlCuda, Index >, UserData >
+{
+   public:
+      typedef tnlGrid< 1, Real, tnlCuda, Index > GridType;
+      typedef Real RealType;
+      typedef tnlCuda DeviceType;
+      typedef Index IndexType;
+      typedef UserData UserDataType;
+
+      static void processBoundaryCells( const GridType& grid,
+                                        const UserDataType& userData );
+
+      static void processInteriorCells( const GridType& grid,
+                                        const UserDataType& userData );
+
+      static void processAllCells( const GridType& grid,
+                                   const UserDataType& userData );
+
+      static void processBoundaryVertices( const GridType& grid,
+                                           const UserDataType& userData );
+
+      static void processInteriorVertices( const GridType& grid,
+                                           const UserDataType& userData );
+
+      static void processAllVertices( const GridType& grid,
+                                      const UserDataType& userData );
+
+};
+
+
+
+
+
+#endif /* TNLGRIDTRAVERSAL_H_ */
diff --git a/src/mesh/tnlTraversal.h b/src/mesh/tnlTraversal.h
new file mode 100644
index 0000000000..2bd33dffcd
--- /dev/null
+++ b/src/mesh/tnlTraversal.h
@@ -0,0 +1,24 @@
+/***************************************************************************
+                          tnlTraversal.h  -  description
+                             -------------------
+    begin                : Jul 28, 2014
+    copyright            : (C) 2014 by Tomas Oberhuber
+    email                : tomas.oberhuber@fjfi.cvut.cz
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#ifndef TNLTRAVERSAL_H_
+#define TNLTRAVERSAL_H_
+
+
+
+
+#endif /* TNLTRAVERSAL_H_ */
-- 
GitLab