Commit 68dcb61b authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Enabled the TFQMR linear solver.

parent f9dc1e41
Loading
Loading
Loading
Loading
+7 −5
Original line number Diff line number Diff line
@@ -3,7 +3,9 @@ SET( headers tnlCGSolver.h
             tnlBICGStabSolver.h
             tnlBICGStabSolver_impl.h
             tnlGMRESSolver.h
             tnlGMRESSolver_impl.h )
             tnlGMRESSolver_impl.h
             tnlTFQMRSolver.h
             tnlTFQMRSolver_impl.h )

SET( CURRENT_DIR ${CMAKE_SOURCE_DIR}/src/solvers/linear/krylov )
set( common_SOURCES ${CURRENT_DIR}/tnlGMRESSolver_impl.cpp )
+1 −0
Original line number Diff line number Diff line
@@ -92,6 +92,7 @@ class tnlSemiImplicitSORSolverTag{};
class  tnlSemiImplicitCGSolverTag{};
class  tnlSemiImplicitBICGStabSolverTag{};
class  tnlSemiImplicitGMRESSolverTag{};
class  tnlSemiImplicitTFQMRSolverTag{};

template< typename MeshConfig, typename SemiImplicitSolver > struct tnlMeshConfigSemiImplicitSolver{ enum { enabled = true }; };

+4 −0
Original line number Diff line number Diff line
@@ -114,6 +114,8 @@ bool tnlSolverConfig< MeshConfig, ProblemConfig >::configSetup( tnlConfigDescrip
         config.addEntryEnum( "bicgstab" );
      if( tnlMeshConfigSemiImplicitSolver< MeshConfig, tnlSemiImplicitGMRESSolverTag >::enabled )
         config.addEntryEnum( "gmres" );
      if( tnlMeshConfigSemiImplicitSolver< MeshConfig, tnlSemiImplicitTFQMRSolverTag >::enabled )
         config.addEntryEnum( "tfqmr" );
      if( tnlMeshConfigSemiImplicitSolver< MeshConfig, tnlSemiImplicitSORSolverTag >::enabled )
         config.addEntryEnum( "sor" );
   }
@@ -143,6 +145,8 @@ bool tnlSolverConfig< MeshConfig, ProblemConfig >::configSetup( tnlConfigDescrip
         tnlBICGStabSolver< MatrixType >::configSetup( config );
      if( tnlMeshConfigSemiImplicitSolver< MeshConfig, tnlSemiImplicitGMRESSolverTag >::enabled )
         tnlGMRESSolver< MatrixType >::configSetup( config );
      if( tnlMeshConfigSemiImplicitSolver< MeshConfig, tnlSemiImplicitTFQMRSolverTag >::enabled )
         tnlTFQMRSolver< MatrixType >::configSetup( config );
      if( tnlMeshConfigSemiImplicitSolver< MeshConfig, tnlSemiImplicitSORSolverTag >::enabled )
         tnlSORSolver< MatrixType >::configSetup( config );
   }
+23 −2
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@
#include <solvers/linear/krylov/tnlCGSolver.h>
#include <solvers/linear/krylov/tnlBICGStabSolver.h>
#include <solvers/linear/krylov/tnlGMRESSolver.h>
#include <solvers/linear/krylov/tnlTFQMRSolver.h>
#include <solvers/pde/tnlExplicitTimeStepper.h>
#include <solvers/pde/tnlSemiImplicitTimeStepper.h>
#include <solvers/pde/tnlPDESolver.h>
@@ -187,9 +188,10 @@ class tnlSolverStarterTimeDiscretisationSetter< Problem, tnlSemiImplicitTimeDisc
         if( discreteSolver != "sor" &&
             discreteSolver != "cg" &&
             discreteSolver != "bicgstab" &&
             discreteSolver != "gmres" )
             discreteSolver != "gmres" &&
             discreteSolver != "tfqmr" )
         {
            cerr << "Unknown explicit discrete solver " << discreteSolver << ". It can be only: sor, cg, bicgstab or gmres." << endl;
            cerr << "Unknown explicit discrete solver " << discreteSolver << ". It can be only: sor, cg, bicgstab, gmres or tfqmr." << endl;
            return false;
         }

@@ -201,6 +203,8 @@ class tnlSolverStarterTimeDiscretisationSetter< Problem, tnlSemiImplicitTimeDisc
            return tnlSolverStarterSemiImplicitSolverSetter< Problem, tnlSemiImplicitBICGStabSolverTag, MeshConfig >::run( problem, parameters );
         if( discreteSolver == "gmres" )
            return tnlSolverStarterSemiImplicitSolverSetter< Problem, tnlSemiImplicitGMRESSolverTag, MeshConfig >::run( problem, parameters );
         if( discreteSolver == "tfqmr" )
            return tnlSolverStarterSemiImplicitSolverSetter< Problem, tnlSemiImplicitTFQMRSolverTag, MeshConfig >::run( problem, parameters );
         return false;
      }
};
@@ -356,6 +360,23 @@ class tnlSolverStarterSemiImplicitSolverSetter< Problem, tnlSemiImplicitGMRESSol
      }
};

template< typename Problem,
          typename MeshConfig >
class tnlSolverStarterSemiImplicitSolverSetter< Problem, tnlSemiImplicitTFQMRSolverTag, MeshConfig, true >
{
   public:
      static bool run( Problem& problem,
                       const tnlParameterContainer& parameters )
      {
         typedef typename Problem::MatrixType MatrixType;
         typedef tnlTFQMRSolver< MatrixType > LinearSystemSolver;
         typedef tnlSemiImplicitTimeStepper< Problem, LinearSystemSolver > TimeStepper;
         return tnlSolverStarterSemiImplicitTimeStepperSetter< Problem,
                                                               TimeStepper,
                                                               MeshConfig >::run( problem, parameters );
      }
};

/****
 * Setting the explicit time stepper
 */