16#ifndef dealii_mg_coarse_h
17#define dealii_mg_coarse_h
37template <
class VectorType = Vector<
double>>
69 const VectorType & src)
const override;
88template <
class VectorType,
91 class PreconditionerType>
105 const MatrixType &
matrix,
106 const PreconditionerType &precondition);
114 const MatrixType &
matrix,
115 const PreconditionerType &precondition);
130 const VectorType & src)
const override;
174template <
typename number =
double,
class VectorType = Vector<number>>
192 const VectorType & src)
const override;
207template <
typename number =
double,
class VectorType = Vector<number>>
225 const VectorType & src)
const;
244template <
class VectorType>
246 : coarse_smooth(nullptr)
249template <
class VectorType>
252 : coarse_smooth(nullptr)
258template <
class VectorType>
266 typeid(*this).name());
270template <
class VectorType>
274 coarse_smooth =
nullptr;
278template <
class VectorType>
282 const VectorType & src)
const
284 coarse_smooth->smooth(
level, dst, src);
289template <
class VectorType,
292 class PreconditionerType>
297 : solver(0, typeid(*this).name())
298 ,
matrix(0, typeid(*this).name())
299 , preconditioner(0, typeid(*this).name())
304template <
class VectorType,
307 class PreconditionerType>
311 PreconditionerType>::
312 MGCoarseGridIterativeSolver(
SolverType & solver,
313 const MatrixType &
matrix,
314 const PreconditionerType &preconditioner)
315 : solver(&solver, typeid(*this).name())
317 , preconditioner(&preconditioner, typeid(*this).name())
322template <
class VectorType,
325 class PreconditionerType>
331 PreconditionerType>::initialize(
SolverType & solver_,
332 const MatrixType & matrix_,
333 const PreconditionerType &preconditioner_)
337 preconditioner = &preconditioner_;
342template <
class VectorType,
345 class PreconditionerType>
350 PreconditionerType>::clear()
359template <
class VectorType,
362 class PreconditionerType>
367 PreconditionerType>::
368operator()(
const unsigned int ,
370 const VectorType &src)
const
375 solver->solve(*
matrix, dst, src, *preconditioner);
382template <
typename number,
class VectorType>
387 householder.initialize(*
A);
392template <
typename number,
class VectorType>
397 householder.initialize(
A);
402template <
typename number,
class VectorType>
407 const VectorType &src)
const
409 householder.least_squares(dst, src);
416template <
typename number,
class VectorType>
421 matrix.reinit(
A.n_rows(),
A.n_cols());
423 matrix.compute_inverse_svd(threshold);
427template <
typename number,
class VectorType>
431 const VectorType &src)
const
437template <
typename number,
class VectorType>
443 for (
unsigned int i = 0; i < n; ++i)
MGCoarseGridApplySmoother()
void initialize(const MGSmootherBase< VectorType > &coarse_smooth)
void operator()(const unsigned int level, VectorType &dst, const VectorType &src) const override
SmartPointer< const MGSmootherBase< VectorType >, MGCoarseGridApplySmoother< VectorType > > coarse_smooth
MGCoarseGridApplySmoother(const MGSmootherBase< VectorType > &coarse_smooth)
void initialize(const FullMatrix< number > &A)
Householder< number > householder
MGCoarseGridHouseholder(const FullMatrix< number > *A=nullptr)
void operator()(const unsigned int level, VectorType &dst, const VectorType &src) const override
SmartPointer< const MatrixType, MGCoarseGridIterativeSolver< VectorType, SolverType, MatrixType, PreconditionerType > > matrix
SmartPointer< SolverType, MGCoarseGridIterativeSolver< VectorType, SolverType, MatrixType, PreconditionerType > > solver
MGCoarseGridIterativeSolver()
SmartPointer< const PreconditionerType, MGCoarseGridIterativeSolver< VectorType, SolverType, MatrixType, PreconditionerType > > preconditioner
void initialize(SolverType &solver, const MatrixType &matrix, const PreconditionerType &precondition)
virtual void operator()(const unsigned int level, VectorType &dst, const VectorType &src) const override
MGCoarseGridIterativeSolver(SolverType &solver, const MatrixType &matrix, const PreconditionerType &precondition)
MGCoarseGridSVD()=default
LAPACKFullMatrix< number > matrix
void operator()(const unsigned int level, VectorType &dst, const VectorType &src) const
void initialize(const FullMatrix< number > &A, const double threshold=0)
#define DEAL_II_NAMESPACE_OPEN
#define DEAL_II_NAMESPACE_CLOSE
#define Assert(cond, exc)
static ::ExceptionBase & ExcNotInitialized()
@ matrix
Contents is actually a matrix.
::VectorizedArray< Number, width > min(const ::VectorizedArray< Number, width > &, const ::VectorizedArray< Number, width > &)