22 if (m_opt.getSwitch(
"iter"))
24 return new typename gsSparseSolver<T>::BiCGSTABILUT;
28 #ifdef GISMO_WITH_PARDISO
29 return new typename gsSparseSolver<T>::PardisoLU;
31 return new typename gsSparseSolver<T>::LU;
40 if (m_opt.getSwitch(
"iter"))
42 typename gsSparseSolver<T>::BiCGSTABILUT* pSolver =
dynamic_cast<typename gsSparseSolver<T>::BiCGSTABILUT*
>(&solver);
44 pSolver->preconditioner().setDroptol(m_opt.getReal(
"dropTol"));
45 pSolver->preconditioner().setFillfactor(m_opt.getInt(
"fill"));
46 pSolver->setMaxIterations(m_opt.getInt(
"maxIt"));
47 pSolver->setTolerance(m_opt.getReal(
"tol"));
51 #ifdef GISMO_WITH_PARDISO
52 typename gsSparseSolver<T>::PardisoLU* pSolver =
dynamic_cast<typename gsSparseSolver<T>::PardisoLU*
>(&solver);
53 pardisoSetup<T>(*pSolver);
59template <
class T,
int MatOrder>
62 GISMO_ASSERT(input.rows() == m_size,
"Wrong input size.");
65 int udofs = m_opt.getInt(
"udofs");
66 for (
int i = 0; i < m_opt.getInt(
"dim"); i++)
67 x.middleRows(i*udofs, udofs) = m_pSolver->solve(input.middleRows(i*udofs, udofs));
71template <
class T,
int MatOrder>
74 GISMO_ASSERT(input.rows() == m_size,
"Wrong input size.");
77 x = m_pSolver->solve(input);
81template <
class T,
int MatOrder>
84 GISMO_ASSERT(input.rows() == m_size,
"Wrong input size.");
87 int udofs = m_opt.getInt(
"udofs");
90 for (
int i = 0; i < m_opt.getInt(
"dim"); i++)
91 x.middleRows(i*udofs, udofs) = m_solvers[i]->solve(input.middleRows(i*udofs, udofs));
96template <
class T,
int MatOrder>
99 GISMO_ASSERT(input.rows() == m_size,
"Wrong input size.");
102 int udofs = m_opt.getInt(
"udofs");
105 for (
int i = 0; i < m_opt.getInt(
"dim"); i++)
107 gsMatrix<T> rhsi = input.middleRows(i*udofs, udofs);
109 for (
int j = 0; j < i; j++)
110 rhsi -= m_matRef.block(i*udofs, j*udofs, udofs, udofs) * x.middleRows(j*udofs, udofs);
112 x.middleRows(i*udofs, udofs) = m_solvers[i]->solve(rhsi);
117template <
class T,
int MatOrder>
120 GISMO_ASSERT(input.rows() == this->cols(),
"Wrong input size.");
121 x.resize(this->rows(), 1);
123 x.noalias() = m_mat * input;
127template <
class T,
int MatOrder>
130 GISMO_ASSERT(input.rows() == this->rows(),
"Wrong input size.");
131 x.resize(this->rows(), 1);
135 tmp = m_pSolver->solve(-1 * input);
136 x = m_pSolver->solve(m_mat2 * tmp);
140template <
class T,
int MatOrder>
143 GISMO_ASSERT(input.rows() == this->rows(),
"Wrong input size.");
144 x.resize(this->rows(), 1);
148 tmp1 = m_pSolver->solve(-1 * input);
149 tmp2 = m_matFp * tmp1;
150 x = m_pMassSolver->solve(tmp2);
154template <
class T,
int MatOrder>
157 GISMO_ASSERT(input.rows() == this->rows(),
"Wrong input size.");
158 x.resize(this->rows(), 1);
162 tmp1 = m_pMassSolver->solve(-1 * input);
163 tmp2 = m_matFp * tmp1;
164 x = m_pSolver->solve(tmp2);
void apply(const gsMatrix< T > &input, gsMatrix< T > &x) const
Apply the block. Computes the vector \fx = F^{-1} y\f.
Definition gsINSPrecondBlocks.hpp:60
void apply(const gsMatrix< T > &input, gsMatrix< T > &x) const
Apply the block. Computes the vector \fx = F^{-1} y\f.
Definition gsINSPrecondBlocks.hpp:82
void apply(const gsMatrix< T > &input, gsMatrix< T > &x) const
Apply the block. Computes the vector \fx = F^{-1} y\f.
Definition gsINSPrecondBlocks.hpp:97
void apply(const gsMatrix< T > &input, gsMatrix< T > &x) const
Apply the block. Computes the vector \fx = F^{-1} y\f.
Definition gsINSPrecondBlocks.hpp:72
void setupLinSolver(gsSparseSolver< T > &solver)
Set up the linear solver for the block.
Definition gsINSPrecondBlocks.hpp:38
gsSparseSolver< T > * createLinSolver()
Returns a pointer to new linear solver (direct or iterative).
Definition gsINSPrecondBlocks.hpp:20
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition gsMatrix.h:41
Abstract class for solvers. The solver interface is base on 3 methods: -compute set the system matrix...
Definition gsSparseSolver.h:67
#define GISMO_ASSERT(cond, message)
Definition gsDebug.h:89
The G+Smo namespace, containing all definitions for the library.