Commit 7cd842c7 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Fixing GMRES solver to work with different Vector types.

parent fd559012
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -20,9 +20,17 @@
#include <config/tnlBasicTypesSetter.h>
#include <solvers/tnlProblemSolver.h>

#include <core/tnlHost.h>
#include <config/tnlParameterContainer.h>

int main( int argc, char* argv[] )
{
   typedef simpleProblemTypesSetter ProblemSetter;

   tnlParameterContainer parameters;
   ProblemSetter problemSetter;
   problemSetter. run< double, tnlHost, int >( parameters );

   typedef tnlBasicTypesSetter< ProblemSetter > BasicTypesSetter;
   tnlProblemSolver< BasicTypesSetter > problemSolver;
   if( ! problemSolver. run( CONFIG_FILE, argc, argv ) )
+4 −1
Original line number Diff line number Diff line
@@ -111,11 +111,14 @@ bool tnlBasicTypesSetter< ProblemTypesSetter > :: setDeviceType( const tnlParame
      return false;
   }
   ProblemTypesSetter problemTypesSetter;
   /*const tnlString& device2 = parameters. GetParameter< tnlString >( "device" );
   problemTypesSetter. run< double, tnlHost, int >( parameters );
   problemTypesSetter. run< RealType, tnlHost, IndexType >( parameters );
   if( device == "host" )
      return problemTypesSetter. run< RealType, tnlHost, IndexType >( parameters );
   if( device == "cuda" )
      return problemTypesSetter. run( parameters );
   cerr << "The device '" << device << "' is not defined. " << endl;
   cerr << "The device '" << device << "' is not defined. " << endl;*/
   return false;
}

+2 −1
Original line number Diff line number Diff line
@@ -272,12 +272,13 @@ tnlGMRESSolver< Matrix, Preconditioner > :: ~tnlGMRESSolver()

template< typename Matrix,
          typename Preconditioner >
   template< typename Vector >
void tnlGMRESSolver< Matrix, Preconditioner > :: update( IndexType k,
                                                         IndexType m,
                                                         const tnlVector< RealType, tnlHost, IndexType >& H,
                                                         const tnlVector< RealType, tnlHost, IndexType >& s,
                                                         tnlVector< RealType, DeviceType, IndexType >& v,
                                                         tnlVector< RealType, DeviceType, IndexType >& x )
                                                         Vector& x )
{
   //dbgFunctionName( "tnlGMRESSolver", "Update" );
   tnlVector< RealType, tnlHost, IndexType > y( "tnlGMRESSolver::update:y" );
+2 −1
Original line number Diff line number Diff line
@@ -59,12 +59,13 @@ class tnlGMRESSolver : public tnlObject,

   protected:

   template< typename Vector >
   void update( IndexType k,
                IndexType m,
                const tnlVector< RealType, tnlHost, IndexType >& H,
                const tnlVector< RealType, tnlHost, IndexType >& s,
                tnlVector< RealType, DeviceType, IndexType >& v,
                tnlVector< RealType, DeviceType, IndexType >& x );
                Vector& x );

   void generatePlaneRotation( RealType &dx,
                               RealType &dy,