#include <deal.II/lac/full_matrix.h>
-#include <deal.II/lac/matrix_lib.h>
#include <deal.II/lac/householder.h>
+#include <deal.II/lac/linear_operator.h>
+#include <deal.II/lac/matrix_lib.h>
#include <deal.II/multigrid/mg_base.h>
DEAL_II_NAMESPACE_OPEN
SmartPointer<SolverType,MGCoarseGridLACIteration<SolverType,VectorType> > solver;
/**
- * Reference to the matrix.
+ * LinearOperator wrapping a reference to the matrix.
*/
- PointerMatrixBase<VectorType> *matrix;
+ LinearOperator<VectorType> matrix;
/**
- * Reference to the preconditioner.
+ * LinearOperator wrapping a reference to the preconditioner.
*/
- PointerMatrixBase<VectorType> *precondition;
+ LinearOperator<VectorType> precondition;
} DEAL_II_DEPRECATED;
:
solver(&s, typeid(*this).name())
{
- matrix = new PointerMatrix<MatrixType, VectorType>(&m);
- precondition = new PointerMatrix<PreconditionerType, VectorType>(&p);
+ matrix = linear_operator<VectorType>(m);
+ precondition = linear_operator<VectorType>(p);
}
solver = &s;
if (matrix)
delete matrix;
- matrix = new PointerMatrix<MatrixType, VectorType>(&m);
+ matrix = linear_operator<VectorType>(m);
if (precondition)
delete precondition;
- precondition = new PointerMatrix<PreconditionerType, VectorType>(&p);
+ precondition = linear_operator<VectorType>(p);
}
::clear()
{
solver = nullptr;
- if (matrix)
- delete matrix;
- matrix = nullptr;
- if (precondition)
- delete precondition;
- precondition = nullptr;
+ matrix = LinearOperator<VectorType>();
+ precondition = LinearOperator<VectorType>();
+
}
const VectorType &src) const
{
Assert(solver!=nullptr, ExcNotInitialized());
- Assert(matrix!=nullptr, ExcNotInitialized());
- Assert(precondition!=nullptr, ExcNotInitialized());
- solver->solve(*matrix, dst, src, *precondition);
+ solver->solve(matrix, dst, src, precondition);
}
{
if (matrix)
delete matrix;
- matrix = new PointerMatrix<MatrixType, VectorType>(&m);
+ matrix = linear_operator<VectorType>(m);
}
DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
const VectorType &src) const
{
Assert(solver!=nullptr, ExcNotInitialized());
- Assert(matrix!=nullptr, ExcNotInitialized());
- Assert(preconditioner!=nullptr, ExcNotInitialized());
- solver->solve(*matrix, dst, src, *preconditioner);
+ solver->solve(matrix, dst, src, preconditioner);
}