Loading examples/simple-solver/simpleProblemSolver.h +2 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,8 @@ class simpleProblemSolver tnlSharedVector< RealType, DeviceType, IndexType > u, v; MeshType mesh; }; #include "simpleProblemSolver_impl.h" Loading src/implementation/solvers/linear/krylov/tnlGMRESSolver_impl.h +5 −6 Original line number Diff line number Diff line Loading @@ -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 { Loading src/solvers/preconditioners/tnlDummyPreconditioner.h +2 −2 Original line number Diff line number Diff line Loading @@ -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 { Loading Loading
examples/simple-solver/simpleProblemSolver.h +2 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,8 @@ class simpleProblemSolver tnlSharedVector< RealType, DeviceType, IndexType > u, v; MeshType mesh; }; #include "simpleProblemSolver_impl.h" Loading
src/implementation/solvers/linear/krylov/tnlGMRESSolver_impl.h +5 −6 Original line number Diff line number Diff line Loading @@ -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 { Loading
src/solvers/preconditioners/tnlDummyPreconditioner.h +2 −2 Original line number Diff line number Diff line Loading @@ -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 { Loading