12#ifndef MFEM_SPARSEMATSMOOTHERS
13#define MFEM_SPARSEMATSMOOTHERS
35 mutable std::unique_ptr<SparseMatrix>
At;
Jacobi-type diagonal smoother of a sparse matrix.
JacobiType type
Type of diagonal scaling, see DSmoother::JacobiType.
DSmoother(const SparseMatrix &a, int t, real_t s=1., int it=1)
Same as DSmoother(const SparseMatrix&,JacobiType,real_t,int), for backwards compatibility.
bool use_abs_diag
Uses abs values of the diagonal entries. Relevant only with type JacobiType::JACOBI.
void SetPositiveDiagonal(bool pos_diag=true)
Replace diagonal entries with their absolute values. Relevant only with JacobiType::JACOBI.
void Mult_(const SparseMatrix &A, const Vector &x, Vector &y) const
Apply the Jacobi smoother (used internally by Mult() and MultTranspose())
int iterations
Number of stationary iterations to perform.
void Mult(const Vector &x, Vector &y) const override
Apply the Jacobi smoother.
DSmoother(const SparseMatrix &a, JacobiType t=JACOBI, real_t s=1., int it=1)
Create a Jacobi smoother using the SparseMatrix a.
real_t scale
Scaling (damping) factor.
DSmoother(JacobiType t=JACOBI, real_t s=1., int it=1)
Create a Jacobi smoother. SetOperator() will need to be called with a SparseMatrix before first use.
DSmoother(int t, real_t s=1., int it=1)
Same as DSmoother(JacobiType,real_t,int), for backwards compatibility.
@ L1_JACOBI
Scale by the l1-norm of the rows.
@ LUMPED_JACOBI
Scale by the sum of the rows.
@ JACOBI
Scale by the diagonal of the matrix.
Vector z
Temporary work vector.
void MultTranspose(const Vector &x, Vector &y) const override
Apply the transpose of the Jacobi smoother.
Gauss-Seidel smoother of a sparse matrix.
int iterations
Number of stationary iterations.
void Mult(const Vector &x, Vector &y) const override
Application of the Gauss-Seidel smoother.
GSSmoother(const SparseMatrix &a, int t, int it=1)
Same as GSSmoother(const SparseMatrix&,GSType,int), for backwards compatibility.
GSSmoother(const SparseMatrix &a, GSType t=SYMMETRIC, int it=1)
Create a Gauss-Seidel smoother using the SparseMatrix a.
GSSmoother(GSType t=SYMMETRIC, int it=1)
Create a Gauss-Seidel smoother. SetOperator() will need to be called with a SparseMatrix before first...
void MultTranspose(const Vector &x, Vector &y) const override
Application of the transpose of the Gauss-Seidel smoother.
@ BACKWARD
Backward Gauss-Seidel ( ).
@ FORWARD
Forward Gauss-Seidel ( ).
@ SYMMETRIC
Forward Gauss-Seidel, then backward.
GSSmoother(int t, int it=1)
Same as GSSmoother(GSType,int), for backwards compatibility.
GSType type
Type of Gauss-Seidel, see GSSmoother::GSType.
Abstract data type for matrix inverse.
Abstract base class for smoothers created from a SparseMatrix.
void SetOperator(const Operator &a) override
Sets the underlying matrix. a must be a SparseMatrix.
std::unique_ptr< SparseMatrix > At
Transpose of A, if needed.
SparseSmoother(const SparseMatrix &a)
void EnsureTranspose() const
Ensure that the transpose is set.
const SparseMatrix * oper
The underlying matrix.
const SparseMatrix * oper_T