};
+/**
+ * Block Jacobi (additive Schwarz) method with possibly overlapping blocks.
+ *
+ * This class implements the step() and Tstep() functions expected by
+ * SolverRelaxation and MGSmootherRelaxation. They perform an
+ * additive Schwarz method on the blocks provided in the
+ * BlockList of AdditionalData. Differing from PreconditionBlockJacobi,
+ * these blocks may be of varying size, non-contiguous, and
+ * overlapping. On the other hand, this class does not implement the
+ * preconditioner interface expected by Solver objects.
+ *
+ * @ingroup Preconditioners
+ * @author Guido Kanschat
+ * @date 2010
+ */
+template<class MATRIX, typename inverse_type = typename MATRIX::value_type>
+class RelaxationBlockJacobi : public virtual Subscriptor,
+ protected RelaxationBlock<MATRIX, inverse_type>
+{
+ public:
+ /**
+ * Default constructor.
+ */
+// RelaxationBlockJacobi();
+
+ /**
+ * Define number type of matrix.
+ */
+ typedef typename MATRIX::value_type number;
+
+ /**
+ * Make type publicly available.
+ */
+ using RelaxationBlock<MATRIX,inverse_type>::AdditionalData;
+
+ /**
+ * Make initialization function
+ * publicly available.
+ */
+ using RelaxationBlock<MATRIX, inverse_type>::initialize;
+
+ /**
+ * Make function of base class public again.
+ */
+ using RelaxationBlock<MATRIX, inverse_type>::clear;
+
+ /**
+ * Make function of base class public again.
+ */
+ using RelaxationBlock<MATRIX, inverse_type>::empty;
+ /**
+ * Make function of base class public again.
+ */
+ using RelaxationBlock<MATRIX, inverse_type>::size;
+ /**
+ * Make function of base class public again.
+ */
+ using RelaxationBlock<MATRIX, inverse_type>::inverse;
+ /**
+ * Make function of base class public again.
+ */
+ using RelaxationBlock<MATRIX, inverse_type>::inverse_householder;
+ /**
+ * Make function of base class public again.
+ */
+ using RelaxationBlock<MATRIX, inverse_type>::inverse_svd;
+ /**
+ * Perform one step of the Jacobi
+ * iteration.
+ */
+ template <typename number2>
+ void step (Vector<number2>& dst, const Vector<number2>& rhs) const;
+
+ /**
+ * Perform one step of the
+ * Jacobi iteration.
+ */
+ template <typename number2>
+ void Tstep (Vector<number2>& dst, const Vector<number2>& rhs) const;
+};
+
+
/**
* Block Gauss-Seidel method with possibly overlapping blocks.
*
// $Id$
// Version: $Name$
//
-// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010 by the deal.II authors
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2011 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
#include <deal.II/lac/relaxation_block.h>
#include <deal.II/lac/full_matrix.h>
+#include <lac/vector_memory.h>
DEAL_II_NAMESPACE_OPEN
}
+//----------------------------------------------------------------------//
+
+template <class MATRIX, typename inverse_type>
+template <typename number2>
+void RelaxationBlockJacobi<MATRIX,inverse_type>::step (
+ Vector<number2> &dst,
+ const Vector<number2> &src) const
+{
+ GrowingVectorMemory<Vector<number2> > mem;
+ typename VectorMemory<Vector<number2> >::Pointer aux = mem;
+ aux->reinit(dst, false);
+ *aux = dst;
+ this->do_step(dst, *aux, src, false);
+}
+
+
+template <class MATRIX, typename inverse_type>
+template <typename number2>
+void RelaxationBlockJacobi<MATRIX,inverse_type>::Tstep (
+ Vector<number2> &dst,
+ const Vector<number2> &src) const
+{
+ GrowingVectorMemory<Vector<number2> > mem;
+ typename VectorMemory<Vector<number2> >::Pointer aux = mem;
+ aux->reinit(dst, false);
+ *aux = dst;
+ this->do_step(dst, *aux, src, true);
+}
+
+
//----------------------------------------------------------------------//
template <class MATRIX, typename inverse_type>
}
+//----------------------------------------------------------------------//
+
template <class MATRIX, typename inverse_type>
template <typename number2>
void RelaxationBlockSSOR<MATRIX,inverse_type>::step (
//---------------------------------------------------------------------------
// $Id$
//
-// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2009, 2010 by the deal.II authors
+// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007, 2009, 2010, 2011 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
for (S1, S2 : REAL_SCALARS)
{
template class RelaxationBlock<SparseMatrix<S1>, S2>;
+ template class RelaxationBlockJacobi<SparseMatrix<S1>, S2>;
template class RelaxationBlockSOR<SparseMatrix<S1>, S2>;
template class RelaxationBlockSSOR<SparseMatrix<S1>, S2>;
}
for (S1, S2, S3 : REAL_SCALARS)
{
+// ------------ RelaxationBlockJacobi -----------------
+ template
+ void RelaxationBlockJacobi<SparseMatrix<S1>, S2>::step<S3>
+ (Vector<S3> &, const Vector<S3> &) const;
+ template
+ void RelaxationBlockJacobi<SparseMatrix<S1>, S2>::Tstep<S3>
+ (Vector<S3> &, const Vector<S3> &) const;
+
// ------------ RelaxationBlockSOR -----------------
template
void RelaxationBlockSOR<SparseMatrix<S1>, S2>::step<S3>