Skip to content
Snippets Groups Projects
Commit 68dcb61b authored by Jakub Klinkovský's avatar Jakub Klinkovský
Browse files

Enabled the TFQMR linear solver.

parent f9dc1e41
No related branches found
No related tags found
No related merge requests found
...@@ -2,11 +2,13 @@ SET( headers tnlCGSolver.h ...@@ -2,11 +2,13 @@ SET( headers tnlCGSolver.h
tnlCGSolver_impl.h tnlCGSolver_impl.h
tnlBICGStabSolver.h tnlBICGStabSolver.h
tnlBICGStabSolver_impl.h tnlBICGStabSolver_impl.h
tnlGMRESSolver.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( CURRENT_DIR ${CMAKE_SOURCE_DIR}/src/solvers/linear/krylov )
set( common_SOURCES ${CURRENT_DIR}/tnlGMRESSolver_impl.cpp ) set( common_SOURCES ${CURRENT_DIR}/tnlGMRESSolver_impl.cpp )
set( tnl_solvers_linear_krylov_SOURCES set( tnl_solvers_linear_krylov_SOURCES
${common_SOURCES} ${common_SOURCES}
PARENT_SCOPE ) PARENT_SCOPE )
...@@ -15,6 +17,6 @@ if( BUILD_CUDA) ...@@ -15,6 +17,6 @@ if( BUILD_CUDA)
set( tnl_solvers_linear_krylov_CUDA__SOURCES set( tnl_solvers_linear_krylov_CUDA__SOURCES
${common_SOURCES} ${common_SOURCES}
PARENT_SCOPE ) PARENT_SCOPE )
endif() endif()
INSTALL( FILES ${headers} DESTINATION include/tnl-${tnlVersion}/solvers/linear/krylov ) INSTALL( FILES ${headers} DESTINATION include/tnl-${tnlVersion}/solvers/linear/krylov )
...@@ -92,6 +92,7 @@ class tnlSemiImplicitSORSolverTag{}; ...@@ -92,6 +92,7 @@ class tnlSemiImplicitSORSolverTag{};
class tnlSemiImplicitCGSolverTag{}; class tnlSemiImplicitCGSolverTag{};
class tnlSemiImplicitBICGStabSolverTag{}; class tnlSemiImplicitBICGStabSolverTag{};
class tnlSemiImplicitGMRESSolverTag{}; class tnlSemiImplicitGMRESSolverTag{};
class tnlSemiImplicitTFQMRSolverTag{};
template< typename MeshConfig, typename SemiImplicitSolver > struct tnlMeshConfigSemiImplicitSolver{ enum { enabled = true }; }; template< typename MeshConfig, typename SemiImplicitSolver > struct tnlMeshConfigSemiImplicitSolver{ enum { enabled = true }; };
......
...@@ -114,6 +114,8 @@ bool tnlSolverConfig< MeshConfig, ProblemConfig >::configSetup( tnlConfigDescrip ...@@ -114,6 +114,8 @@ bool tnlSolverConfig< MeshConfig, ProblemConfig >::configSetup( tnlConfigDescrip
config.addEntryEnum( "bicgstab" ); config.addEntryEnum( "bicgstab" );
if( tnlMeshConfigSemiImplicitSolver< MeshConfig, tnlSemiImplicitGMRESSolverTag >::enabled ) if( tnlMeshConfigSemiImplicitSolver< MeshConfig, tnlSemiImplicitGMRESSolverTag >::enabled )
config.addEntryEnum( "gmres" ); config.addEntryEnum( "gmres" );
if( tnlMeshConfigSemiImplicitSolver< MeshConfig, tnlSemiImplicitTFQMRSolverTag >::enabled )
config.addEntryEnum( "tfqmr" );
if( tnlMeshConfigSemiImplicitSolver< MeshConfig, tnlSemiImplicitSORSolverTag >::enabled ) if( tnlMeshConfigSemiImplicitSolver< MeshConfig, tnlSemiImplicitSORSolverTag >::enabled )
config.addEntryEnum( "sor" ); config.addEntryEnum( "sor" );
} }
...@@ -143,6 +145,8 @@ bool tnlSolverConfig< MeshConfig, ProblemConfig >::configSetup( tnlConfigDescrip ...@@ -143,6 +145,8 @@ bool tnlSolverConfig< MeshConfig, ProblemConfig >::configSetup( tnlConfigDescrip
tnlBICGStabSolver< MatrixType >::configSetup( config ); tnlBICGStabSolver< MatrixType >::configSetup( config );
if( tnlMeshConfigSemiImplicitSolver< MeshConfig, tnlSemiImplicitGMRESSolverTag >::enabled ) if( tnlMeshConfigSemiImplicitSolver< MeshConfig, tnlSemiImplicitGMRESSolverTag >::enabled )
tnlGMRESSolver< MatrixType >::configSetup( config ); tnlGMRESSolver< MatrixType >::configSetup( config );
if( tnlMeshConfigSemiImplicitSolver< MeshConfig, tnlSemiImplicitTFQMRSolverTag >::enabled )
tnlTFQMRSolver< MatrixType >::configSetup( config );
if( tnlMeshConfigSemiImplicitSolver< MeshConfig, tnlSemiImplicitSORSolverTag >::enabled ) if( tnlMeshConfigSemiImplicitSolver< MeshConfig, tnlSemiImplicitSORSolverTag >::enabled )
tnlSORSolver< MatrixType >::configSetup( config ); tnlSORSolver< MatrixType >::configSetup( config );
} }
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <solvers/linear/krylov/tnlCGSolver.h> #include <solvers/linear/krylov/tnlCGSolver.h>
#include <solvers/linear/krylov/tnlBICGStabSolver.h> #include <solvers/linear/krylov/tnlBICGStabSolver.h>
#include <solvers/linear/krylov/tnlGMRESSolver.h> #include <solvers/linear/krylov/tnlGMRESSolver.h>
#include <solvers/linear/krylov/tnlTFQMRSolver.h>
#include <solvers/pde/tnlExplicitTimeStepper.h> #include <solvers/pde/tnlExplicitTimeStepper.h>
#include <solvers/pde/tnlSemiImplicitTimeStepper.h> #include <solvers/pde/tnlSemiImplicitTimeStepper.h>
#include <solvers/pde/tnlPDESolver.h> #include <solvers/pde/tnlPDESolver.h>
...@@ -187,9 +188,10 @@ class tnlSolverStarterTimeDiscretisationSetter< Problem, tnlSemiImplicitTimeDisc ...@@ -187,9 +188,10 @@ class tnlSolverStarterTimeDiscretisationSetter< Problem, tnlSemiImplicitTimeDisc
if( discreteSolver != "sor" && if( discreteSolver != "sor" &&
discreteSolver != "cg" && discreteSolver != "cg" &&
discreteSolver != "bicgstab" && 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; return false;
} }
...@@ -201,6 +203,8 @@ class tnlSolverStarterTimeDiscretisationSetter< Problem, tnlSemiImplicitTimeDisc ...@@ -201,6 +203,8 @@ class tnlSolverStarterTimeDiscretisationSetter< Problem, tnlSemiImplicitTimeDisc
return tnlSolverStarterSemiImplicitSolverSetter< Problem, tnlSemiImplicitBICGStabSolverTag, MeshConfig >::run( problem, parameters ); return tnlSolverStarterSemiImplicitSolverSetter< Problem, tnlSemiImplicitBICGStabSolverTag, MeshConfig >::run( problem, parameters );
if( discreteSolver == "gmres" ) if( discreteSolver == "gmres" )
return tnlSolverStarterSemiImplicitSolverSetter< Problem, tnlSemiImplicitGMRESSolverTag, MeshConfig >::run( problem, parameters ); return tnlSolverStarterSemiImplicitSolverSetter< Problem, tnlSemiImplicitGMRESSolverTag, MeshConfig >::run( problem, parameters );
if( discreteSolver == "tfqmr" )
return tnlSolverStarterSemiImplicitSolverSetter< Problem, tnlSemiImplicitTFQMRSolverTag, MeshConfig >::run( problem, parameters );
return false; return false;
} }
}; };
...@@ -356,6 +360,23 @@ class tnlSolverStarterSemiImplicitSolverSetter< Problem, tnlSemiImplicitGMRESSol ...@@ -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 * Setting the explicit time stepper
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment