From 6200b55bf2b56d94b1332e8a7d723eee59ebf364 Mon Sep 17 00:00:00 2001
From: Tomas Oberhuber <tomas.oberhuber@fjfi.cvut.cz>
Date: Sun, 5 May 2013 23:15:51 +0200
Subject: [PATCH] Implementing the tnlGrid and the Lax-Fridrichs scheme.

---
 src/implementation/mesh/tnlGrid1D_impl.h      | 22 +++--
 src/implementation/mesh/tnlGrid2D_impl.h      | 59 ++++++++-----
 src/implementation/mesh/tnlGrid3D_impl.h      | 40 +++------
 .../mesh/tnlIdenticalGridGeometry_impl.h      | 49 +++++------
 .../diffusion/tnlLinearDiffusion_impl.h       |  8 +-
 .../schemes/euler/fvm/tnlLaxFridrichs_impl.h  | 47 ++++-------
 .../gradient/tnlCentralFDMGradient_impl.h     |  8 +-
 src/mesh/tnlGrid.h                            | 83 +++++++++++--------
 src/mesh/tnlIdenticalGridGeometry.h           | 63 +++++++-------
 src/schemes/euler/fvm/tnlLaxFridrichs.h       |  2 +
 10 files changed, 196 insertions(+), 185 deletions(-)

diff --git a/src/implementation/mesh/tnlGrid1D_impl.h b/src/implementation/mesh/tnlGrid1D_impl.h
index 7d107dc152..0b4e3c4c45 100644
--- a/src/implementation/mesh/tnlGrid1D_impl.h
+++ b/src/implementation/mesh/tnlGrid1D_impl.h
@@ -66,7 +66,7 @@ void tnlGrid< 1, Real, Device, Index, Geometry > :: setDimensions( const Index x
    this -> dimensions. x() = xSize;
    dofs = xSize;
 
-   tnlTuple< 1, Real > parametricStep;
+   VertexType parametricStep;
    parametricStep. x() = proportions. x() / xSize;
    geometry. setParametricStep( parametricStep );
 }
@@ -75,7 +75,7 @@ template< typename Real,
           typename Device,
           typename Index,
           template< int, typename, typename, typename > class Geometry  >
-void tnlGrid< 1, Real, Device, Index, Geometry > :: setDimensions( const tnlTuple< 1, Index >& dimensions )
+void tnlGrid< 1, Real, Device, Index, Geometry > :: setDimensions( const CoordinatesType& dimensions )
 {
    this -> setDimensions( dimensions. x() );
 }
@@ -84,7 +84,8 @@ template< typename Real,
           typename Device,
           typename Index,
           template< int, typename, typename, typename > class Geometry  >
-const tnlTuple< 1, Index >& tnlGrid< 1, Real, Device, Index, Geometry > :: getDimensions() const
+const typename tnlGrid< 1, Real, Device, Index, Geometry > :: CoordinatesType& 
+   tnlGrid< 1, Real, Device, Index, Geometry > :: getDimensions() const
 {
    return this -> dimensions;
 }
@@ -93,7 +94,7 @@ template< typename Real,
           typename Device,
           typename Index,
           template< int, typename, typename, typename > class Geometry  >
-void tnlGrid< 1, Real, Device, Index, Geometry > :: setOrigin( const tnlTuple< 1, Real >& origin )
+void tnlGrid< 1, Real, Device, Index, Geometry > :: setOrigin( const VertexType& origin )
 {
    this -> origin = origin;
 }
@@ -102,7 +103,8 @@ template< typename Real,
           typename Device,
           typename Index,
           template< int, typename, typename, typename > class Geometry  >
-const tnlTuple< 1, Real >& tnlGrid< 1, Real, Device, Index, Geometry > :: getOrigin() const
+const typename tnlGrid< 1, Real, Device, Index, Geometry > :: VertexType& 
+  tnlGrid< 1, Real, Device, Index, Geometry > :: getOrigin() const
 {
    return this -> origin;
 }
@@ -111,7 +113,7 @@ template< typename Real,
           typename Device,
           typename Index,
           template< int, typename, typename, typename > class Geometry  >
