/**
* Apply the preconditioner.
*/
- void vmult (VectorBase &dst,
- const VectorBase &src) const;
+ virtual void vmult (VectorBase &dst,
+ const VectorBase &src) const;
/**
* Apply the transpose preconditioner.
*/
- void Tvmult (VectorBase &dst,
+ virtual void Tvmult (VectorBase &dst,
const VectorBase &src) const;
/**
* in the Trilinos wrapper
* class.
*/
- void vmult (dealii::Vector<double> &dst,
- const dealii::Vector<double> &src) const;
+ virtual void vmult (dealii::Vector<double> &dst,
+ const dealii::Vector<double> &src) const;
/**
* Apply the transpose preconditioner on
* in the Trilinos wrapper
* class.
*/
- void Tvmult (dealii::Vector<double> &dst,
- const dealii::Vector<double> &src) const;
+ virtual void Tvmult (dealii::Vector<double> &dst,
+ const dealii::Vector<double> &src) const;
/**
* Apply the preconditioner on deal.II
* the ones provided in the Trilinos
* wrapper class.
*/
- void vmult (dealii::parallel::distributed::Vector<double> &dst,
- const dealii::parallel::distributed::Vector<double> &src) const;
+ virtual void vmult (dealii::parallel::distributed::Vector<double> &dst,
+ const dealii::parallel::distributed::Vector<double> &src) const;
/**
* Apply the transpose preconditioner on deal.II
* the ones provided in the Trilinos
* wrapper class.
*/
- void Tvmult (dealii::parallel::distributed::Vector<double> &dst,
- const dealii::parallel::distributed::Vector<double> &src) const;
+ virtual void Tvmult (dealii::parallel::distributed::Vector<double> &dst,
+ const dealii::parallel::distributed::Vector<double> &src) const;
/**
* Exception.
+ /**
+ * A wrapper class for an identity preconditioner for Trilinos matrices.
+ *
+ * @ingroup TrilinosWrappers
+ * @ingroup Preconditioners
+ * @author Bruno Turcksin, 2013
+ */
+ class PreconditionIdentity : public PreconditionBase
+ {
+ public:
+
+ /**
+ * Apply the preconditioner, i.e., dst = src.
+ */
+ void vmult (VectorBase &dst,
+ const VectorBase &src) const;
+
+ /**
+ * Apply the transport conditioner, i.e., dst = src.
+ */
+ void Tvmult (VectorBase &dst,
+ const VectorBase &src) const;
+
+ /**
+ * Apply the preconditioner on deal.II data structures
+ * instead of the ones provided in the Trilinos wrapper class,
+ * i.e., dst = src.
+ */
+ void vmult (dealii::Vector<double> &dst,
+ const dealii::Vector<double> &src) const;
+
+ /**
+ * Apply the transpose preconditioner on deal.II data structures
+ * instead of the ones provided in the Trilinos wrapper class,
+ * i.e. dst = src.
+ */
+ void Tvmult (dealii::Vector<double> &dst,
+ const dealii::Vector<double> &src) const;
+
+ /**
+ * Apply the preconditioner on deal.II parallel data structures
+ * instead of the ones provided in the Trilinos wrapper class,
+ * i.e., dst = src.
+ */
+ void vmult (parallel::distributed::Vector<double> &dst,
+ const dealii::parallel::distributed::Vector<double> &src) const;
+
+ /**
+ * Apply the transpose preconditioner on deal.II parallel data structures
+ * instead of the ones provided in the Trilinos wrapper class,
+ * i.e., dst = src.
+ */
+ void Tvmult (parallel::distributed::Vector<double> &dst,
+ const dealii::parallel::distributed::Vector<double> &src) const;
+ };
+
+
+
// -------------------------- inline and template functions ----------------------
const AdditionalData &, const double,
const ::dealii::SparsityPattern *);
+
+
+
+ /* -------------------------- PreconditionAMG -------------------------- */
+
+ void
+ PreconditionIdentity::vmult(VectorBase &dst,
+ const VectorBase &src) const
+ {
+ dst = src;
+ }
+
+ void
+ PreconditionIdentity::Tvmult(VectorBase &dst,
+ const VectorBase &src) const
+ {
+ dst = src;
+ }
+
+ void
+ PreconditionIdentity::vmult(dealii::Vector<double> &dst,
+ const dealii::Vector<double> &src) const
+ {
+ dst = src;
+ }
+
+ void
+ PreconditionIdentity::Tvmult(dealii::Vector<double> &dst,
+ const dealii::Vector<double> &src) const
+ {
+ dst = src;
+ }
+
+ void
+ PreconditionIdentity::vmult(parallel::distributed::Vector<double> &dst,
+ const parallel::distributed::Vector<double> &src) const
+ {
+ dst = src;
+ }
+
+ void
+ PreconditionIdentity::Tvmult(parallel::distributed::Vector<double> &dst,
+ const parallel::distributed::Vector<double> &src) const
+ {
+ dst = src;
+ }
}
DEAL_II_NAMESPACE_CLOSE
Assert (false, ExcNotImplemented());
}
- // Introduce the
- // preconditioner, ...
- ierr = solver.SetPrecOperator (const_cast<Epetra_Operator *>
- (preconditioner.preconditioner.get()));
- AssertThrow (ierr == 0, ExcTrilinosError(ierr));
+ // Introduce the preconditioner,
+ // if not the identity preconditioner ...
+ if (preconditioner.preconditioner.use_count()!=0)
+ {
+ ierr = solver.SetPrecOperator (const_cast<Epetra_Operator *>
+ (preconditioner.preconditioner.get()));
+ AssertThrow (ierr == 0, ExcTrilinosError(ierr));
+ }
// ... set some options, ...
solver.SetAztecOption (AZ_output, additional_data.output_solver_details ?