25template<
class T,
int MatOrder>
100template<
class T,
int MatOrder>
110#ifdef GISMO_WITH_PARDISO
111 typename gsSparseSolver<T>::PardisoLU m_solver;
113 typename gsSparseSolver<T>::LU m_solver;
119 using Base::m_paramsRef;
120 using Base::m_setupT;
121 using Base::m_solveT;
132 #ifdef GISMO_WITH_PARDISO
133 pardisoSetup<T>(m_solver);
156template<
class T,
int MatOrder,
class SolverType>
167 std::vector<index_t> m_linIterVector;
172 using Base::m_paramsRef;
173 using Base::m_setupT;
174 using Base::m_solveT;
211 for (
size_t i = 0; i < m_linIterVector.size(); i++)
212 linIterSum += m_linIterVector[i];
214 return (T)linIterSum / m_linIterVector.size();
225template<
class T,
int MatOrder,
class SolverType>
235 std::string m_precType;
238 std::map<std::string, gsSparseMatrix<T, MatOrder> > m_matrices;
239 std::vector<index_t> m_linIterVector;
244 using Base::m_precPtr;
245 using Base::m_paramsRef;
246 using Base::m_setupT;
247 using Base::m_solveT;
256 Base(params), m_assemblerPtr(assemblerPtr)
258 m_precType = m_paramsRef.options().getString(
"lin.precType");
259 m_precOpt = m_paramsRef.precOptions();
260 m_precOpt.
addInt(
"dim",
"Problem dimension", m_assemblerPtr->
getTarDim());
261 m_precOpt.
addReal(
"visc",
"Viscosity", m_paramsRef.getPde().viscosity());
262 m_precOpt.
addInt(
"udofs",
"Number of velocity dofs", m_assemblerPtr->
getUdofs());
263 m_precOpt.
addInt(
"pdofs",
"Number of pressure dofs", m_assemblerPtr->
getPdofs());
277template<
class T,
int MatOrder,
class SolverType = gsGMRes<T> >
284 if (type ==
"direct")
286 else if (type ==
"iter" && INSassembPtr == NULL)
288 else if (type ==
"iter" && INSassembPtr != NULL)
294 gsInfo <<
"Invalid linear system solver type, using direct.\n";
302#ifndef GISMO_BUILD_LIB
303#include GISMO_HPP_HEADER(gsFlowLinSystSolver.hpp)
A base class for all assemblers in gsIncompressibleFlow.
Definition gsFlowAssemblerBase.h:25
short_t getTarDim() const
Returns the target dimension.
Definition gsFlowAssemblerBase.h:149
Direct solver for linear systems inside the incompressible flow solvers (classes derived from gsFlowS...
Definition gsFlowLinSystSolver.h:102
virtual void applySolver(const gsSparseMatrix< T, MatOrder > &mat, const gsMatrix< T > &rhs, gsMatrix< T > &solution)
Solve the linear system.
Definition gsFlowLinSystSolver.hpp:86
gsFlowLinSystSolver_direct(const gsFlowSolverParams< T > ¶ms)
Constructor.
Definition gsFlowLinSystSolver.h:129
virtual void setupSolver(const gsSparseMatrix< T, MatOrder > &mat)
Setup the linear solver for a given matrix.
Definition gsFlowLinSystSolver.hpp:75
G+Smo/Eigen iterative solver for saddle-point linear systems inside the incompressible flow solvers (...
Definition gsFlowLinSystSolver.h:227
virtual void setupPreconditioner(const gsSparseMatrix< T, MatOrder > &mat)
Setup the preconditioner for a given matrix.
Definition gsFlowLinSystSolver.hpp:138
gsFlowLinSystSolver_iterSP(const gsFlowSolverParams< T > ¶ms, const gsINSAssembler< T, MatOrder > *assemblerPtr)
Constructor.
Definition gsFlowLinSystSolver.h:255
G+Smo/Eigen iterative solver for linear systems inside the incompressible flow solvers (classes deriv...
Definition gsFlowLinSystSolver.h:158
std::vector< index_t > getLinIterVector() const
Returns vector of iteration counts of the linear solver for each call of applySolver().
Definition gsFlowLinSystSolver.h:204
gsFlowLinSystSolver_iter(const gsFlowSolverParams< T > ¶ms)
Constructor.
Definition gsFlowLinSystSolver.h:182
virtual void setupPreconditioner(const gsSparseMatrix< T, MatOrder > &mat)
Setup the preconditioner for a given matrix.
Definition gsFlowLinSystSolver.hpp:103
T stopwatchStop()
Stop measuring time (decides whether to use gsStopwatch or MPI_Wtime)
Definition gsFlowLinSystSolver.hpp:37
virtual void setupSolver(const gsSparseMatrix< T, MatOrder > &mat)
Setup the linear solver for a given matrix (nothing happens here).
Definition gsFlowLinSystSolver.h:190
T stopwatchStart()
Start measuring time (decides whether to use gsStopwatch or MPI_Wtime)
Definition gsFlowLinSystSolver.hpp:19
T getAvgLinIterations() const
Returns the average iteration count of the linear solver per applySolver() call.
Definition gsFlowLinSystSolver.h:207
virtual void applySolver(const gsSparseMatrix< T, MatOrder > &mat, const gsMatrix< T > &rhs, gsMatrix< T > &solution)
Solve the linear system.
Definition gsFlowLinSystSolver.hpp:113
Interface for classes solving linear systems inside the incompressible flow solvers (classes derived ...
Definition gsFlowLinSystSolver.h:27
gsFlowLinSystSolver(const gsFlowSolverParams< T > ¶ms)
Constructor.
Definition gsFlowLinSystSolver.h:39
virtual void applySolver(const gsSparseMatrix< T, MatOrder > &mat, const gsMatrix< T > &rhs, gsMatrix< T > &solution)
Solve the linear system.
Definition gsFlowLinSystSolver.h:69
virtual const T getSolveTime() const
Returns the total time spent on solving of the linear systems.
Definition gsFlowLinSystSolver.h:89
T stopwatchStop()
Stop measuring time (decides whether to use gsStopwatch or MPI_Wtime)
Definition gsFlowLinSystSolver.hpp:37
virtual void setupSolver(const gsSparseMatrix< T, MatOrder > &mat)
Setup the linear solver for a given matrix.
Definition gsFlowLinSystSolver.h:62
virtual const T getSolverSetupTime() const
Returns the total time spent on linear solver setup.
Definition gsFlowLinSystSolver.h:86
T stopwatchStart()
Start measuring time (decides whether to use gsStopwatch or MPI_Wtime)
Definition gsFlowLinSystSolver.hpp:19
A class that holds all parameters needed by the incompressible flow solver.
Definition gsFlowSolverParams.h:34
gsOptionList & options()
Returns a reference to the INS solver option list.
Definition gsFlowSolverParams.h:185
A base class for incompressible Navier-Stokes assemblers.
Definition gsINSAssembler.h:27
index_t getPdofs() const
Returns the number of pressure DOFs.
Definition gsINSAssembler.h:205
index_t getUdofs() const
Returns the number of velocity DOFs (one velocity component).
Definition gsINSAssembler.h:202
memory::shared_ptr< gsLinearOperator > Ptr
Shared pointer for gsLinearOperator.
Definition gsLinearOperator.h:33
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition gsMatrix.h:41
Class which holds a list of parameters/options, and provides easy access to them.
Definition gsOptionList.h:33
void addInt(const std::string &label, const std::string &desc, const index_t &value)
Adds a option named label, with description desc and value value.
Definition gsOptionList.cpp:201
std::string getString(const std::string &label) const
Reads value for option label from options.
Definition gsOptionList.cpp:27
void addReal(const std::string &label, const std::string &desc, const Real &value)
Adds a option named label, with description desc and value value.
Definition gsOptionList.cpp:211
Sparse matrix class, based on gsEigen::SparseMatrix.
Definition gsSparseMatrix.h:139
#define index_t
Definition gsConfig.h:32
#define GISMO_NO_IMPLEMENTATION
Definition gsDebug.h:129
#define gsInfo
Definition gsDebug.h:43
A class that holds all parameters needed by the incompressible flow solver.
Preconditioned iterative solver using the generalized minimal residual method.
The G+Smo namespace, containing all definitions for the library.