diff --git a/TODO b/TODO
index c8ed457124545ba0f48fc89c85a1777e92ca1339..722ebeee7cf2948882a693c919b7dd818dd53794 100644
--- a/TODO
+++ b/TODO
@@ -1,3 +1,30 @@
+tnlLinearSystemAssembler< Mesh,
+                             DofVectorType,
+                             DifferentialOperator,
+                             BoundaryCondition,
+                             RightHandSide,
+                             tnlBackwardTimeDiscretisation,
+                             Matrix > systemAssembler;
+   systemAssembler
+
+tnlLinearDiffusion - je v i heat equation 
+tnlAnalyticNeumannBoundaryConditions - nastavi neumanna na kraji jako template bude funkce tnlConstantFunction
+tnlNoTimeDiscretization - nedela nic s pravou stranou a nemeni diagonalu
+
+jako pravou stranu pouzit opet tnlConstantFunction
+
+Pouzivej EllPack!!!
+
+
+2) Zatim resit se SOR, ale pak zkusit udelat Jacobiho
+bool tnlSORSolver< Matrix, Preconditioner > :: solve( const Vector& b, v podstate je treba zmenit jen matrix->performSORIteration na nejakou vlastni 
+bool tnlEllpackMatrix< Real, Device, Index > :: performSORIteration( 
+
+
+
+
+
+
 TODO: v tnlMeshResolver se provadi preklad pro vsechny mozne sablonove parametry => prorezat
 
 TODO: napsat FunctionDiscretizer pro jednotne rozhrani RightHandSide
diff --git a/examples/navier-stokes/Makefile b/examples/navier-stokes/Makefile
index 74b3704811f789139e39f6247e0248030af857e5..431ffe1406a4418d82c6994cacbeae7a4a602315 100644
--- a/examples/navier-stokes/Makefile
+++ b/examples/navier-stokes/Makefile
@@ -1,65 +1,203 @@
-TNL_VERSION=0.1
-TNL_INSTALL_DIR=${HOME}/local/lib
-TNL_INCLUDE_DIR=${HOME}/local/include/tnl-${TNL_VERSION}
-#TNL_INCLUDE_DIR=${HOME}/workspace/tnl/src
-
-TARGET = navier-stokes
-CONFIG_FILE = $(TARGET).cfg.desc
-INSTALL_DIR = ${HOME}/local
-CXX = g++
-CUDA_CXX = nvcc
-#OMP_FLAGS = -DHAVE_OPENMP -fopenmp 
-CXX_FLAGS = -std=gnu++0x -I$(TNL_INCLUDE_DIR) -O0 -g -DDEBUG $(OMP_FLAGS) -DTEMPLATE_EXPLICIT_INSTANTIATION
-#CXX_FLAGS = -std=gnu++0x -I$(TNL_INCLUDE_DIR) -O3 $(OMP_FLAGS) -DTEMPLATE_EXPLICIT_INSTANTIATION
-#CXX_FLAGS = -std=gnu++0x -I$(TNL_INCLUDE_DIR) -O3 $(OMP_FLAGS) -pg -DTEMPLATE_EXPLICIT_INSTANTIATION
-#CXX_FLAGS = -DHAVE_NOT_CXX11 -I$(TNL_INCLUDE_DIR) -O3 $(OMP_FLAGS) -DTEMPLATE_EXPLICIT_INSTANTIATION
-
-
-#LD_FLAGS = -L$(TNL_INSTALL_DIR) -ltnl-0.1 -lgomp
-LD_FLAGS = -L$(TNL_INSTALL_DIR) -ltnl-dbg-0.1 -lgomp
-
-SOURCES = main.cpp
-HEADERS = navierStokesSetter.h \
-          navierStokesSetter_impl.h \
-          navierStokesSolver.h \
-          navierStokesSolver_impl.h \
-          navierStokesSolverMonitor.h \
-          navierStokesSolverMonitor_impl.h          
-OBJECTS = main.o
-DIST = $(SOURCES) $(HEADERS) $(CONFIG_FILE) Makefile
-
-all: $(TARGET)
-
-clean: 
-	rm -f $(OBJECTS)
-	rm -f $(TARGET)-conf.h	
-
-dist: $(DIST)
-	tar zcvf $(TARGET).tgz $(DIST) 
-
-install: $(TARGET)
-	cp $(TARGET) $(INSTALL_DIR)/bin
-	cp $(CONFIG_FILE) $(INSTALL_DIR)/share
-	mkdir -p $(INSTALL_DIR)/share/$(TARGET)
-	cp -rv share/* $(INSTALL_DIR)/share/$(TARGET)
-	cp make-png-from-gnuplot $(INSTALL_DIR)/bin
-	cp merge-figures $(INSTALL_DIR)/bin
-	chmod +x $(INSTALL_DIR)/bin/make-png-from-gnuplot
-	chmod +x $(INSTALL_DIR)/bin/merge-figures
-
-uninstall: $(TARGET)
-	rm -f $(INSTALL_DIR)/bin/$(TARGET) 
-	rm -f $(CONFIG_FILE) $(INSTALL_DIR)/share
-	rm -rf $(INSTALL_DIR)/share/$(TARGET)
-	rm -rf $(INSTALL_DIR)/bin/make-png-from-gnuplot
-	rm -rf $(INSTALL_DIR)/bin/merge-figures	
-
-$(TARGET): $(TARGET)-conf.h $(OBJECTS)
-	$(CXX) -o $(TARGET) $(OBJECTS) $(LD_FLAGS)
-
-%.o: %.cpp  $(HEADERS)
-	$(CXX) -c -o $@ $(CXX_FLAGS) $<
-
-$(TARGET)-conf.h:
-	echo "#define CONFIG_FILE \"${INSTALL_DIR}/share/${CONFIG_FILE}\" " > $(TARGET)-conf.h 
-
+# CMAKE generated file: DO NOT EDIT!
+# Generated by "Unix Makefiles" Generator, CMake Version 3.2
+
+# Default target executed when no arguments are given to make.
+default_target: all
+.PHONY : default_target
+
+# Allow only one "make -f Makefile2" at a time, but pass parallelism.
+.NOTPARALLEL:
+
+#=============================================================================
+# Special targets provided by cmake.
+
+# Disable implicit rules so canonical targets will work.
+.SUFFIXES:
+
+# Remove some rules from gmake that .SUFFIXES does not remove.
+SUFFIXES =
+
+.SUFFIXES: .hpux_make_needs_suffix_list
+
+# Suppress display of executed commands.
+$(VERBOSE).SILENT:
+
+# A target that is always out of date.
+cmake_force:
+.PHONY : cmake_force
+
+#=============================================================================
+# Set environment variables for the build.
+
+# The shell in which to execute make rules.
+SHELL = /bin/sh
+
+# The CMake executable.
+CMAKE_COMMAND = /usr/bin/cmake
+
+# The command to remove a file.
+RM = /usr/bin/cmake -E remove -f
+
+# Escaping for special characters.
+EQUALS = =
+
+# The top-level source directory on which CMake was run.
+CMAKE_SOURCE_DIR = /home/klement/Documents/tnl
+
+# The top-level build directory on which CMake was run.
+CMAKE_BINARY_DIR = /home/klement/Documents/tnl
+
+#=============================================================================
+# Targets provided globally by CMake.
+
+# Special rule for the target install/strip
+install/strip: preinstall
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
+	/usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
+.PHONY : install/strip
+
+# Special rule for the target install/strip
+install/strip/fast: install/strip
+.PHONY : install/strip/fast
+
+# Special rule for the target edit_cache
+edit_cache:
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..."
+	/usr/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available.
+.PHONY : edit_cache
+
+# Special rule for the target edit_cache
+edit_cache/fast: edit_cache
+.PHONY : edit_cache/fast
+
+# Special rule for the target rebuild_cache
+rebuild_cache:
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
+	/usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
+.PHONY : rebuild_cache
+
+# Special rule for the target rebuild_cache
+rebuild_cache/fast: rebuild_cache
+.PHONY : rebuild_cache/fast
+
+# Special rule for the target install
+install: preinstall
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
+	/usr/bin/cmake -P cmake_install.cmake
+.PHONY : install
+
+# Special rule for the target install
+install/fast: preinstall/fast
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
+	/usr/bin/cmake -P cmake_install.cmake
+.PHONY : install/fast
+
+# Special rule for the target list_install_components
+list_install_components:
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\""
+.PHONY : list_install_components
+
+# Special rule for the target list_install_components
+list_install_components/fast: list_install_components
+.PHONY : list_install_components/fast
+
+# Special rule for the target package
+package: preinstall
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Run CPack packaging tool..."
+	cd /home/klement/Documents/tnl && /usr/bin/cpack --config ./CPackConfig.cmake
+.PHONY : package
+
+# Special rule for the target package
+package/fast: package
+.PHONY : package/fast
+
+# Special rule for the target test
+test:
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running tests..."
+	/usr/bin/ctest --force-new-ctest-process $(ARGS)
+.PHONY : test
+
+# Special rule for the target test
+test/fast: test
+.PHONY : test/fast
+
+# Special rule for the target package_source
+package_source:
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Run CPack packaging tool for source..."
+	cd /home/klement/Documents/tnl && /usr/bin/cpack --config ./CPackSourceConfig.cmake /home/klement/Documents/tnl/CPackSourceConfig.cmake
+.PHONY : package_source
+
+# Special rule for the target package_source
+package_source/fast: package_source
+.PHONY : package_source/fast
+
+# Special rule for the target install/local
+install/local: preinstall
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
+	/usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
+.PHONY : install/local
+
+# Special rule for the target install/local
+install/local/fast: install/local
+.PHONY : install/local/fast
+
+# The main all target
+all: cmake_check_build_system
+	cd /home/klement/Documents/tnl && $(CMAKE_COMMAND) -E cmake_progress_start /home/klement/Documents/tnl/CMakeFiles /home/klement/Documents/tnl/examples/navier-stokes/CMakeFiles/progress.marks
+	cd /home/klement/Documents/tnl && $(MAKE) -f CMakeFiles/Makefile2 examples/navier-stokes/all
+	$(CMAKE_COMMAND) -E cmake_progress_start /home/klement/Documents/tnl/CMakeFiles 0
+.PHONY : all
+
+# The main clean target
+clean:
+	cd /home/klement/Documents/tnl && $(MAKE) -f CMakeFiles/Makefile2 examples/navier-stokes/clean
+.PHONY : clean
+
+# The main clean target
+clean/fast: clean
+.PHONY : clean/fast
+
+# Prepare targets for installation.
+preinstall: all
+	cd /home/klement/Documents/tnl && $(MAKE) -f CMakeFiles/Makefile2 examples/navier-stokes/preinstall
+.PHONY : preinstall
+
+# Prepare targets for installation.
+preinstall/fast:
+	cd /home/klement/Documents/tnl && $(MAKE) -f CMakeFiles/Makefile2 examples/navier-stokes/preinstall
+.PHONY : preinstall/fast
+
+# clear depends
+depend:
+	cd /home/klement/Documents/tnl && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
+.PHONY : depend
+
+# Help Target
+help:
+	@echo "The following are some of the valid targets for this Makefile:"
+	@echo "... all (the default if no target is provided)"
+	@echo "... clean"
+	@echo "... depend"
+	@echo "... install/strip"
+	@echo "... edit_cache"
+	@echo "... rebuild_cache"
+	@echo "... install"
+	@echo "... list_install_components"
+	@echo "... package"
+	@echo "... test"
+	@echo "... package_source"
+	@echo "... install/local"
+.PHONY : help
+
+
+
+#=============================================================================
+# Special targets to cleanup operation of make.
+
+# Special rule to run CMake to check the build system integrity.
+# No rule that depends on this can have commands that come from listfiles
+# because they might be regenerated.
+cmake_check_build_system:
+	cd /home/klement/Documents/tnl && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
+.PHONY : cmake_check_build_system
+
diff --git a/src/functors/CMakeLists.txt b/src/functors/CMakeLists.txt
index 8b8dae1c5b86e9a3753a7e0003d1c657a1f3ce30..d79266762444dc13d14a8f8cd419a488150c4c74 100755
--- a/src/functors/CMakeLists.txt
+++ b/src/functors/CMakeLists.txt
@@ -16,8 +16,13 @@ SET( headers tnlFunctionDiscretizer.h
              tnlTestFunction_impl.h )
 
 SET( CURRENT_DIR ${CMAKE_SOURCE_DIR}/src/functors )
+set (headers_full_path)
+foreach(l ${headers})
+	list(APPEND headers_full_path ${CURRENT_DIR}/${l} )
+endforeach()
+
 set( common_SOURCES
-     ${CURRENT_DIR}/tnlTestFunction_impl.cpp )       
+     ${CURRENT_DIR}/tnlTestFunction_impl.cpp ${headers_full_path})       
 
 IF( BUILD_CUDA )
    set( tnl_functors_CUDA__SOURCES
@@ -30,4 +35,5 @@ set( tnl_functors_SOURCES
      ${common_SOURCES}
      PARENT_SCOPE )
         
-INSTALL( FILES ${headers} DESTINATION include/tnl-${tnlVersion}/functors )
\ No newline at end of file
+INSTALL( FILES ${headers} DESTINATION include/tnl-${tnlVersion}/functors )
+source_group("functors" FILES ${headers})
\ No newline at end of file
diff --git a/src/matrices/CMakeLists.txt b/src/matrices/CMakeLists.txt
index 58591b19776e1e61fac9171713a1fe8c2fcecec9..ca1ded0f00f0a516d9ccd30a67f6e864572239fe 100755
--- a/src/matrices/CMakeLists.txt
+++ b/src/matrices/CMakeLists.txt
@@ -46,4 +46,5 @@ if( BUILD_CUDA )
         PARENT_SCOPE )
 endif()
 
-INSTALL( FILES ${headers} DESTINATION include/tnl-${tnlVersion}/matrices )
\ No newline at end of file
+INSTALL( FILES ${headers} DESTINATION include/tnl-${tnlVersion}/matrices )
+source_group("matrices" FILES ${headers})
\ No newline at end of file
diff --git a/src/mesh/tnlGrid1D.h b/src/mesh/tnlGrid1D.h
index 5c6ebf15478ee01c3814d121556ee0f1bc107e29..6f171e48ee05eb7954836a922f5270f4215c32a4 100644
--- a/src/mesh/tnlGrid1D.h
+++ b/src/mesh/tnlGrid1D.h
@@ -49,78 +49,50 @@ class tnlGrid< 1, Real, Device, Index > : public tnlObject
 
    void setDimensions( const CoordinatesType& dimensions );
 
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+   __cuda_callable__
    const CoordinatesType& getDimensions() const;
 
    void setDomain( const VertexType& origin,
                    const VertexType& proportions );
 
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+   __cuda_callable__
    const VertexType& getOrigin() const;
 
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+   __cuda_callable__
    const VertexType& getProportions() const;
 
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+   __cuda_callable__
    const VertexType& getCellProportions() const;
 
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+   __cuda_callable__
    Index getCellIndex( const CoordinatesType& cellCoordinates ) const;
 
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+   __cuda_callable__
    CoordinatesType getCellCoordinates( const Index cellIndex ) const;
 
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+   __cuda_callable__
    Index getVertexIndex( const CoordinatesType& vertexCoordinates ) const;
 
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+   __cuda_callable__
    CoordinatesType getVertexCoordinates( const Index vertexCoordinates ) const;
 
    template< int dx >
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+   __cuda_callable__
    IndexType getCellNextToCell( const IndexType& cellIndex ) const;
 
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+   __cuda_callable__
    const RealType& getHx() const;
 
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+   __cuda_callable__
    const RealType& getHxSquare() const;
 
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+   __cuda_callable__
    const RealType& getHxInverse() const;
 
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+   __cuda_callable__
    const RealType& getHxSquareInverse() const;
 
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+   __cuda_callable__
    RealType getSmallestSpaceStep() const;
 
    /****
@@ -131,9 +103,7 @@ class tnlGrid< 1, Real, Device, Index > : public tnlObject
 #else
    template< typename Vertex = VertexType >
 #endif
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+   __cuda_callable__
    Vertex getCellCenter( const CoordinatesType& cellCoordinates ) const;
 
 #ifdef HAVE_NOT_CXX11
@@ -141,9 +111,7 @@ class tnlGrid< 1, Real, Device, Index > : public tnlObject
 #else
    template< typename Vertex = VertexType >
 #endif
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+   __cuda_callable__
    Vertex getCellCenter( const IndexType& cellIndex ) const;
 
 #ifdef HAVE_NOT_CXX11
@@ -151,39 +119,25 @@ class tnlGrid< 1, Real, Device, Index > : public tnlObject
 #else
    template< typename Vertex = VertexType >
 #endif
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+   __cuda_callable__
    Vertex getVertex( const CoordinatesType& vertexCoordinates ) const;
 
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+   __cuda_callable__
    Index getNumberOfCells() const;
 
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+   __cuda_callable__
    Index getNumberOfFaces() const;
 
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+   __cuda_callable__
    Index getNumberOfVertices() const;
 
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+   __cuda_callable__
    bool isBoundaryCell( const CoordinatesType& cellCoordinates ) const;
 
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+   __cuda_callable__
    bool isBoundaryCell( const IndexType& cellIndex ) const;
 
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+   __cuda_callable__
    bool isBoundaryVertex( const CoordinatesType& vertexCoordinates ) const;
 
    template< typename GridFunction >
diff --git a/src/mesh/tnlGrid1D_impl.h b/src/mesh/tnlGrid1D_impl.h
index f572bfd533ce17b1a5d267b2f9aeb38b9ca8d3f9..ae4cdf3923773ee46ebfc024b6ca354bb4fa6a05 100644
--- a/src/mesh/tnlGrid1D_impl.h
+++ b/src/mesh/tnlGrid1D_impl.h
@@ -109,9 +109,7 @@ void tnlGrid< 1, Real, Device, Index > :: setDimensions( const CoordinatesType&
 template< typename Real,
           typename Device,
           typename Index  >
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+__cuda_callable__
 const typename tnlGrid< 1, Real, Device, Index >::CoordinatesType&
    tnlGrid< 1, Real, Device, Index > :: getDimensions() const
 {
@@ -132,9 +130,7 @@ void tnlGrid< 1, Real, Device, Index > :: setDomain( const VertexType& origin,
 template< typename Real,
           typename Device,
           typename Index  >
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+__cuda_callable__
 const typename tnlGrid< 1, Real, Device, Index > :: VertexType& 
   tnlGrid< 1, Real, Device, Index > :: getOrigin() const
 {
@@ -144,9 +140,7 @@ const typename tnlGrid< 1, Real, Device, Index > :: VertexType&
 template< typename Real,
           typename Device,
           typename Index >
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+__cuda_callable__
 const typename tnlGrid< 1, Real, Device, Index > :: VertexType& 
    tnlGrid< 1, Real, Device, Index > :: getProportions() const
 {
@@ -156,9 +150,7 @@ const typename tnlGrid< 1, Real, Device, Index > :: VertexType&
 template< typename Real,
           typename Device,
           typename Index >
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+__cuda_callable__
 const typename tnlGrid< 1, Real, Device, Index > :: VertexType& 
    tnlGrid< 1, Real, Device, Index > :: getCellProportions() const
 {
@@ -168,9 +160,7 @@ const typename tnlGrid< 1, Real, Device, Index > :: VertexType&
 template< typename Real,
           typename Device,
           typename Index >
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+__cuda_callable__
 Index tnlGrid< 1, Real, Device, Index > :: getCellIndex( const CoordinatesType& cellCoordinates ) const
 {
    tnlAssert( cellCoordinates.x() >= 0 && cellCoordinates.x() < this->getDimensions().x(),
@@ -183,9 +173,7 @@ Index tnlGrid< 1, Real, Device, Index > :: getCellIndex( const CoordinatesType&
 template< typename Real,
           typename Device,
           typename Index >
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+__cuda_callable__
 typename tnlGrid< 1, Real, Device, Index > :: CoordinatesType
 tnlGrid< 1, Real, Device, Index > :: getCellCoordinates( const Index cellIndex ) const
 {
@@ -199,9 +187,7 @@ tnlGrid< 1, Real, Device, Index > :: getCellCoordinates( const Index cellIndex )
 template< typename Real,
           typename Device,
           typename Index >
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+__cuda_callable__
 Index tnlGrid< 1, Real, Device, Index > :: getVertexIndex( const CoordinatesType& vertexCoordinates ) const
 {
    tnlAssert( vertexCoordinates.x() >= 0 && vertexCoordinates.x() < this->getDimensions().x() + 1,
@@ -214,9 +200,7 @@ Index tnlGrid< 1, Real, Device, Index > :: getVertexIndex( const CoordinatesType
 template< typename Real,
           typename Device,
           typename Index >
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+__cuda_callable__
 typename tnlGrid< 1, Real, Device, Index > :: CoordinatesType
 tnlGrid< 1, Real, Device, Index > :: getVertexCoordinates( const Index vertexIndex ) const
 {
@@ -231,9 +215,7 @@ template< typename Real,
           typename Device,
           typename Index >
    template< int dx >
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+__cuda_callable__
 Index tnlGrid< 1, Real, Device, Index > :: getCellNextToCell( const IndexType& cellIndex ) const
 {
    tnlAssert( cellIndex + dx >= 0 &&
@@ -248,9 +230,7 @@ Index tnlGrid< 1, Real, Device, Index > :: getCellNextToCell( const IndexType& c
 template< typename Real,
           typename Device,
           typename Index >
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+__cuda_callable__
 const Real& tnlGrid< 1, Real, Device, Index > :: getHx() const
 {
    return this->hx;
@@ -259,9 +239,7 @@ const Real& tnlGrid< 1, Real, Device, Index > :: getHx() const
 template< typename Real,
           typename Device,
           typename Index >
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+__cuda_callable__
 const Real& tnlGrid< 1, Real, Device, Index > :: getHxSquare() const
 {
    return this->hxSquare;
@@ -270,9 +248,7 @@ const Real& tnlGrid< 1, Real, Device, Index > :: getHxSquare() const
 template< typename Real,
           typename Device,
           typename Index >
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+__cuda_callable__
 const Real& tnlGrid< 1, Real, Device, Index > :: getHxInverse() const
 {
    return this->hxInverse;
@@ -281,9 +257,7 @@ const Real& tnlGrid< 1, Real, Device, Index > :: getHxInverse() const
 template< typename Real,
           typename Device,
           typename Index >
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+__cuda_callable__
 const Real& tnlGrid< 1, Real, Device, Index > :: getHxSquareInverse() const
 {
    return this->hxSquareInverse;
@@ -292,9 +266,7 @@ const Real& tnlGrid< 1, Real, Device, Index > :: getHxSquareInverse() const
 template< typename Real,
           typename Device,
           typename Index >
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+__cuda_callable__
 Real tnlGrid< 1, Real, Device, Index > :: getSmallestSpaceStep() const
 {
    return this->hx;
@@ -304,9 +276,7 @@ template< typename Real,
           typename Device,
           typename Index >
    template< typename Vertex >
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+__cuda_callable__
 Vertex tnlGrid< 1, Real, Device, Index >::getCellCenter( const CoordinatesType& cellCoordinates ) const
 {
    tnlAssert( cellCoordinates.x() >= 0 && cellCoordinates.x() < this->getDimensions().x(),
@@ -320,9 +290,7 @@ template< typename Real,
           typename Device,
           typename Index >
    template< typename Vertex >
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+__cuda_callable__
 Vertex tnlGrid< 1, Real, Device, Index >::getCellCenter( const IndexType& cellIndex ) const
 {
    tnlAssert( cellIndex >= 0 && cellIndex < this->getNumberOfCells(),
@@ -336,9 +304,7 @@ template< typename Real,
           typename Device,
           typename Index >
    template< typename Vertex >
-#ifdef HAVE_CUDA
-__device__ __host__
-#endif
+__cuda_callable__
 Vertex tnlGrid< 1, Real, Device, Index >::getVertex( const CoordinatesType& vertexCoordinates ) const
 {
    tnlAssert( vertexCoordinates.x() >= 0 && vertexCoordinates.x() < this->getDimensions().x() + 1,
@@ -351,9 +317,7 @@ Vertex tnlGrid< 1, Real, Device, Index >::getVertex( const CoordinatesType& vert
 template< typename Real,
           typename Device,
           typename Index >
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+__cuda_callable__
 Index tnlGrid< 1, Real, Device, Index > :: getNumberOfCells() const
 {
    return this->numberOfCells;
@@ -362,9 +326,7 @@ Index tnlGrid< 1, Real, Device, Index > :: getNumberOfCells() const
 template< typename Real,
           typename Device,
           typename Index >
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+__cuda_callable__
 Index tnlGrid< 1, Real, Device, Index > :: getNumberOfFaces() const
 {
    return this->numberOfVertices;
@@ -373,9 +335,7 @@ Index tnlGrid< 1, Real, Device, Index > :: getNumberOfFaces() const
 template< typename Real,
           typename Device,
           typename Index >
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+__cuda_callable__
 Index tnlGrid< 1, Real, Device, Index > :: getNumberOfVertices() const
 {
    return this->numberOfVertices;
@@ -384,9 +344,7 @@ Index tnlGrid< 1, Real, Device, Index > :: getNumberOfVertices() const
 template< typename Real,
           typename Device,
           typename Index >
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+__cuda_callable__
 bool tnlGrid< 1, Real, Device, Index > :: isBoundaryCell( const CoordinatesType& cellCoordinates ) const
 {
    tnlAssert( cellCoordinates.x() >= 0 && cellCoordinates.x() < this->getDimensions().x(),
@@ -401,9 +359,7 @@ bool tnlGrid< 1, Real, Device, Index > :: isBoundaryCell( const CoordinatesType&
 template< typename Real,
           typename Device,
           typename Index >
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+__cuda_callable__
 bool
 tnlGrid< 1, Real, Device, Index >::
 isBoundaryCell( const IndexType& cellIndex ) const
@@ -418,9 +374,7 @@ isBoundaryCell( const IndexType& cellIndex ) const
 template< typename Real,
           typename Device,
           typename Index >
-#ifdef HAVE_CUDA
-   __device__ __host__
-#endif
+__cuda_callable__
 bool tnlGrid< 1, Real, Device, Index > :: isBoundaryVertex( const CoordinatesType& vertexCoordinates ) const
 {
    tnlAssert( vertexCoordinates.x() >= 0 && vertexCoordinates.x() < this->getDimensions().x() + 1,
diff --git a/src/problems/CMakeLists.txt b/src/problems/CMakeLists.txt
index f64f63997d219f8e70f1e07452525e606dad70e5..80792ecc3db73edfca70f13c6c8eab17ece4de50 100755
--- a/src/problems/CMakeLists.txt
+++ b/src/problems/CMakeLists.txt
@@ -9,3 +9,4 @@ SET( headers tnlProblem.h
    )
    
 INSTALL( FILES ${headers} DESTINATION include/tnl-${tnlVersion}/problems )
+source_group("problems" FILES ${headers})
\ No newline at end of file
diff --git a/src/problems/tnlPDEProblem.h b/src/problems/tnlPDEProblem.h
index 7be3d7f0a161a2c0a7295961c73c4d94bad6bb16..11f4600fb75b7f86da125015e8653ddd825d4016 100644
--- a/src/problems/tnlPDEProblem.h
+++ b/src/problems/tnlPDEProblem.h
@@ -20,6 +20,7 @@
 
 #include <problems/tnlProblem.h>
 #include <matrices/tnlCSRMatrix.h>
+#include <mesh/tnlGrid2D.h>
 
 template< typename Mesh,
           typename Real = typename Mesh::RealType,
@@ -34,7 +35,8 @@ class tnlPDEProblem : public tnlProblem< Real, Device, Index >
       using typename BaseType::DeviceType;
       using typename BaseType::IndexType;
 
-      typedef Mesh MeshType;
+	  //typedef tnlGrid<2,double, tnlHost, int> MeshType;
+	  typedef Mesh MeshType;
       typedef tnlVector< RealType, DeviceType, IndexType> DofVectorType;
       typedef tnlCSRMatrix< RealType, DeviceType, IndexType > MatrixType;
       typedef tnlVector< RealType, DeviceType, IndexType > MeshDependentDataType;
diff --git a/tools/Makefile b/tools/Makefile
index 8ee664bd980ab5a7eadb2863ac28e524670c12a8..44daa8c06d74d6177fab836fe5473fdb87c72fed 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -1,14 +1,17 @@
 # CMAKE generated file: DO NOT EDIT!
-# Generated by "Unix Makefiles" Generator, CMake Version 2.8
+# Generated by "Unix Makefiles" Generator, CMake Version 3.2
 
 # Default target executed when no arguments are given to make.
 default_target: all
 .PHONY : default_target
 
+# Allow only one "make -f Makefile2" at a time, but pass parallelism.
+.NOTPARALLEL:
+
 #=============================================================================
 # Special targets provided by cmake.
 
-# Disable implicit rules so canoncical targets will work.
+# Disable implicit rules so canonical targets will work.
 .SUFFIXES:
 
 # Remove some rules from gmake that .SUFFIXES does not remove.
@@ -35,25 +38,48 @@ CMAKE_COMMAND = /usr/bin/cmake
 # The command to remove a file.
 RM = /usr/bin/cmake -E remove -f
 
+# Escaping for special characters.
+EQUALS = =
+
 # The top-level source directory on which CMake was run.
-CMAKE_SOURCE_DIR = /home/oberhuber/workspace/tnl
+CMAKE_SOURCE_DIR = /home/klement/Documents/tnl
 
 # The top-level build directory on which CMake was run.
-CMAKE_BINARY_DIR = /home/oberhuber/workspace/tnl
+CMAKE_BINARY_DIR = /home/klement/Documents/tnl
 
 #=============================================================================
 # Targets provided globally by CMake.
 
+# Special rule for the target install/strip
+install/strip: preinstall
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
+	/usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
+.PHONY : install/strip
+
+# Special rule for the target install/strip
+install/strip/fast: install/strip
+.PHONY : install/strip/fast
+
 # Special rule for the target edit_cache
 edit_cache:
-	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running interactive CMake command-line interface..."
-	/usr/bin/cmake -i .
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..."
+	/usr/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available.
 .PHONY : edit_cache
 
 # Special rule for the target edit_cache
 edit_cache/fast: edit_cache
 .PHONY : edit_cache/fast
 
+# Special rule for the target rebuild_cache
+rebuild_cache:
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
+	/usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
+.PHONY : rebuild_cache
+
+# Special rule for the target rebuild_cache
+rebuild_cache/fast: rebuild_cache
+.PHONY : rebuild_cache/fast
+
 # Special rule for the target install
 install: preinstall
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..."
@@ -66,26 +92,6 @@ install/fast: preinstall/fast
 	/usr/bin/cmake -P cmake_install.cmake
 .PHONY : install/fast
 
-# Special rule for the target install/local
-install/local: preinstall
-	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
-	/usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
-.PHONY : install/local
-
-# Special rule for the target install/local
-install/local/fast: install/local
-.PHONY : install/local/fast
-
-# Special rule for the target install/strip
-install/strip: preinstall
-	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..."
-	/usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake
-.PHONY : install/strip
-
-# Special rule for the target install/strip
-install/strip/fast: install/strip
-.PHONY : install/strip/fast
-
 # Special rule for the target list_install_components
 list_install_components:
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\""
@@ -98,53 +104,53 @@ list_install_components/fast: list_install_components
 # Special rule for the target package
 package: preinstall
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Run CPack packaging tool..."
-	cd /home/oberhuber/workspace/tnl && /usr/bin/cpack --config ./CPackConfig.cmake
+	cd /home/klement/Documents/tnl && /usr/bin/cpack --config ./CPackConfig.cmake
 .PHONY : package
 
 # Special rule for the target package
 package/fast: package
 .PHONY : package/fast
 
+# Special rule for the target test
+test:
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running tests..."
+	/usr/bin/ctest --force-new-ctest-process $(ARGS)
+.PHONY : test
+
+# Special rule for the target test
+test/fast: test
+.PHONY : test/fast
+
 # Special rule for the target package_source
 package_source:
 	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Run CPack packaging tool for source..."
-	cd /home/oberhuber/workspace/tnl && /usr/bin/cpack --config ./CPackSourceConfig.cmake /home/oberhuber/workspace/tnl/CPackSourceConfig.cmake
+	cd /home/klement/Documents/tnl && /usr/bin/cpack --config ./CPackSourceConfig.cmake /home/klement/Documents/tnl/CPackSourceConfig.cmake
 .PHONY : package_source
 
 # Special rule for the target package_source
 package_source/fast: package_source
 .PHONY : package_source/fast
 
-# Special rule for the target rebuild_cache
-rebuild_cache:
-	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..."
-	/usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
-.PHONY : rebuild_cache
-
-# Special rule for the target rebuild_cache
-rebuild_cache/fast: rebuild_cache
-.PHONY : rebuild_cache/fast
-
-# Special rule for the target test
-test:
-	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running tests..."
-	/usr/bin/ctest --force-new-ctest-process $(ARGS)
-.PHONY : test
+# Special rule for the target install/local
+install/local: preinstall
+	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..."
+	/usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake
+.PHONY : install/local
 
-# Special rule for the target test
-test/fast: test
-.PHONY : test/fast
+# Special rule for the target install/local
+install/local/fast: install/local
+.PHONY : install/local/fast
 
 # The main all target
 all: cmake_check_build_system
-	cd /home/oberhuber/workspace/tnl && $(CMAKE_COMMAND) -E cmake_progress_start /home/oberhuber/workspace/tnl/CMakeFiles /home/oberhuber/workspace/tnl/tools/CMakeFiles/progress.marks
-	cd /home/oberhuber/workspace/tnl && $(MAKE) -f CMakeFiles/Makefile2 tools/all
-	$(CMAKE_COMMAND) -E cmake_progress_start /home/oberhuber/workspace/tnl/CMakeFiles 0
+	cd /home/klement/Documents/tnl && $(CMAKE_COMMAND) -E cmake_progress_start /home/klement/Documents/tnl/CMakeFiles /home/klement/Documents/tnl/tools/CMakeFiles/progress.marks
+	cd /home/klement/Documents/tnl && $(MAKE) -f CMakeFiles/Makefile2 tools/all
+	$(CMAKE_COMMAND) -E cmake_progress_start /home/klement/Documents/tnl/CMakeFiles 0
 .PHONY : all
 
 # The main clean target
 clean:
-	cd /home/oberhuber/workspace/tnl && $(MAKE) -f CMakeFiles/Makefile2 tools/clean
+	cd /home/klement/Documents/tnl && $(MAKE) -f CMakeFiles/Makefile2 tools/clean
 .PHONY : clean
 
 # The main clean target
@@ -153,17 +159,17 @@ clean/fast: clean
 
 # Prepare targets for installation.
 preinstall: all
-	cd /home/oberhuber/workspace/tnl && $(MAKE) -f CMakeFiles/Makefile2 tools/preinstall
+	cd /home/klement/Documents/tnl && $(MAKE) -f CMakeFiles/Makefile2 tools/preinstall
 .PHONY : preinstall
 
 # Prepare targets for installation.
 preinstall/fast:
-	cd /home/oberhuber/workspace/tnl && $(MAKE) -f CMakeFiles/Makefile2 tools/preinstall
+	cd /home/klement/Documents/tnl && $(MAKE) -f CMakeFiles/Makefile2 tools/preinstall
 .PHONY : preinstall/fast
 
 # clear depends
 depend:
-	cd /home/oberhuber/workspace/tnl && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
+	cd /home/klement/Documents/tnl && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1
 .PHONY : depend
 
 # Help Target
@@ -172,15 +178,15 @@ help:
 	@echo "... all (the default if no target is provided)"
 	@echo "... clean"
 	@echo "... depend"
+	@echo "... install/strip"
 	@echo "... edit_cache"
+	@echo "... rebuild_cache"
 	@echo "... install"
-	@echo "... install/local"
-	@echo "... install/strip"
 	@echo "... list_install_components"
 	@echo "... package"
-	@echo "... package_source"
-	@echo "... rebuild_cache"
 	@echo "... test"
+	@echo "... package_source"
+	@echo "... install/local"
 .PHONY : help
 
 
@@ -192,6 +198,6 @@ help:
 # No rule that depends on this can have commands that come from listfiles
 # because they might be regenerated.
 cmake_check_build_system:
-	cd /home/oberhuber/workspace/tnl && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
+	cd /home/klement/Documents/tnl && $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
 .PHONY : cmake_check_build_system