]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Finish implementation of Chebyshev preconditioner.
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Thu, 27 Aug 2009 15:18:38 +0000 (15:18 +0000)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Thu, 27 Aug 2009 15:18:38 +0000 (15:18 +0000)
git-svn-id: https://svn.dealii.org/trunk@19348 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/multigrid/mg_smoother.h
deal.II/doc/news/changes.h
deal.II/lac/include/lac/precondition.h

index c80fe1c8b219c17450d1ac775cd151263fb7af5e..ff47759beff803d17604ab6d486e331c1e211fb1 100644 (file)
@@ -130,6 +130,7 @@ class MGSmoother : public MGSmootherBase<VECTOR>
                                      * nonzero.
                                      */
     unsigned int debug;
+
                                     /**
                                      * Memory for auxiliary vectors.
                                      */
@@ -418,6 +419,8 @@ class MGSmootherRelaxation : public MGSmoother<VECTOR>
 
 };
 
+
+
 /**
  * Smoother using preconditioner classes.
  *
index ef8290ba355964001de2d210b1843b451fc50f19..bc8af7f26c1fac66c46c430825b4d9c5c3891ada 100644 (file)
@@ -305,6 +305,14 @@ inconvenience this causes.
   (GK 2009/08/26)
   </p>
   </li>
+  <li><p> New: The class PreconditionChebyshev implements a 
+  preconditioner based on Chebyshev polynomials. It is based on matrix-vector 
+  products together with some vector updates.
+  <br>
+  (Martin Kronbichler 2009/08/25)
+  </p>
+  </li>
   
   <li>
   <p>
index 1707b0f4502773848d8f4621994dbdb029d266e9..5103538aba64c54f9a5b12c6af4eb4aa9d613821 100644 (file)
@@ -964,6 +964,15 @@ public:
   void vmult (VECTOR       &dst,
              const VECTOR &src) const;
 
+                                      /** 
+                                       * Computes the action of the
+                                       * transposed preconditioner on
+                                       * <tt>src</tt>, storing the result
+                                       * in <tt>dst</tt>.
+                                       */
+  void Tvmult (VECTOR       &dst,
+              const VECTOR &src) const;
+
                                       /**
                                        * Resets the preconditioner.
                                        */
@@ -1670,6 +1679,44 @@ PreconditionChebyshev<MATRIX,VECTOR>::vmult (VECTOR &dst,
 
 
 
+template <class MATRIX, class VECTOR>
+inline
+void 
+PreconditionChebyshev<MATRIX,VECTOR>::Tvmult (VECTOR &dst,
+                                             const VECTOR &src) const
+{
+  Assert (is_initialized, ExcMessage("Preconditioner not initialized"));
+  double rhok  = delta / theta,  sigma = theta / delta;
+  if (data.nonzero_starting && !dst.all_zero())
+    {
+      matrix_ptr->Tvmult (update1, dst);
+      update1 -= src;
+      update1 /= theta;
+      update1.scale (diagonal_inverse);
+      dst -= update1;
+    }
+  else
+    {
+      dst.equ (1./theta, src);
+      dst.scale (diagonal_inverse);
+      update1.equ(-1.,dst);
+    }
+
+  for (unsigned int k=0; k<data.degree-1; ++k)
+    {
+      matrix_ptr->Tvmult (update2, dst);
+      update2 -= src;
+      update2.scale (diagonal_inverse);
+      const double rhokp = 1./(2.*sigma-rhok);
+      const double factor1 = rhokp * rhok, factor2 = 2.*rhokp/delta;
+      rhok = rhokp;
+      update1.sadd (factor1, factor2, update2);
+      dst -= update1;
+    }
+}
+
+
+
 template <class MATRIX, class VECTOR>
 inline
 void PreconditionChebyshev<MATRIX,VECTOR>::clear ()

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.