Commit 6357109d authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Fixing the dummy preconditioner and GMRES.

Fixing the simple solver example.
parent 697ee489
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -66,6 +66,8 @@ class simpleProblemSolver

   tnlSharedVector< RealType, DeviceType, IndexType > u, v;

   MeshType mesh;

};

#include "simpleProblemSolver_impl.h"
+5 −6
Original line number Diff line number Diff line
@@ -105,16 +105,15 @@ bool tnlGMRESSolver< Matrix, Preconditioner > :: solve( const Vector& b, Vector&
   if( preconditioner )
   {
      this->preconditioner->solve( b, _M_tmp );
      for( i = 0; i < _size; i ++ )
         normb += M_tmp[ i ] * M_tmp[ i ];
      normb = _M_tmp. lpNorm( ( RealType ) 2.0 );

      matrix -> vectorProduct( x, _M_tmp );
      for( i = 0; i < size; i ++ )
         M_tmp[ i ] = b[ i ] - M_tmp[ i ];
      _M_tmp. alphaXPlusBetaY( ( RealType ) 1.0, b, -1.0 );
      /*for( i = 0; i < size; i ++ )
         M_tmp[ i ] = b[ i ] - M_tmp[ i ];*/

      this->preconditioner->solve( _M_tmp, _r );
      for( i = 0; i < size; i ++ )
         beta += r[ i ] * r[ i ];
      beta = _r. lpNorm( ( RealType ) 2.0 );
   }
   else
   {
+2 −2
Original line number Diff line number Diff line
@@ -25,8 +25,8 @@ class tnlDummyPreconditioner
{
   public:

   template< typename Vector >
      bool solve( const Vector& b, Vector& x ) const { return true; }
   template< typename Vector1, typename Vector2 >
      bool solve( const Vector1& b, Vector2& x ) const { return true; }

   tnlString getType() const
   {