16 #ifndef dealii_mg_coarse_h
17 #define dealii_mg_coarse_h
39 template <
class VectorType = Vector<
double>>
71 const VectorType & src)
const override;
90 template <
class VectorType,
93 class PreconditionerType>
107 const MatrixType &
matrix,
108 const PreconditionerType &precondition);
116 const MatrixType &
matrix,
117 const PreconditionerType &precondition);
132 const VectorType & src)
const override;
176 template <
typename number =
double,
class VectorType = Vector<number>>
194 const VectorType & src)
const override;
209 template <
typename number =
double,
class VectorType = Vector<number>>
227 const VectorType & src)
const;
246 template <
class VectorType>
248 : coarse_smooth(nullptr)
251 template <
class VectorType>
254 : coarse_smooth(nullptr)
260 template <
class VectorType>
268 typeid(*this).name());
272 template <
class VectorType>
276 coarse_smooth =
nullptr;
280 template <
class VectorType>
284 const VectorType & src)
const
286 coarse_smooth->apply(
level, dst, src);
291 template <
class VectorType,
294 class PreconditionerType>
299 : solver(0, typeid(*this).name())
300 ,
matrix(0, typeid(*this).name())
301 , preconditioner(0, typeid(*this).name())
306 template <
class VectorType,
309 class PreconditionerType>
313 PreconditionerType>::
314 MGCoarseGridIterativeSolver(
SolverType & solver,
315 const MatrixType &
matrix,
316 const PreconditionerType &preconditioner)
317 : solver(&solver, typeid(*this).name())
319 , preconditioner(&preconditioner, typeid(*this).name())
324 template <
class VectorType,
327 class PreconditionerType>
333 PreconditionerType>::initialize(
SolverType & solver_,
334 const MatrixType & matrix_,
335 const PreconditionerType &preconditioner_)
339 preconditioner = &preconditioner_;
344 template <
class VectorType,
347 class PreconditionerType>
352 PreconditionerType>::clear()
369 class PreconditionerType,
371 std::is_same<VectorType, typename SolverType::vector_type>::value,
372 VectorType> * =
nullptr>
375 const MatrixType &
matrix,
376 const PreconditionerType &preconditioner,
378 const VectorType & src)
380 solver.solve(
matrix, dst, src, preconditioner);
387 class PreconditionerType,
389 !std::is_same<VectorType, typename SolverType::vector_type>::value,
390 VectorType> * =
nullptr>
393 const MatrixType &
matrix,
394 const PreconditionerType &preconditioner,
396 const VectorType & src)
398 typename SolverType::vector_type src_;
399 typename SolverType::vector_type dst_;
404 solver.solve(
matrix, dst_, src_, preconditioner);
413 template <
class VectorType,
416 class PreconditionerType>
422 PreconditionerType>::operator()(
const unsigned int ,
424 const VectorType &src)
const
431 internal::MGCoarseGridIterativeSolver::solve(
432 *solver, *
matrix, *preconditioner, dst, src);
439 template <
typename number,
class VectorType>
444 householder.initialize(*
A);
449 template <
typename number,
class VectorType>
454 householder.initialize(
A);
459 template <
typename number,
class VectorType>
464 const VectorType &src)
const
466 householder.least_squares(dst, src);
473 template <
typename number,
class VectorType>
478 matrix.reinit(
A.n_rows(),
A.n_cols());
480 matrix.compute_inverse_svd(threshold);
484 template <
typename number,
class VectorType>
488 const VectorType &src)
const
494 template <
typename number,
class VectorType>
500 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
static ::ExceptionBase & ExcNotInitialized()
#define Assert(cond, exc)
@ matrix
Contents is actually a matrix.