]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Added some of the probably more important parameters to
authoroliver <oliver@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 27 Jul 2004 14:08:49 +0000 (14:08 +0000)
committeroliver <oliver@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 27 Jul 2004 14:08:49 +0000 (14:08 +0000)
the class PreconditionLU.

git-svn-id: https://svn.dealii.org/trunk@9521 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/petsc_precondition.h
deal.II/lac/source/petsc_precondition.cc

index 510fad9603b2206cb74ae70e07badb92b08d2709..24a41a32dbc868df523e3f94ce5a47a5822f0ba3 100644 (file)
@@ -533,9 +533,38 @@ namespace PETScWrappers
       struct AdditionalData
       {
                                            /**
-                                            * Constructor. 
+                                            * Constructor. (Default values
+                                           * taken from function PCCreate_LU
+                                           * of the PetSC lib.)
                                             */
-          AdditionalData ();
+          AdditionalData (const double pivoting = 1.e-6,
+                         const double zero_pivot = 1.e-12,
+                         const double damping = 0.0);
+
+                                           /**
+                                            * Determines, when Pivoting is
+                                           * done during LU decomposition.
+                                           * 0.0 indicates no pivoting,
+                                           * and 1.0 complete pivoting.
+                                           * Confer PetSC manual for more
+                                           * details.
+                                            */
+          double pivoting;
+
+                                           /**
+                                            * Size at which smaller pivots
+                                           * are declared to be zero.
+                                           * Confer PetSC manual for more
+                                           * details.
+                                           */
+         double zero_pivot;                                        
+
+                                           /**
+                                            * This quantity is added to the
+                                           * diagonal of the matrix during
+                                           * factorisation.
+                                           */
+         double damping;
       };
 
                                        /**
@@ -550,7 +579,8 @@ namespace PETScWrappers
                                         * generates a compiler fault.
                                         */
       PreconditionLU (const MatrixBase     &matrix,
-                     const AdditionalData &additional_data = AdditionalData());
+                     const AdditionalData &additional_data = 
+                     AdditionalData(1.e-6, 1.e-12, 0.0));
       
     protected:
                                        /**
index 836d439622850bb956e26811a140a6fb165a395d..542257393b5c6f1d6893c8a92ec7f7bdeaf2a8a8 100644 (file)
@@ -259,7 +259,13 @@ namespace PETScWrappers
 /* ----------------- PreconditionLU -------------------- */
 
   PreconditionLU::AdditionalData::
-  AdditionalData ()
+  AdditionalData (const double pivoting,
+                 const double zero_pivot,
+                 const double damping)
+                  :
+                  pivoting (pivoting),
+                  zero_pivot (zero_pivot),
+                 damping (damping)
   {}
 
   
@@ -279,6 +285,16 @@ namespace PETScWrappers
                                      // preconditioner
     int ierr;
     ierr = PCSetType (pc, const_cast<char *>(PCLU));
+    AssertThrow (ierr == 0, ExcPETScError(ierr));
+
+                                     // set flags as given
+    ierr = PCLUSetPivoting (pc, additional_data.pivoting);
+    AssertThrow (ierr == 0, ExcPETScError(ierr));
+
+    ierr = PCLUSetZeroPivot (pc, additional_data.zero_pivot);
+    AssertThrow (ierr == 0, ExcPETScError(ierr));
+
+    ierr = PCLUSetDamping (pc, additional_data.damping);
     AssertThrow (ierr == 0, ExcPETScError(ierr));
   }
   

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.