* This is a pointer to the preconditioner object that is used when
* applying the preconditioner.
*/
- std::shared_ptr<Epetra_Operator> preconditioner;
+ Teuchos::RCP<Epetra_Operator> preconditioner;
/**
* Internal communication pattern in case the matrix needs to be copied
Epetra_Operator &
PreconditionBase::trilinos_operator() const
{
- AssertThrow(preconditioner,
+ AssertThrow(!preconditioner.is_null(),
ExcMessage("Trying to dereference a null pointer."));
return (*preconditioner);
}
PreconditionChebyshev::initialize(const SparseMatrix & matrix,
const AdditionalData &additional_data)
{
- preconditioner.reset();
preconditioner =
- std::make_shared<Ifpack_Chebyshev>(&matrix.trilinos_matrix());
+ Teuchos::rcp(new Ifpack_Chebyshev(&matrix.trilinos_matrix()));
Ifpack_Chebyshev *ifpack =
dynamic_cast<Ifpack_Chebyshev *>(preconditioner.get());
PreconditionAMG::initialize(const Epetra_RowMatrix & matrix,
const Teuchos::ParameterList &ml_parameters)
{
- preconditioner.reset();
- preconditioner =
- std::make_shared<ML_Epetra::MultiLevelPreconditioner>(matrix,
- ml_parameters);
+ preconditioner.reset(
+ new ML_Epetra::MultiLevelPreconditioner(matrix, ml_parameters));
}
{
// Introduce the preconditioner, if the identity preconditioner is used,
// the precondioner is set to none, ...
- if (preconditioner.preconditioner.use_count() != 0)
+ if (preconditioner.preconditioner.strong_count() != 0)
{
const int ierr = solver.SetPrecOperator(
const_cast<Epetra_Operator *>(preconditioner.preconditioner.get()));