]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Changed the notation null_space into constant_modes to make the preconditioner class...
authorkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 21 Oct 2008 12:16:03 +0000 (12:16 +0000)
committerkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 21 Oct 2008 12:16:03 +0000 (12:16 +0000)
git-svn-id: https://svn.dealii.org/trunk@17287 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/trilinos_precondition.h
deal.II/lac/include/lac/trilinos_precondition_block.h
deal.II/lac/source/trilinos_precondition.cc
deal.II/lac/source/trilinos_precondition_block.cc

index 4bf72807fec6133bed19bb0dc4120d537b3e1955..ca32752a89cdd4605393987b6e8bb4ff62c2a9b9 100755 (executable)
@@ -31,7 +31,7 @@
 #endif
 #include <Epetra_Map.h>
 
-#include <Teuchos_RefCountPtr.hpp>
+#include <Teuchos_RCP.hpp>
 #include <Epetra_Operator.h>
 
 // forward declarations
@@ -998,7 +998,7 @@ namespace TrilinosWrappers
        AdditionalData (const bool                             elliptic = true,
                        const bool                             higher_order_elements = false,
                        const double                           aggregation_threshold = 1e-4,
-                       const std::vector<std::vector<bool> > &null_space = std::vector<std::vector<bool> > (1),
+                       const std::vector<std::vector<bool> > &constant_modes = std::vector<std::vector<bool> > (1),
                        const unsigned int                     smoother_overlap = 0,
                        const bool                             output_details = false);
 
@@ -1056,7 +1056,7 @@ namespace TrilinosWrappers
                                        * consists of ones) or on a
                                        * vector-valued equation.
                                        */
