16 #ifndef dealii_mg_coarse_h 17 #define dealii_mg_coarse_h 39 template <
class VectorType = Vector<
double>>
96 template <
typename SolverType,
class VectorType = Vector<
double>>
110 template <
typename MatrixType,
typename PreconditionerType>
113 const PreconditionerType &);
123 template <
typename MatrixType,
typename PreconditionerType>
146 template <
typename MatrixType>
148 set_matrix(
const MatrixType &);
179 class PreconditionerType>
193 const MatrixType &
matrix,
194 const PreconditionerType &precondition);
202 const MatrixType & matrix,
203 const PreconditionerType &precondition);
264 template <
typename number =
double,
class VectorType = Vector<number>>
299 template <
typename number =
double,
class VectorType = Vector<number>>
336 template <
class VectorType>
341 template <
class VectorType>
344 : coarse_smooth(
nullptr)
350 template <
class VectorType>
358 typeid(*this).name());
362 template <
class VectorType>
366 coarse_smooth =
nullptr;
370 template <
class VectorType>
376 coarse_smooth->
smooth(level, dst, src);
382 template <
typename SolverType,
class VectorType>
384 : solver(0,
typeid(*this).name())
390 template <
typename SolverType,
class VectorType>
391 template <
typename MatrixType,
typename PreconditionerType>
394 const MatrixType & m,
395 const PreconditionerType &p)
396 : solver(&s,
typeid(*this).name())
402 precondition = linear_operator<VectorType>(
matrix, p);
406 template <
typename SolverType,
class VectorType>
413 template <
typename SolverType,
class VectorType>
414 template <
typename MatrixType,
typename PreconditionerType>
418 const MatrixType & m,
419 const PreconditionerType &p)
426 precondition = linear_operator<VectorType>(
matrix, p);
430 template <
typename SolverType,
class VectorType>
440 template <
typename SolverType,
class VectorType>
448 solver->solve(
matrix, dst, src, precondition);
452 template <
typename SolverType,
class VectorType>
453 template <
typename MatrixType>
471 class PreconditionerType>
476 : solver(0,
typeid(*this).name())
477 ,
matrix(0,
typeid(*this).name())
478 , preconditioner(0,
typeid(*this).name())
486 class PreconditionerType>
490 PreconditionerType>::
491 MGCoarseGridIterativeSolver(SolverType & solver,
492 const MatrixType &
matrix,
493 const PreconditionerType &preconditioner)
494 : solver(&solver,
typeid(*this).name())
496 , preconditioner(&preconditioner,
typeid(*this).name())
504 class PreconditionerType>
511 const MatrixType & matrix_,
512 const PreconditionerType &preconditioner_)
516 preconditioner = &preconditioner_;
524 class PreconditionerType>
529 PreconditionerType>::clear()
541 class PreconditionerType>
546 PreconditionerType>::
547 operator()(
const unsigned int ,
554 solver->solve(*
matrix, dst, src, *preconditioner);
561 template <
typename number,
class VectorType>
566 householder.initialize(*A);
571 template <
typename number,
class VectorType>
576 householder.initialize(A);
581 template <
typename number,
class VectorType>
588 householder.least_squares(dst, src);
595 template <
typename number,
class VectorType>
600 matrix.reinit(A.n_rows(), A.n_cols());
602 matrix.compute_inverse_svd(threshold);
606 template <
typename number,
class VectorType>
616 template <
typename number,
class VectorType>
622 for (
unsigned int i = 0; i < n; ++i)
void initialize(const FullMatrix< number > &A, const double threshold=0)
Contents is actually a matrix.
void operator()(const unsigned int level, VectorType &dst, const VectorType &src) const override
LinearOperator< VectorType > precondition
static ::ExceptionBase & ExcNotInitialized()
SmartPointer< SolverType, MGCoarseGridIterativeSolver< VectorType, SolverType, MatrixType, PreconditionerType > > solver
void operator()(const unsigned int level, VectorType &dst, const VectorType &src) const
MGCoarseGridApplySmoother()
void initialize(SolverType &, const MatrixType &, const PreconditionerType &)
LAPACKFullMatrix< number > matrix
SmartPointer< const MatrixType, MGCoarseGridIterativeSolver< VectorType, SolverType, MatrixType, PreconditionerType > > matrix
#define Assert(cond, exc)
#define DEAL_II_NAMESPACE_CLOSE
virtual void smooth(const unsigned int level, VectorType &u, const VectorType &rhs) const =0
LinearOperator< VectorType > matrix
SmartPointer< SolverType, MGCoarseGridLACIteration< SolverType, VectorType > > solver
void initialize(const MGSmootherBase< VectorType > &coarse_smooth)
MGCoarseGridLACIteration()
MGCoarseGridHouseholder(const FullMatrix< number > *A=nullptr)
#define DEAL_II_NAMESPACE_OPEN
T min(const T &t, const MPI_Comm &mpi_communicator)
Householder< number > householder
void operator()(const unsigned int level, VectorType &dst, const VectorType &src) const
SmartPointer< const PreconditionerType, MGCoarseGridIterativeSolver< VectorType, SolverType, MatrixType, PreconditionerType > > preconditioner
SmartPointer< const MGSmootherBase< VectorType >, MGCoarseGridApplySmoother< VectorType > > coarse_smooth
void operator()(const unsigned int level, VectorType &dst, const VectorType &src) const override
void initialize(const FullMatrix< number > &A)
~MGCoarseGridLACIteration()
#define DEAL_II_DEPRECATED
void set_matrix(const MatrixType &)