16 #ifndef dealii__mg_coarse_h 17 #define dealii__mg_coarse_h 20 #include <deal.II/lac/full_matrix.h> 21 #include <deal.II/lac/matrix_lib.h> 22 #include <deal.II/lac/householder.h> 23 #include <deal.II/multigrid/mg_base.h> 25 DEAL_II_NAMESPACE_OPEN
36 template<
class VectorType = Vector<
double> >
60 const VectorType &src)
const;
83 template<
typename SolverType,
class VectorType = Vector<
double> >
96 template<
typename MatrixType,
typename PreconditionerType>
99 const PreconditionerType &);
109 template<
typename MatrixType,
typename PreconditionerType>
112 const PreconditionerType &);
125 const VectorType &src)
const;
131 template <
typename MatrixType>
150 } DEAL_II_DEPRECATED;
160 template<
class VectorType,
163 class PreconditionerType>
178 const PreconditionerType &precondition);
186 const PreconditionerType &precondition);
197 virtual void operator() (
const unsigned int level,
199 const VectorType &src)
const;
241 template<
typename number =
double,
class VectorType = Vector<number> >
257 const VectorType &src)
const;
274 template<
typename number =
double,
class VectorType = Vector<number> >
290 const VectorType &src)
const;
309 template<
class VectorType>
311 : coarse_smooth(NULL)
315 template<
class VectorType>
317 : coarse_smooth(NULL)
323 template<
class VectorType>
329 (&coarse_smooth_,
typeid(*this).name());
332 template<
class VectorType>
336 const VectorType &src)
const 338 coarse_smooth->smooth(level, dst, src);
343 DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
345 template<
typename SolverType,
class VectorType>
349 solver(0, typeid(*this).name()),
355 template<
typename SolverType,
class VectorType>
356 template<
typename MatrixType,
typename PreconditionerType>
360 const PreconditionerType &p)
362 solver(&s, typeid(*this).name())
369 template<
typename SolverType,
class VectorType>
377 template<
typename SolverType,
class VectorType>
378 template<
typename MatrixType,
typename PreconditionerType>
383 const PreconditionerType &p)
395 template<
typename SolverType,
class VectorType>
410 template<
typename SolverType,
class VectorType>
415 const VectorType &src)
const 420 solver->solve(*matrix, dst, src, *precondition);
424 template<
typename SolverType,
class VectorType>
425 template<
typename MatrixType>
435 DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
440 template <
class VectorType,
443 class PreconditionerType>
447 solver(0, typeid(*this).name()),
448 matrix(0, typeid(*this).name()),
449 preconditioner(0, typeid(*this).name())
454 template <
class VectorType,
457 class PreconditionerType>
460 const MatrixType &matrix,
461 const PreconditionerType &preconditioner)
463 solver (&solver, typeid(*this).name()),
464 matrix (&matrix, typeid(*this).name()),
465 preconditioner (&preconditioner, typeid(*this).name())
470 template <
class VectorType,
473 class PreconditionerType>
477 const MatrixType &matrix_,
478 const PreconditionerType &preconditioner_)
482 preconditioner = &preconditioner_;
488 template <
class VectorType,
491 class PreconditionerType>
503 template <
class VectorType,
506 class PreconditionerType>
511 const VectorType &src)
const 516 solver->solve(*matrix, dst, src, *preconditioner);
523 template<
typename number,
class VectorType>
527 if (A != 0) householder.initialize(*A);
532 template<
typename number,
class VectorType>
536 householder.initialize(A);
541 template<
typename number,
class VectorType>
545 const VectorType &src)
const 547 householder.least_squares(dst, src);
552 template<
typename number,
class VectorType>
559 template<
typename number,
class VectorType>
564 matrix.reinit(A.n_rows(), A.n_cols());
566 matrix.compute_inverse_svd(threshold);
570 template<
typename number,
class VectorType>
575 const VectorType &src)
const 577 matrix.vmult(dst, src);
581 template<
typename number,
class VectorType>
585 const unsigned int n = std::min(matrix.n_rows(), matrix.n_cols());
587 for (
unsigned int i=0; i<n; ++i)
588 deallog <<
' ' << matrix.singular_value(i);
589 deallog << std::endl;
595 DEAL_II_NAMESPACE_CLOSE
void initialize(const FullMatrix< number > &A, const double threshold=0)
MGCoarseGridHouseholder(const FullMatrix< number > *A=0)
static ::ExceptionBase & ExcNotInitialized()
SmartPointer< const PreconditionerType, MGCoarseGridIterativeSolver< VectorType, SolverType, MatrixType, PreconditionerType > > preconditioner
virtual void operator()(const unsigned int level, VectorType &dst, const VectorType &src) const
void operator()(const unsigned int level, VectorType &dst, const VectorType &src) const
MGCoarseGridApplySmoother()
void initialize(SolverType &, const MatrixType &, const PreconditionerType &)
LAPACKFullMatrix< number > matrix
PointerMatrixBase< VectorType > * matrix
SmartPointer< SolverType, MGCoarseGridIterativeSolver< VectorType, SolverType, MatrixType, PreconditionerType > > solver
SmartPointer< SolverType, MGCoarseGridLACIteration< SolverType, VectorType > > solver
#define Assert(cond, exc)
void operator()(const unsigned int level, VectorType &dst, const VectorType &src) const
MGCoarseGridIterativeSolver()
void initialize(SolverType &solver, const MatrixType &matrix, const PreconditionerType &precondition)
void initialize(const MGSmootherBase< VectorType > &coarse_smooth)
void operator()(const unsigned int level, VectorType &dst, const VectorType &src) const
MGCoarseGridLACIteration()
PointerMatrixBase< VectorType > * precondition
SmartPointer< const MatrixType, MGCoarseGridIterativeSolver< VectorType, SolverType, MatrixType, PreconditionerType > > matrix
Householder< number > householder
void operator()(const unsigned int level, VectorType &dst, const VectorType &src) const
SmartPointer< const MGSmootherBase< VectorType >, MGCoarseGridApplySmoother< VectorType > > coarse_smooth
void initialize(const FullMatrix< number > &A)
~MGCoarseGridLACIteration()
void set_matrix(const MatrixType &)