-       std::vector<std::vector<bool> > null_space;
+       std::vector<std::vector<bool> > constant_modes;
 
                                       /**
                                        * Determines the overlap in
index ce54090a1f41d1939cacf9094d189859385fab02..ae4909388aef1a0bdc9c6adbea34bb143175308e 100644 (file)
@@ -23,7 +23,7 @@
 
 #ifdef DEAL_II_USE_TRILINOS
 
-#include <Teuchos_RefCountPtr.hpp>
+#include <Teuchos_RCP.hpp>
 #include <Thyra_LinearOperatorDecl.hpp>
 #include <Epetra_Operator.h>
 
@@ -160,7 +160,7 @@ namespace TrilinosWrappers
                                        */
        AdditionalData (const bool          right_preconditioning = false,
                        const bool          Av_is_symmetric = true,
-                       const std::vector<std::vector<bool> > &Av_null_space = std::vector<std::vector<bool> > (1),
+                       const std::vector<std::vector<bool> > &Av_constant_modes = std::vector<std::vector<bool> > (1),
                        const double        inner_solve_tolerance = 1e-9,
                        const bool          use_ssor_on_mass_matrix = false,
                        const bool          velocity_uses_higher_order_elements = false,
@@ -207,7 +207,7 @@ namespace TrilinosWrappers
                                        * DoFTools::extract_constant_modes()
                                        * function.
                                        */
-       std::vector<std::vector<bool> > Av_null_space;
+       std::vector<std::vector<bool> > Av_constant_modes;
 
                                       /**
                                        * Tolerance level that the
index f3d317d09b2ed2d90bee7e56ebb95c67941ef4e0..5545321c48ea0887eb20e7966afcf04f47dc9d35 100755 (executable)
@@ -74,20 +74,22 @@ namespace TrilinosWrappers
   }
 
 
-
                                        // For the implementation of
                                        // the <code>vmult</code>
-                                       // function we note that
+                                       // function with deal.II data
+                                       // structures we note that
                                        // invoking a call of the
                                        // Trilinos preconditioner
                                        // requires us to use Epetra
-                                       // vectors as well. It is
-                                       // faster to provide a view,
-                                       // i.e., feed Trilinos with a
+                                       // vectors as well. We do this
+                                       // by providing a view, i.e.,
+                                       // feed Trilinos with a
                                        // pointer to the data, so we
                                        // avoid copying the content
                                        // of the vectors during the
-                                       // iteration. In the
+                                       // iteration (this function is
+                                       // only useful when used in
+                                       // serial anyway). In the
                                        // declaration of the right
                                        // hand side, we need to cast
                                        // the source vector (that is
@@ -415,14 +417,14 @@ namespace TrilinosWrappers
   AdditionalData (const bool                             elliptic,
                  const bool                             higher_order_elements,
                  const double                           aggregation_threshold,
-                 const std::vector<std::vector<bool> > &null_space,
+                 const std::vector<std::vector<bool> > &constant_modes,
                  const unsigned int                     smoother_overlap,
                  const bool                             output_details)
                   :
                   elliptic (elliptic),
                  higher_order_elements (higher_order_elements),
                  aggregation_threshold (aggregation_threshold),
-                 null_space (null_space),
+                 constant_modes (constant_modes),
                  smoother_overlap (smoother_overlap),
                  output_details (output_details)
   {}
@@ -437,7 +439,8 @@ namespace TrilinosWrappers
     multilevel_operator.release();
 
     const unsigned int n_rows = matrix.m();
-    const unsigned int null_space_dimension = additional_data.null_space.size();
+    const unsigned int constant_modes_dimension = 
+      additional_data.constant_modes.size();
 
                                        // Build the AMG preconditioner.
     Teuchos::ParameterList parameter_list;
@@ -470,16 +473,17 @@ namespace TrilinosWrappers
 
     const Epetra_Map * domain_map = &(matrix.matrix->DomainMap());
     
-    Epetra_MultiVector null_space_modes (*domain_map, null_space_dimension);
+    Epetra_MultiVector distributed_constant_modes (*domain_map, 
+                                                  constant_modes_dimension);
   
-    if (null_space_dimension > 1)
+    if (constant_modes_dimension > 1)
       {
-       Assert (n_rows == additional_data.null_space[0].size(),
+       Assert (n_rows == additional_data.constant_modes[0].size(),
                ExcDimensionMismatch(n_rows,
-                                    additional_data.null_space[0].size()));
-       Assert (n_rows == (unsigned int)null_space_modes.GlobalLength(),
+                                    additional_data.constant_modes[0].size()));
+       Assert (n_rows == (unsigned int)distributed_constant_modes.GlobalLength(),
                ExcDimensionMismatch(n_rows,
-                                    null_space_modes.GlobalLength()));
+                                    distributed_constant_modes.GlobalLength()));
 
        const unsigned int my_size = domain_map->NumMyElements();
        Assert (my_size == (unsigned int)domain_map->MaxLID()+1,
@@ -489,17 +493,19 @@ namespace TrilinosWrappers
                                        // contiguous vector of
                                        // doubles so that Trilinos
                                        // can read from it.
-       for (unsigned int d=0; d<null_space_dimension; ++d)
+       for (unsigned int d=0; d<constant_modes_dimension; ++d)
          for (unsigned int row=0; row<my_size; ++row)
            {
              int global_row_id = domain_map->GID(row);
-             null_space_modes.ReplaceMyValue(row, d, 
-                                (double)additional_data.null_space[d][global_row_id]);
+             distributed_constant_modes.ReplaceMyValue(row, d, 
+                      (double)additional_data.constant_modes[d][global_row_id]);
            }
   
        parameter_list.set("null space: type", "pre-computed");
-       parameter_list.set("null space: dimension", null_space_modes.NumVectors());
-       parameter_list.set("null space: vectors", null_space_modes.Values());
+       parameter_list.set("null space: dimension", 
+                          distributed_constant_modes.NumVectors());
+       parameter_list.set("null space: vectors", 
+                          distributed_constant_modes.Values());
       }
 
     multilevel_operator = Teuchos::rcp (new ML_Epetra::MultiLevelPreconditioner(
@@ -508,7 +514,7 @@ namespace TrilinosWrappers
     if (additional_data.output_details)
       multilevel_operator->PrintUnused(0);
 
-    preconditioner = Teuchos::rcp (&*multilevel_operator);
+    preconditioner = Teuchos::rcp (&*multilevel_operator, false);
   }
 
 
index 3a4c8374006c4162bd26b95f4d16a5e26ac355af..b2e6b0cec2134637159b6301184730fb66484ccf 100755 (executable)
@@ -173,7 +173,7 @@ namespace TrilinosWrappers
   PreconditionStokes::AdditionalData::
   AdditionalData (const bool          right_preconditioning,
                  const bool          Av_is_symmetric,
-                 const std::vector<std::vector<bool> > &Av_null_space,
+                 const std::vector<std::vector<bool> > &Av_constant_modes,
                  const double        inner_solve_tolerance,
                  const bool          use_ssor_on_mass_matrix,
                  const bool          velocity_uses_higher_order_elements,
@@ -185,7 +185,7 @@ namespace TrilinosWrappers
                   :
                   right_preconditioning (right_preconditioning),
                   Av_is_symmetric (Av_is_symmetric),
-                 Av_null_space (Av_null_space),
+                 Av_constant_modes (Av_constant_modes),
                  inner_solve_tolerance (inner_solve_tolerance),
                  use_ssor_on_mass_matrix (use_ssor_on_mass_matrix),
                  velocity_uses_higher_order_elements (velocity_uses_higher_order_elements),
@@ -238,7 +238,7 @@ namespace TrilinosWrappers
       PreconditionAMG::AdditionalData av_amg_data;
       av_amg_data.elliptic = additional_data.Av_is_symmetric;
       av_amg_data.higher_order_elements = additional_data.velocity_uses_higher_order_elements;
-      av_amg_data.null_space = additional_data.Av_null_space;
+      av_amg_data.constant_modes = additional_data.Av_constant_modes;
 
       if (Av_matrix.m() == system_matrix.block(0,0).m())
        Av_precondition->initialize (Av_matrix, av_amg_data);

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.