-void tnlGrid< 1, Real, Device, Index, Geometry > :: setProportions( const tnlTuple< 1, Real >& proportions )
+void tnlGrid< 1, Real, Device, Index, Geometry > :: setProportions( const VertexType& proportions )
 {
    this -> proportions = proportions;
    this -> setDimensions( this -> dimensions );
@@ -121,7 +123,8 @@ template< typename Real,
           typename Device,
           typename Index,
           template< int, typename, typename, typename > class Geometry  >
-const tnlTuple< 1, Real >& tnlGrid< 1, Real, Device, Index, Geometry > :: getProportions() const
+const typename tnlGrid< 1, Real, Device, Index, Geometry > :: VertexType& 
+   tnlGrid< 1, Real, Device, Index, Geometry > :: getProportions() const
 {
    return this -> proportions;
 }
@@ -130,7 +133,7 @@ template< typename Real,
           typename Device,
           typename Index,
           template< int, typename, typename, typename > class Geometry  >
-void tnlGrid< 1, Real, Device, Index, Geometry > :: setParametricStep( const tnlTuple< 1, Real >& parametricStep )
+void tnlGrid< 1, Real, Device, Index, Geometry > :: setParametricStep( const VertexType& parametricStep )
 {
    this -> proportions. x() = this -> dimensions. x() * parametricStep. x();
    geometry. setParametricStep( parametricStep );
@@ -140,7 +143,8 @@ template< typename Real,
           typename Device,
           typename Index,
           template< int, typename, typename, typename > class Geometry  >
-const tnlTuple< 1, Real >& tnlGrid< 1, Real, Device, Index, Geometry > :: getParametricStep() const
+const typename tnlGrid< 1, Real, Device, Index, Geometry > :: VertexType& 
+   tnlGrid< 1, Real, Device, Index, Geometry > :: getParametricStep() const
 {
    return geometry. getParametricStep();
 }
diff --git a/src/implementation/mesh/tnlGrid2D_impl.h b/src/implementation/mesh/tnlGrid2D_impl.h
index 828920379c..628e4328c8 100644
--- a/src/implementation/mesh/tnlGrid2D_impl.h
+++ b/src/implementation/mesh/tnlGrid2D_impl.h
@@ -68,7 +68,7 @@ void tnlGrid< 2, Real, Device, Index, Geometry > :: setDimensions( const Index x
    this -> dimensions. x() = xSize;
    this -> dimensions. y() = ySize;
    dofs = ySize * xSize;
-   tnlTuple< 2, Real > parametricStep;
+   VertexType parametricStep;
    parametricStep. x() = proportions. x() / xSize;
    parametricStep. y() = proportions. y() / ySize;
    geometry. setParametricStep( parametricStep );
@@ -78,7 +78,7 @@ template< typename Real,
           typename Device,
           typename Index,
           template< int, typename, typename, typename > class Geometry >
-void tnlGrid< 2, Real, Device, Index, Geometry > :: setDimensions( const tnlTuple< 2, Index >& dimensions )
+void tnlGrid< 2, Real, Device, Index, Geometry > :: setDimensions( const CoordinatesType& dimensions )
 {
    this -> setDimensions( dimensions. x(), dimensions. y() );
 }
@@ -87,7 +87,8 @@ template< typename Real,
           typename Device,
           typename Index,
           template< int, typename, typename, typename > class Geometry >
-const tnlTuple< 2, Index >& tnlGrid< 2, Real, Device, Index, Geometry > :: getDimensions() const
+const typename tnlGrid< 2, Real, Device, Index, Geometry > :: CoordinatesType& 
+   tnlGrid< 2, Real, Device, Index, Geometry > :: getDimensions() const
 {
    return this -> dimensions;
 }
@@ -96,7 +97,7 @@ template< typename Real,
           typename Device,
           typename Index,
           template< int, typename, typename, typename > class Geometry >
-void tnlGrid< 2, Real, Device, Index, Geometry > :: setOrigin( const tnlTuple< 2, Real >& origin )
+void tnlGrid< 2, Real, Device, Index, Geometry > :: setOrigin( const VertexType& origin )
 {
    this -> origin = origin;
 }
@@ -105,7 +106,8 @@ template< typename Real,
           typename Device,
           typename Index,
           template< int, typename, typename, typename > class Geometry >
-const tnlTuple< 2, Real >& tnlGrid< 2, Real, Device, Index, Geometry > :: getOrigin() const
+const typename tnlGrid< 2, Real, Device, Index, Geometry > :: VertexType& 
+   tnlGrid< 2, Real, Device, Index, Geometry > :: getOrigin() const
 {
    return this -> origin;
 }
@@ -114,10 +116,10 @@ template< typename Real,
           typename Device,
           typename Index,
           template< int, typename, typename, typename > class Geometry >
-void tnlGrid< 2, Real, Device, Index, Geometry > :: setProportions( const tnlTuple< 2, Real >& proportions )
+void tnlGrid< 2, Real, Device, Index, Geometry > :: setProportions( const VertexType& proportions )
 {
    this -> proportions = proportions;
-   tnlTuple< 2, Real > parametricStep;
+   VertexType parametricStep;
    parametricStep. x() = proportions. x() / ( this -> dimensions. x() - 1 );
    parametricStep. y() = proportions. y() / ( this -> dimensions. y() - 1 );
    geometry. setParametricStep( parametricStep );
@@ -127,7 +129,8 @@ template< typename Real,
           typename Device,
           typename Index,
           template< int, typename, typename, typename > class Geometry >
-const tnlTuple< 2, Real >& tnlGrid< 2, Real, Device, Index, Geometry > :: getProportions() const
+const typename tnlGrid< 2, Real, Device, Index, Geometry > :: VertexType& 
+   tnlGrid< 2, Real, Device, Index, Geometry > :: getProportions() const
 {
    return this -> proportions;
 }
@@ -136,7 +139,7 @@ template< typename Real,
           typename Device,
           typename Index,
           template< int, typename, typename, typename > class Geometry >
-void tnlGrid< 2, Real, Device, Index, Geometry > :: setParametricStep( const tnlTuple< 2, Real >& spaceStep )
+void tnlGrid< 2, Real, Device, Index, Geometry > :: setParametricStep( const VertexType& spaceStep )
 {
    this -> proportions. x() = this -> dimensions. x() *
                               geometry. getParametricStep(). x();
@@ -148,7 +151,8 @@ template< typename Real,
           typename Device,
           typename Index,
           template< int, typename, typename, typename > class Geometry >
-const tnlTuple< 2, Real >& tnlGrid< 2, Real, Device, Index, Geometry > :: getParametricStep() const
+const typename tnlGrid< 2, Real, Device, Index, Geometry > :: VertexType& 
+   tnlGrid< 2, Real, Device, Index, Geometry > :: getParametricStep() const
 {
    /*tnlAssert( dimensions. x() > 0,
               cerr << "Cannot get the space step hx since number of Elements along the x axis is not known in tnlGrid "
@@ -188,7 +192,7 @@ template< typename Real,
           typename Index,
           template< int, typename, typename, typename > class Geometry >
 void tnlGrid< 2, Real, Device, Index, Geometry > :: getElementCoordinates( const Index element,
-                                                                           tnlTuple< 2, Index >& coordinates ) const
+                                                                           CoordinatesType& coordinates ) const
 {
    tnlAssert( i >= 0 && i < dofs,
               cerr << " i = " << i << " dofs = " << dofs
@@ -203,8 +207,8 @@ template< typename Real,
           typename Index,
           template< int, typename, typename, typename > class Geometry >
 Index tnlGrid< 2, Real, Device, Index, Geometry > :: getElementNeighbour( const Index Element,
-                                                            const Index dy,
-                                                            const Index dx ) const
+                                                                          const Index dx,
+                                                                          const Index dy ) const
 {
    tnlAssert( Element + dy * this -> dimensions. x() + dx < getDofs(),
               cerr << "Index of neighbour with dx = " << dx
@@ -228,8 +232,8 @@ template< typename Real,
           typename Device,
           typename Index,
           template< int, typename, typename, typename > class Geometry >
-void tnlGrid< 2, Real, Device, Index, Geometry > :: getElementCenter( const tnlTuple< 2, Index >& coordinates,
-                                                                      tnlTuple< 2, Real >& center ) const
+void tnlGrid< 2, Real, Device, Index, Geometry > :: getElementCenter( const CoordinatesType& coordinates,
+                                                                      VertexType& center ) const
 {
       geometry. getElementCenter( origin, coordinates, center );
 }
@@ -238,7 +242,7 @@ template< typename Real,
           typename Device,
           typename Index,
           template< int, typename, typename, typename > class Geometry >
-Real tnlGrid< 2, Real, Device, Index, Geometry > :: getElementMeasure( const tnlTuple< 2, Index >& coordinates ) const
+Real tnlGrid< 2, Real, Device, Index, Geometry > :: getElementMeasure( const CoordinatesType& coordinates ) const
 {
    return geometry. getElementMeasure( coordinates );
 }
@@ -263,18 +267,29 @@ Real tnlGrid< 2, Real, Device, Index, Geometry > :: getEdgeLength( const Index j
                                                                    const Index i ) const
 {
    return geometry. getEdgeLength< dy, dx >( j, i );
+}*/
+
+template< typename Real,
+          typename Device,
+          typename Index,
+          template< int, typename, typename, typename > class Geometry >
+template< int dx, int dy >
+void tnlGrid< 2, Real, Device, Index, Geometry > :: getEdgeNormal( const CoordinatesType& coordinates,
+                                                                   VertexType& normal ) const
+{
+   return geometry. getEdgeNormal< dx, dy >( coordinates, normal );
 }
 
 template< typename Real,
           typename Device,
           typename Index,
           template< int, typename, typename, typename > class Geometry >
-template< int dy, int dx >
-tnlTuple< 2, Real > tnlGrid< 2, Real, Device, Index, Geometry > :: getEdgeNormal( const Index j,
-                                                                                  const Index i ) const
+   template< int dx, int dy >
+void tnlGrid< 2, Real, Device, Index, Geometry > :: getVertex( const CoordinatesType& elementCoordinates,
+                                                               VertexType& vertex ) const
 {
-   return geometry. getEdgeNormal< dy, dx >( j, i );
-}*/
+   return geometry. getVertex< dx, dy >( elementCoordinates, vertex );
+}
 
 template< typename Real,
           typename Device,
@@ -317,7 +332,7 @@ bool tnlGrid< 2, Real, Device, Index, Geometry > :: load( tnlFile& file )
       return false;
    this -> dofs = this -> getDimensions(). x() *
                   this -> getDimensions(). y();
-   tnlTuple< 2, Real > parametricStep;
+   VertexType parametricStep;
    parametricStep. x() = proportions. x() / ( this -> dimensions. x() - 1 );
    parametricStep. y() = proportions. y() / ( this -> dimensions. y() - 1 );
    geometry. setParametricStep( parametricStep );
diff --git a/src/implementation/mesh/tnlGrid3D_impl.h b/src/implementation/mesh/tnlGrid3D_impl.h
index bfdac5f7a6..dbcb00dccd 100644
--- a/src/implementation/mesh/tnlGrid3D_impl.h
+++ b/src/implementation/mesh/tnlGrid3D_impl.h
@@ -74,7 +74,7 @@ template< typename Real,
           typename Device,
           typename Index,
           template< int, typename, typename, typename > class Geometry >
-void tnlGrid< 3, Real, Device, Index, Geometry > :: setDimensions( const tnlTuple< 3, Index >& dimensions )
+void tnlGrid< 3, Real, Device, Index, Geometry > :: setDimensions( const CoordinatesType& dimensions )
 {
    this -> setDimensions( this -> dimensions. x(), this -> dimensions. y(), this -> dimensions. z() );
 }
@@ -83,7 +83,8 @@ template< typename Real,
           typename Device,
           typename Index,
           template< int, typename, typename, typename > class Geometry >
-const tnlTuple< 3, Index >& tnlGrid< 3, Real, Device, Index, Geometry > :: getDimensions() const
+const typename tnlGrid< 3, Real, Device, Index, Geometry > :: CoordinatesType& 
+   tnlGrid< 3, Real, Device, Index, Geometry > :: getDimensions() const
 {
    return this -> dimensions;
 }
@@ -92,7 +93,7 @@ template< typename Real,
           typename Device,
           typename Index,
           template< int, typename, typename, typename > class Geometry >
-void tnlGrid< 3, Real, Device, Index, Geometry > :: setOrigin( const tnlTuple< 3, Real >& origin )
+void tnlGrid< 3, Real, Device, Index, Geometry > :: setOrigin( const VertexType& origin )
 {
    this -> origin = origin;
 }
@@ -101,7 +102,8 @@ template< typename Real,
           typename Device,
           typename Index,
           template< int, typename, typename, typename > class Geometry >
-const tnlTuple< 3, Real >& tnlGrid< 3, Real, Device, Index, Geometry > :: getOrigin() const
+const typename tnlGrid< 3, Real, Device, Index, Geometry > :: VertexType&
+   tnlGrid< 3, Real, Device, Index, Geometry > :: getOrigin() const
 {
    return this -> origin;
 }
@@ -110,7 +112,7 @@ template< typename Real,
           typename Device,
           typename Index,
           template< int, typename, typename, typename > class Geometry >
-void tnlGrid< 3, Real, Device, Index, Geometry > :: setProportions( const tnlTuple< 3, Real >& proportions )
+void tnlGrid< 3, Real, Device, Index, Geometry > :: setProportions( const VertexType& proportions )
 {
    this -> proportions = proportions;
 }
@@ -119,7 +121,8 @@ template< typename Real,
           typename Device,
           typename Index,
           template< int, typename, typename, typename > class Geometry >
-const tnlTuple< 3, Real >& tnlGrid< 3, Real, Device, Index, Geometry > :: getProportions() const
+const typename tnlGrid< 3, Real, Device, Index, Geometry > :: VertexType&
+   tnlGrid< 3, Real, Device, Index, Geometry > :: getProportions() const
 {
    return this -> proportions;
 }
@@ -128,7 +131,7 @@ template< typename Real,
           typename Device,
           typename Index,
           template< int, typename, typename, typename > class Geometry >
-void tnlGrid< 3, Real, Device, Index, Geometry > :: setParametricStep( const tnlTuple< 3, Real >& spaceStep )
+void tnlGrid< 3, Real, Device, Index, Geometry > :: setParametricStep( const VertexType& spaceStep )
 {
    this -> proportions. x() = this -> dimensions. x() *
                               spaceStep. x();
@@ -142,27 +145,10 @@ template< typename Real,
           typename Device,
           typename Index,
           template< int, typename, typename, typename > class Geometry >
-tnlTuple< 3, Real > tnlGrid< 3, Real, Device, Index, Geometry > :: getParametricStep() const
+const typename tnlGrid< 3, Real, Device, Index, Geometry > :: VertexType&
+   tnlGrid< 3, Real, Device, Index, Geometry > :: getParametricStep() const
 {
-   tnlAssert( dimensions. x() > 0,
-              cerr << "Cannot get the space step hx since number of Elements along the x axis is not known in tnlGrid "
-                   << this -> getName() );
-   tnlAssert( dimensions. y() > 0,
-              cerr << "Cannot get the space step hy since number of Elements along the y axis is not known in tnlGrid "
-                   << this -> getName() );
-   tnlAssert( dimensions. z() > 0,
-              cerr << "Cannot get the space step hz since number of Elements along the z axis is not known in tnlGrid "
-                   << this -> getName() );
-
-   tnlTuple< 3, RealType > spaceStep;
-   spaceStep. x() =
-            this -> proportions. x() / ( Real ) ( this -> dimensions. x() - 1 );
-   spaceStep. y() =
-            this -> proportions. y() / ( Real ) ( this -> dimensions. y() - 1 );
-   spaceStep. z() =
-            this -> proportions. z() / ( Real ) ( this -> dimensions. z() - 1 );
-
-   return spaceStep;
+   //return geometry. getParametricStep();
 }
 
 template< typename Real,
diff --git a/src/implementation/mesh/tnlIdenticalGridGeometry_impl.h b/src/implementation/mesh/tnlIdenticalGridGeometry_impl.h
index b052df5956..6ff5a64837 100644
--- a/src/implementation/mesh/tnlIdenticalGridGeometry_impl.h
+++ b/src/implementation/mesh/tnlIdenticalGridGeometry_impl.h
@@ -28,7 +28,7 @@
 template< typename Real,
           typename Device,
           typename Index >
-void tnlIdenticalGridGeometry< 1, Real, Device, Index > :: setParametricStep( const tnlTuple< 1, Real >& parametricStep )
+void tnlIdenticalGridGeometry< 1, Real, Device, Index > :: setParametricStep( const VertexType& parametricStep )
 {
    this -> parametricStep = parametricStep;
    this -> elementMeasure = this -> parametricStep. x();
@@ -37,7 +37,8 @@ void tnlIdenticalGridGeometry< 1, Real, Device, Index > :: setParametricStep( co
 template< typename Real,
           typename Device,
           typename Index >
-const tnlTuple< 1, Real >& tnlIdenticalGridGeometry< 1, Real, Device, Index > :: getParametricStep() const
+const typename tnlIdenticalGridGeometry< 1, Real, Device, Index > :: VertexType& 
+   tnlIdenticalGridGeometry< 1, Real, Device, Index > :: getParametricStep() const
 {
    return this -> parametricStep;
 }
@@ -45,9 +46,9 @@ const tnlTuple< 1, Real >& tnlIdenticalGridGeometry< 1, Real, Device, Index > ::
 template< typename Real,
           typename Device,
           typename Index >
-void tnlIdenticalGridGeometry< 1, Real, Device, Index > :: getElementCenter( const tnlTuple< 1, Real >& origin,
-                                                                             const tnlTuple< 1, Index >& coordinates,
-                                                                             tnlTuple< 1, Real >& center ) const
+void tnlIdenticalGridGeometry< 1, Real, Device, Index > :: getElementCenter( const VertexType& origin,
+                                                                             const CoordinatesType& coordinates,
+                                                                             VertexType& center ) const
 {
    center. x() = ( coordinates. x() + 0.5 ) * parametricStep. x();
 }
@@ -55,7 +56,7 @@ void tnlIdenticalGridGeometry< 1, Real, Device, Index > :: getElementCenter( con
 template< typename Real,
           typename Device,
           typename Index >
-Real tnlIdenticalGridGeometry< 1, Real, Device, Index > :: getElementMeasure( const Index i ) const
+Real tnlIdenticalGridGeometry< 1, Real, Device, Index > :: getElementMeasure( const CoordinatesType& i ) const
 {
    return elementMeasure;
 }
@@ -74,8 +75,8 @@ template< typename Real,
           typename Index >
 template< Index dx >
 void tnlIdenticalGridGeometry< 1, Real, Device, Index > :: getEdgeCoordinates( const Index i,
-                                                                               const tnlTuple< 1, Real >& origin,
-                                                                               tnlTuple< 1, Real >& coordinates ) const
+                                                                               const VertexType& origin,
+                                                                               VertexType& coordinates ) const
 {
    coordinates. x() = origin. x() + ( i + 0.5 * ( 1.0 + dx ) ) * parametricStep. x();
 }
@@ -94,7 +95,7 @@ template< typename Real,
           typename Index >
 template< Index dx >
 void tnlIdenticalGridGeometry< 1, Real, Device, Index > :: getEdgeNormal( const Index i,
-                                                                          tnlTuple< 1, Real >& normal ) const
+                                                                          VertexType& normal ) const
 {
    tnlAssert( dx == 1 || dx == -1, cerr << " dx = " << dx << " dy = " << dy << endl );
    normal. x() = dx;
@@ -128,7 +129,7 @@ bool tnlIdenticalGridGeometry< 1, Real, Device, Index > :: load( tnlFile& file )
 template< typename Real,
           typename Device,
           typename Index >
-void tnlIdenticalGridGeometry< 2, Real, Device, Index > :: setParametricStep( const tnlTuple< 2, Real >& parametricStep )
+void tnlIdenticalGridGeometry< 2, Real, Device, Index > :: setParametricStep( const VertexType& parametricStep )
 {
    this -> parametricStep = parametricStep;
    this -> elementMeasure = this -> parametricStep. x() * this -> parametricStep. y();
@@ -137,7 +138,8 @@ void tnlIdenticalGridGeometry< 2, Real, Device, Index > :: setParametricStep( co
 template< typename Real,
           typename Device,
           typename Index >
-const tnlTuple< 2, Real >& tnlIdenticalGridGeometry< 2, Real, Device, Index > :: getParametricStep() const
+const typename tnlIdenticalGridGeometry< 2, Real, Device, Index > :: VertexType&
+   tnlIdenticalGridGeometry< 2, Real, Device, Index > :: getParametricStep() const
 {
    return this -> parametricStep;
 }
@@ -145,9 +147,9 @@ const tnlTuple< 2, Real >& tnlIdenticalGridGeometry< 2, Real, Device, Index > ::
 template< typename Real,
           typename Device,
           typename Index >
-void tnlIdenticalGridGeometry< 2, Real, Device, Index > :: getElementCenter( const tnlTuple< 2, Real >& origin,
-                                                                             const tnlTuple< 2, Index >& coordinates,
-                                                                             tnlTuple< 2, Real >& center ) const
+void tnlIdenticalGridGeometry< 2, Real, Device, Index > :: getElementCenter( const VertexType& origin,
+                                                                             const CoordinatesType& coordinates,
+                                                                             VertexType& center ) const
 {
    center. x() = ( coordinates. x() + 0.5 ) * parametricStep. x();
    center. y() = ( coordinates. y() + 0.5 ) * parametricStep. y();
@@ -156,12 +158,12 @@ void tnlIdenticalGridGeometry< 2, Real, Device, Index > :: getElementCenter( con
 template< typename Real,
           typename Device,
           typename Index >
-Real tnlIdenticalGridGeometry< 2, Real, Device, Index > :: getElementMeasure( const tnlTuple< 2, Index >& coordinates ) const
+Real tnlIdenticalGridGeometry< 2, Real, Device, Index > :: getElementMeasure( const CoordinatesType& coordinates ) const
 {
    return elementMeasure;
 }
 
-template< typename Real,
+/*template< typename Real,
           typename Device,
           typename Index >
    template< Index dx, Index dy >
@@ -183,8 +185,8 @@ template< typename Real,
 template< Index dx, Index dy >
 void tnlIdenticalGridGeometry< 2, Real, Device, Index > :: getEdgeCoordinates( const Index i,
                                                                                const Index j,
-                                                                               const tnlTuple< 2, Real >& origin,
-                                                                               tnlTuple< 2, Real >& coordinates ) const
+                                                                               const VertexType& origin,
+                                                                               VertexType& coordinates ) const
 {
    coordinates. x() = origin. x() + ( i + 0.5 * ( 1.0 + dx ) ) * parametricStep. x();
    coordinates. y() = origin. y() + ( j + 0.5 * ( 1.0 + dy ) ) * parametricStep. y();
@@ -202,21 +204,20 @@ Real tnlIdenticalGridGeometry< 2, Real, Device, Index > :: getEdgeLength( const
    if( dy == 1 && dx == 0 )
       return parametricStep. x();
    tnlAssert( false, cerr << "Bad values of dx and dy - dx = " << dx << " dy = " << dy );
-}
+}*/
 
 template< typename Real,
           typename Device,
           typename Index >
 template< Index dx, Index dy >
-void tnlIdenticalGridGeometry< 2, Real, Device, Index > :: getEdgeNormal( const Index i,
-                                                                          const Index j,
-                                                                          tnlTuple< 2, Real >& normal ) const
+void tnlIdenticalGridGeometry< 2, Real, Device, Index > :: getEdgeNormal( const CoordinatesType& coordinates,                                                                     
+                                                                          VertexType& normal ) const
 {
    tnlAssert( ( dx == 0 || dx == 1 || dx == -1 ||
                 dy == 0 || dy == 1 || dy == -1 ) &&
                dx * dy == 0, cerr << " dx = " << dx << " dy = " << dy << endl );
-   normal. x() = dx;
-   normal. y() = dy;
+   normal. x() = dx * parametricStep. y();
+   normal. y() = dy * parametricStep. x();;
 }
 
 template< typename Real,
diff --git a/src/implementation/schemes/diffusion/tnlLinearDiffusion_impl.h b/src/implementation/schemes/diffusion/tnlLinearDiffusion_impl.h
index 7c765c5d1e..959045105e 100644
--- a/src/implementation/schemes/diffusion/tnlLinearDiffusion_impl.h
+++ b/src/implementation/schemes/diffusion/tnlLinearDiffusion_impl.h
@@ -46,10 +46,10 @@ Real tnlLinearDiffusion< tnlGrid< 2, Real, Device, Index > > :: getDiffusion( co
    const Real hx = mesh -> getParametricStep(). x();
    const Real hy = mesh -> getParametricStep(). y();
 
-   const Index e = mesh -> getElementNeighbour( c,  0,  1 );
-   const Index w = mesh -> getElementNeighbour( c,  0, -1 );
-   const Index n = mesh -> getElementNeighbour( c,  1,  0 );
-   const Index s = mesh -> getElementNeighbour( c, -1,  0 );
+   const Index e = mesh -> getElementNeighbour( c,  1,  0 );
+   const Index w = mesh -> getElementNeighbour( c, -1,  0 );
+   const Index n = mesh -> getElementNeighbour( c,  0,  1 );
+   const Index s = mesh -> getElementNeighbour( c,  0, -1 );
 
    return ( f[ e ] - 2.0 * f[ c ] + f[ w ] ) / ( hx * hx ) +
           ( f[ n ] - 2.0 * f[ c ] + f[ s ] ) / ( hy * hy );
diff --git a/src/implementation/schemes/euler/fvm/tnlLaxFridrichs_impl.h b/src/implementation/schemes/euler/fvm/tnlLaxFridrichs_impl.h
index 573aa1a098..0dd7366df4 100644
--- a/src/implementation/schemes/euler/fvm/tnlLaxFridrichs_impl.h
+++ b/src/implementation/schemes/euler/fvm/tnlLaxFridrichs_impl.h
@@ -120,10 +120,10 @@ void tnlLaxFridrichs< tnlGrid< 2, Real, Device, Index >, PressureGradient  > ::
    const RealType hy = this -> mesh -> getParametricStep(). y();
 
    const IndexType& c = centralVolume;
-   const IndexType e = this -> mesh -> getElementNeighbour( centralVolume,  0,  1 );
-   const IndexType w = this -> mesh -> getElementNeighbour( centralVolume,  0, -1 );
-   const IndexType n = this -> mesh -> getElementNeighbour( centralVolume,  1,  0 );
-   const IndexType s = this -> mesh -> getElementNeighbour( centralVolume, -1,  0 );
+   const IndexType e = this -> mesh -> getElementNeighbour( centralVolume,  1,  0 );
+   const IndexType w = this -> mesh -> getElementNeighbour( centralVolume, -1,  0 );
+   const IndexType n = this -> mesh -> getElementNeighbour( centralVolume,  0,  1 );
+   const IndexType s = this -> mesh -> getElementNeighbour( centralVolume,  0, -1 );
 
    /****
     * rho_t + ( rho u_1 )_x + ( rho u_2 )_y =  0
@@ -132,7 +132,7 @@ void tnlLaxFridrichs< tnlGrid< 2, Real, Device, Index >, PressureGradient  > ::
    const RealType u1_w = rho_u1[ w ] / regularize( rho[ w ] );
    const RealType u2_n = rho_u2[ n ] / regularize( rho[ n ] );
    const RealType u2_s = rho_u2[ s ] / regularize( rho[ s ] );
-   rho_t= this -> viscosityCoefficient * 0.25 * ( rho[ e ] + rho[ w ] + rho[ s ] + rho[ n ] - 4.0 * rho[ c ] )
+   rho_t = this -> viscosityCoefficient * 0.25 * ( rho[ e ] + rho[ w ] + rho[ s ] + rho[ n ] - 4.0 * rho[ c ] )
                - ( rho[ e ] * u1_e - rho[ w ] * u1_w ) / ( 2.0 * hx )
                - ( rho[ n ] * u2_n - rho[ s ] * u2_s ) / ( 2.0 * hy );
 
@@ -157,6 +157,7 @@ void tnlLaxFridrichs< tnlGrid< 2, Real, Device, Index >, PressureGradient  > ::
                    - ( rho_u2[ n ] * u2_n - rho_u2[ s ] * u2_s ) / ( 2.0 * hy )
                    - p_y;
 
+
    /****
     * Scheme for deformed grids
     */
@@ -171,7 +172,7 @@ void tnlLaxFridrichs< tnlGrid< 2, Real, Device, Index >, PressureGradient  > ::
    /****
     * Get the central volume and its neighbours (east, north, west, south) coordinates
     */
-   tnlTuple< 2, IndexType > c_coordinates, e_coordinates, n_coordinates, w_coordinates, s_coordinates;
+   CoordinatesType c_coordinates, e_coordinates, n_coordinates, w_coordinates, s_coordinates;
    this -> mesh -> getElementCoordinates( c, c_coordinates );
    e_coordinates = n_coordinates = w_coordinates = s_coordinates = c_coordinates;
    e_coordinates. x() ++;
@@ -189,26 +190,13 @@ void tnlLaxFridrichs< tnlGrid< 2, Real, Device, Index >, PressureGradient  > ::
    const RealType mu_D_s = this -> mesh -> getElementMeasure( s_coordinates );
 
    /****
-    * Get the volumes centers of gravity
+    * Get the edge normals
     */
-   tnlTuple< 2, RealType > c_center, e_center, w_center, n_center, s_center;
-   this -> mesh -> getElementCenter( c_coordinates, c_center );
-   this -> mesh -> getElementCenter( c_coordinates, e_center );
-   this -> mesh -> getElementCenter( c_coordinates, w_center );
-   this -> mesh -> getElementCenter( c_coordinates, n_center );
-   this -> mesh -> getElementCenter( c_coordinates, s_center );
-
-   /****
-    * Get delta x and delta y between the volumes
-    */
-   const RealType dx_e = e_center. x() - c_center. x();
-   const RealType dx_w = w_center. x() - w_center. x();
-   const RealType dx_n = n_center. x() - n_center. x();
-   const RealType dx_s = s_center. x() - s_center. x();
-   const RealType dy_e = e_center. y() - c_center. y();
-   const RealType dy_w = w_center. y() - w_center. y();
-   const RealType dy_n = n_center. y() - n_center. y();
-   const RealType dy_s = s_center. y() - s_center. y();
+   VertexType e_normal, w_normal, n_normal, s_normal;
+   this -> mesh -> template getEdgeNormal<  1,  0 >( c_coordinates, e_normal );
+   this -> mesh -> template getEdgeNormal< -1,  0 >( c_coordinates, w_normal );
+   this -> mesh -> template getEdgeNormal<  0,  1 >( c_coordinates, n_normal );
+   this -> mesh -> template getEdgeNormal<  0, -1 >( c_coordinates, s_normal );
 
    /****
     * Compute the fluxes
@@ -222,15 +210,16 @@ void tnlLaxFridrichs< tnlGrid< 2, Real, Device, Index >, PressureGradient  > ::
    const RealType rho_g_n = 0.5 * ( rho[ c ] * u2_c + rho[ n ] * u2_n );
    const RealType rho_g_s = 0.5 * ( rho[ c ] * u2_c + rho[ s ] * u2_s );
 
-   rho_t = - 1.0 / mu_D_c * ( rho_f_e * dy_e - rho_g_e * dx_e +
-                              rho_f_n * dy_n - rho_g_n * dx_n +
-                              rho_f_w * dy_w - rho_g_w * dx_w +
-                              rho_f_s * dy_s - rho_g_s * dx_s )
+   rho_t = - 1.0 / mu_D_c * ( rho_f_e * e_normal. x() + rho_g_e * e_normal. y() +
+                              rho_f_n * n_normal. x() + rho_g_n * n_normal. y() +
+                              rho_f_w * w_normal. x() + rho_g_w * w_normal. y() +
+                              rho_f_s * s_normal. x() + rho_g_s * s_normal. y() )
            + 1.0 / ( 8.0 * mu_D_c ) *
                             ( ( mu_D_c + mu_D_e ) * ( rho[ e ] - rho[ c ] ) +
                               ( mu_D_c + mu_D_n ) * ( rho[ n ] - rho[ c ] ) +
                               ( mu_D_c + mu_D_w ) * ( rho[ w ] - rho[ c ] ) +
                               ( mu_D_c + mu_D_s ) * ( rho[ s ] - rho[ c ] ) );
+
 }
 
 template< typename Real,
diff --git a/src/implementation/schemes/gradient/tnlCentralFDMGradient_impl.h b/src/implementation/schemes/gradient/tnlCentralFDMGradient_impl.h
index 461d6e2c3d..a9e5776dd0 100644
--- a/src/implementation/schemes/gradient/tnlCentralFDMGradient_impl.h
+++ b/src/implementation/schemes/gradient/tnlCentralFDMGradient_impl.h
@@ -45,10 +45,10 @@ void tnlCentralFDMGradient< tnlGrid< 2, Real, Device, Index > > :: getGradient(
 {
    tnlAssert( this -> mesh, cerr << "No mesh was set in tnlCentralFDMGradient. Use the bindMesh method." );
 
-   const Index e = mesh -> getElementNeighbour( i,  0,  1 );
-   const Index w = mesh -> getElementNeighbour( i,  0, -1 );
-   const Index n = mesh -> getElementNeighbour( i,  1,  0 );
-   const Index s = mesh -> getElementNeighbour( i, -1,  0 );
+   const Index e = mesh -> getElementNeighbour( i,  1,  0 );
+   const Index w = mesh -> getElementNeighbour( i, -1,  0 );
+   const Index n = mesh -> getElementNeighbour( i,  0,  1 );
+   const Index s = mesh -> getElementNeighbour( i,  0, -1 );
 
    f_x = ( f[ e ] - f[ w ] ) / ( 2.0 * mesh -> getParametricStep(). x() );
    f_y = ( f[ n ] - f[ s ] ) / ( 2.0 * mesh -> getParametricStep(). y() );
diff --git a/src/mesh/tnlGrid.h b/src/mesh/tnlGrid.h
index c0bd40569e..7cf6e76863 100644
--- a/src/mesh/tnlGrid.h
+++ b/src/mesh/tnlGrid.h
@@ -44,6 +44,9 @@ class tnlGrid< 1, Real, Device, Index, Geometry > : public tnlObject
    typedef Device DeviceType;
    typedef Index IndexType;
    typedef Geometry< 1, Real, Device, Index > GeometryType;
+   typedef tnlTuple< 1, Real > VertexType;
+   typedef tnlTuple< 1, Index > CoordinatesType;
+
    enum { Dimensions = 1};
 
    tnlGrid();
@@ -54,21 +57,21 @@ class tnlGrid< 1, Real, Device, Index, Geometry > : public tnlObject
 
    void setDimensions( const Index xSize );
 
-   void setDimensions( const tnlTuple< 1, Index >& );
+   void setDimensions( const CoordinatesType& );
 
-   const tnlTuple< 1, Index >& getDimensions() const;
+   const CoordinatesType& getDimensions() const;
 
-   void setOrigin( const tnlTuple< 1, Real >& origin );
+   void setOrigin( const VertexType& origin );
 
-   const tnlTuple< 1, Real >& getOrigin() const;
+   const VertexType& getOrigin() const;
 
-   void setProportions( const tnlTuple< 1, Real >& proportions );
+   void setProportions( const VertexType& proportions );
 
-   const tnlTuple< 1, Real >& getProportions() const;
+   const VertexType& getProportions() const;
 
-   void setParametricStep( const tnlTuple< 1, Real >& spaceStep );
+   void setParametricStep( const VertexType& spaceStep );
 
-   const tnlTuple< 1, Real >& getParametricStep() const;
+   const VertexType& getParametricStep() const;
 
    Index getElementIndex( const Index i ) const;
 
@@ -113,6 +116,8 @@ class tnlGrid< 2, Real, Device, Index, Geometry > : public tnlObject
    typedef Device DeviceType;
    typedef Index IndexType;
    typedef Geometry< 2, Real, Device, Index > GeometryType;
+   typedef tnlTuple< 2, Real > VertexType;
+   typedef tnlTuple< 2, Index > CoordinatesType;
    enum { Dimensions = 2};
 
    tnlGrid();
@@ -123,38 +128,46 @@ class tnlGrid< 2, Real, Device, Index, Geometry > : public tnlObject
 
    void setDimensions( const Index xSize, const Index ySize );
 
-   void setDimensions( const tnlTuple< 2, Index >& );
+   void setDimensions( const CoordinatesType& );
 
-   const tnlTuple< 2, Index >& getDimensions() const;
+   const CoordinatesType& getDimensions() const;
 
-   void setOrigin( const tnlTuple< 2, Real >& origin );
+   void setOrigin( const VertexType& origin );
 
-   const tnlTuple< 2, Real >& getOrigin() const;
+   const VertexType& getOrigin() const;
 
-   void setProportions( const tnlTuple< 2, Real >& proportions );
+   void setProportions( const VertexType& proportions );
 
-   const tnlTuple< 2, Real >& getProportions() const;
+   const VertexType& getProportions() const;
 
-   void setParametricStep( const tnlTuple< 2, Real >& spaceStep );
+   void setParametricStep( const VertexType& spaceStep );
 
-   const tnlTuple< 2, Real >& getParametricStep() const;
+   const VertexType& getParametricStep() const;
 
    Index getElementIndex( const Index i,
                           const Index j ) const;
 
    void getElementCoordinates( const Index i,
-                               tnlTuple< 2, Index >& coordinates ) const;
+                                   CoordinatesType& coordinates ) const;
 
    Index getElementNeighbour( const Index Element,
-                              const Index dy,
-                              const Index dx ) const;
+                              const Index dx,
+                              const Index dy ) const;
 
    Index getDofs() const;
 
-   void getElementCenter( const tnlTuple< 2, Index >& coordinates,
-                          tnlTuple< 2, Real >& center ) const;
+   void getElementCenter( const CoordinatesType& coordinates,
+                          VertexType& center ) const;
+
+   Real getElementMeasure( const CoordinatesType& coordinates ) const;
 
-   Real getElementMeasure( const tnlTuple< 2, Index >& coordinates ) const;
+   template< int dx, int dy >
+   void getEdgeNormal( const CoordinatesType& elementCoordinates,
+                       VertexType& normal ) const;
+
+   template< int dx, int dy >
+   void getVertex( const CoordinatesType& elementCoordinates,
+                   VertexType& vertex ) const;
 
    /*template< Index dy, Index dx >
    Real getElementsDistance( const Index j,
@@ -162,12 +175,7 @@ class tnlGrid< 2, Real, Device, Index, Geometry > : public tnlObject
 
    template< int dy, int dx >
    Real getEdgeLength( const Index j,
-                       const Index i ) const;
-
-   template< int dy, int dx >
-   tnlTuple< 2, Real > getEdgeNormal( const Index j,
-                                      const Index i ) const;*/
-
+                       const Index i ) const;*/
 
    //! Method for saving the object to a file as a binary data
    bool save( tnlFile& file ) const;
@@ -207,6 +215,9 @@ class tnlGrid< 3, Real, Device, Index, Geometry > : public tnlObject
    typedef Real RealType;
    typedef Device DeviceType;
    typedef Index IndexType;
+   typedef Geometry< 2, Real, Device, Index > GeometryType;
+   typedef tnlTuple< 3, Real > VertexType;
+   typedef tnlTuple< 3, Index > CoordinatesType;
    enum { Dimensions = 3};
 
    tnlGrid();
@@ -217,21 +228,21 @@ class tnlGrid< 3, Real, Device, Index, Geometry > : public tnlObject
 
    void setDimensions( const Index xSize, const Index ySize, const Index zSize );
 
-   void setDimensions( const tnlTuple< 3, Index >& );
+   void setDimensions( const CoordinatesType& );
 
-   const tnlTuple< 3, Index >& getDimensions() const;
+   const CoordinatesType& getDimensions() const;
 
-   void setOrigin( const tnlTuple< 3, Real >& origin );
+   void setOrigin( const VertexType& origin );
 
-   const tnlTuple< 3, Real >& getOrigin() const;
+   const VertexType& getOrigin() const;
 
-   void setProportions( const tnlTuple< 3, Real >& proportions );
+   void setProportions( const VertexType& proportions );
 
-   const tnlTuple< 3, Real >& getProportions() const;
+   const VertexType& getProportions() const;
 
-   void setParametricStep( const tnlTuple< 3, Real >& spaceStep );
+   void setParametricStep( const VertexType& spaceStep );
 
-   tnlTuple< 3, Real > getParametricStep() const;
+   const VertexType& getParametricStep() const;
 
    Index getElementIndex( const Index i, const Index j, const Index k ) const;
 
diff --git a/src/mesh/tnlIdenticalGridGeometry.h b/src/mesh/tnlIdenticalGridGeometry.h
index 0fabcbf5ea..e0bb0312f3 100644
--- a/src/mesh/tnlIdenticalGridGeometry.h
+++ b/src/mesh/tnlIdenticalGridGeometry.h
@@ -38,36 +38,38 @@ class tnlIdenticalGridGeometry< 1, Real, Device, Index >
    typedef Real RealType;
    typedef Device DeviceType;
    typedef Index IndexType;
+   typedef tnlTuple< 1, Index > CoordinatesType;
+   typedef tnlTuple< 1, Real > VertexType;
 
-   void setParametricStep( const tnlTuple< 1, Real >& parametricStep );
+   void setParametricStep( const VertexType& parametricStep );
 
-   const tnlTuple< 1, Real >& getParametricStep() const;
+   const VertexType& getParametricStep() const;
 
-   void getElementCenter( const tnlTuple< 1, Real >& origin,
-                          const tnlTuple< 1, Index >& coordinates,
-                          tnlTuple< 1, Real >& center ) const;
+   void getElementCenter( const VertexType& origin,
+                          const CoordinatesType& coordinates,
+                          VertexType& center ) const;
 
 
-   Real getElementMeasure( const Index i ) const;
+   Real getElementMeasure( const CoordinatesType& i ) const;
 
    template< Index dx >
    Real getElementsDistance( const Index i ) const;
 
    template< Index dx >
    void getEdgeCoordinates( const Index i,
-                            const tnlTuple< 1, Real >& origin,
-                            tnlTuple< 1, Real >& coordinates ) const;
+                            const VertexType& origin,
+                            VertexType& coordinates ) const;
 
    template< Index dx >
    Real getEdgeLength( const Index i ) const;
 
    template< Index dx >
    void getEdgeNormal( const Index i,
-                       tnlTuple< 1, Real >& normal ) const;
+                       VertexType& normal ) const;
 
    void getVertexCoordinates( const Index i,
-                              const tnlTuple< 1, Real >& origin,
-                              tnlTuple< 1, Real >& coordinates ) const;
+                              const VertexType& origin,
+                              VertexType& coordinates ) const;
 
    bool save( tnlFile& file ) const;
 
@@ -75,7 +77,7 @@ class tnlIdenticalGridGeometry< 1, Real, Device, Index >
 
    protected:
 
-   tnlTuple< 1, Real > parametricStep;
+   VertexType parametricStep;
 
    Real elementMeasure;
 };
@@ -90,40 +92,41 @@ class tnlIdenticalGridGeometry< 2, Real, Device, Index >
    typedef Real RealType;
    typedef Device DeviceType;
    typedef Index IndexType;
+   typedef tnlTuple< 2, Index > CoordinatesType;
+   typedef tnlTuple< 2, Real > VertexType;
 
-   void setParametricStep( const tnlTuple< 2, Real >& parametricStep );
+   void setParametricStep( const VertexType& parametricStep );
 
-   const tnlTuple< 2, Real >& getParametricStep() const;
+   const VertexType& getParametricStep() const;
 
-   void getElementCenter( const tnlTuple< 2, Real >& origin,
+   void getElementCenter( const VertexType& origin,
                           const tnlTuple< 2, Index >& coordinates,
-                          tnlTuple< 2, Real >& center ) const;
+                          VertexType& center ) const;
 
    Real getElementMeasure( const tnlTuple< 2, Index >& coordinates ) const;
 
-   template< Index dx, Index dy >
+   /*template< Index dx, Index dy >
    Real getElementsDistance( const Index i,
-                             const Index j ) const;
+                             const Index j ) const;*/
 
-   template< Index dx, Index dy >
+   /*template< Index dx, Index dy >
    void getEdgeCoordinates( const Index i,
                             const Index j,
-                            const tnlTuple< 2, Real >& origin,
-                            tnlTuple< 2, Real >& coordinates ) const;
+                            const VertexType& origin,
+                            VertexType& coordinates ) const;
 
    template< Index dx, Index dy >
    Real getEdgeLength( const Index i,
-                       const Index j ) const;
+                       const Index j ) const;*/
 
    template< Index dx, Index dy >
-   void getEdgeNormal( const Index i,
-                       const Index j,
-                       tnlTuple< 2, Real >& normal ) const;
+   void getEdgeNormal( const CoordinatesType& coordinates,
+                       VertexType& normal ) const;
 
-   void getVertexCoordinates( const Index i,
-                              const Index j,
-                              const tnlTuple< 2, Real >& origin,
-                              tnlTuple< 2, Real >& coordinates ) const;
+   template< Index dx, Index dy >
+   void getVertex( const CoordinatesType& coordinates,
+                   const VertexType& origin,
+                   VertexType& vertex ) const;
 
    bool save( tnlFile& file ) const;
 
@@ -131,7 +134,7 @@ class tnlIdenticalGridGeometry< 2, Real, Device, Index >
 
    protected:
 
-   tnlTuple< 2, Real > parametricStep;
+   VertexType parametricStep;
 
    Real elementMeasure;
 };
diff --git a/src/schemes/euler/fvm/tnlLaxFridrichs.h b/src/schemes/euler/fvm/tnlLaxFridrichs.h
index 0a881c1e92..76a496c368 100644
--- a/src/schemes/euler/fvm/tnlLaxFridrichs.h
+++ b/src/schemes/euler/fvm/tnlLaxFridrichs.h
@@ -40,6 +40,8 @@ class tnlLaxFridrichs< tnlGrid< 2, Real, Device, Index >, PressureGradient >
    typedef Real RealType;
    typedef Device DeviceType;
    typedef Index IndexType;
+   typedef typename MeshType :: VertexType VertexType;
+   typedef typename MeshType :: CoordinatesType CoordinatesType;
 
    tnlLaxFridrichs();
 
-- 
GitLab