Commit 94c28e88 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Fixing gradient norm operator.

parent 8eb715b5
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ class tnlExactGradientNorm< 1, Real >
      }
      
      tnlExactGradientNorm()
      : epsilonSquare( 1.0 ){};
      : epsilonSquare( 0.0 ){};

      void setRegularization( const Real& epsilon )
      {
@@ -111,7 +111,7 @@ class tnlExactGradientNorm< 2, Real >
      }
      
      tnlExactGradientNorm()
      : epsilonSquare( 1.0 ){};
      : epsilonSquare( 0.0 ){};

      void setRegularization( const Real& epsilon )
      {
@@ -185,7 +185,7 @@ class tnlExactGradientNorm< 3, Real >
      }
      
      tnlExactGradientNorm()
      : epsilonSquare( 1.0 ){};
      : epsilonSquare( 0.0 ){};

      void setRegularization( const Real& epsilon )
      {
+10 −4
Original line number Diff line number Diff line
@@ -45,6 +45,9 @@ class tnlFDMGradientNorm< tnlGrid< 1,MeshReal, Device, MeshIndex >, DifferenceOp
   typedef Device DeviceType;
   typedef Index IndexType;
   
   tnlFDMGradientNorm()
   : epsSquare( 0.0 ){}

   static tnlString getType()
   {
      return tnlString( "tnlFDMGradientNorm< " ) +
@@ -95,6 +98,10 @@ class tnlFDMGradientNorm< tnlGrid< 2,MeshReal, Device, MeshIndex >, DifferenceOp
   typedef Device DeviceType;
   typedef Index IndexType;
   
   tnlFDMGradientNorm()
   : epsSquare( 0.0 ){}


   static tnlString getType()
   {
      return tnlString( "tnlFDMGradientNorm< " ) +
@@ -151,6 +158,9 @@ class tnlFDMGradientNorm< tnlGrid< 3, MeshReal, Device, MeshIndex >, DifferenceO
   typedef Device DeviceType;
   typedef Index IndexType;
   
   tnlFDMGradientNorm()
   : epsSquare( 0.0 ){}   

   static tnlString getType()
   {
      return tnlString( "tnlFDMGradientNorm< " ) +
@@ -168,10 +178,6 @@ class tnlFDMGradientNorm< tnlGrid< 3, MeshReal, Device, MeshIndex >, DifferenceO
      DifferenceOperatorTemplate< typename MeshEntity::MeshType, 1, 0, 0, Real, Index > XDifferenceOperator;
      DifferenceOperatorTemplate< typename MeshEntity::MeshType, 0, 1, 0, Real, Index > YDifferenceOperator;
      DifferenceOperatorTemplate< typename MeshEntity::MeshType, 0, 0, 1, Real, Index > ZDifferenceOperator;
      //const IndexType& cellIndex = entity.getIndex();
      //const typename MeshEntity::template NeighbourEntities< 2 >& neighbourEntities = entity.getNeighbourEntities();      
      //const typename MeshEntity::MeshType& mesh = entity.getMesh();
      //const RealType& u_c = u[ cellIndex ];
      const RealType u_x = XDifferenceOperator( u, entity );
      const RealType u_y = YDifferenceOperator( u, entity );
      const RealType u_z = ZDifferenceOperator( u, entity );
+2 −2
Original line number Diff line number Diff line
@@ -94,7 +94,7 @@ class tnlPDEOperatorEocTestResult<
      static Real getL2Tolerance() { return ( Real ) 0.05; };

      static Real getMaxEoc() { return ( Real ) 2.0; };
      static Real getMaxTolerance() { return ( Real ) 0.05; };
      static Real getMaxTolerance() { return ( Real ) 0.1; };

};

@@ -160,7 +160,7 @@ bool setGrid()
int main( int argc, char* argv[] )
{
   const int meshSize( 32 );
   const bool verbose( false );
   const bool verbose( true );
#ifdef HAVE_CPPUNIT
    return setGrid< tnlHost, meshSize, verbose >();
#else