]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Avoid a problem with Trilinos 10 not having a certain header file.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 3 Sep 2009 19:16:08 +0000 (19:16 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 3 Sep 2009 19:16:08 +0000 (19:16 +0000)
git-svn-id: https://svn.dealii.org/branches/releases/Branch-6-2@19380 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/doc/news/6.2.1-vs-6.2.2.h
deal.II/lac/source/trilinos_precondition_block.cc
deal.II/lac/source/trilinos_solver_block.cc

index b710347b078519010546362bd17bff3ae78788e6..c17acfb81d757e636e8dade9df6f3d34210032bb 100644 (file)
@@ -40,6 +40,15 @@ deal.II version 6.2.0 and version 6.2.1:
     the other processors did not also match exactly. This is now fixed.
     </p>
   </li>
+
+  <li>
+    <p>
+    Fixed: Two of the Trilinos interface files of deal.II included Trilinos header
+    files that have been removed between Trilinos 9.0 and Trilinos 10.0. The
+    result is that deal.II could not be compiled against Trilinos 10 any
+    more. This is now fixed.
+    </p>
+  </li>
 </ol>
 
 
index c3700b545eb7f00555199e96479ecffeb8ccefb9..50013e80cbd83563f9089bfbe78062596cc4612c 100755 (executable)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2008 by the deal.II authors
+//    Copyright (C) 2008, 2009 by the deal.II authors
 //
 //    This file is subject to QPL and may not be distributed
 //    without copyright and license information. Please refer
@@ -23,7 +23,6 @@
 
 #include <Thyra_VectorSpaceImpl.hpp>
 #include <Thyra_LinearOperatorDecl.hpp>
-#include <Thyra_DefaultBlockedLinearOpDecl.hpp>
 #include <Thyra_DefaultBlockedLinearOp.hpp>
 #include <Thyra_LinearOpWithSolveFactoryHelpers.hpp>
 #include <Thyra_InverseLinearOperator.hpp>
@@ -63,26 +62,26 @@ namespace TrilinosWrappers
                                        // Epetra operator
                                        // (Thyra wrapper around the
                                        // matrix).
-    Teuchos::RCP<const Thyra::LinearOpBase<double> > tmpM = 
+    Teuchos::RCP<const Thyra::LinearOpBase<double> > tmpM =
       Thyra::epetraLinearOp(Teuchos::rcp(&input_M.trilinos_matrix(), false));
 
-    Teuchos::RCP<const Thyra::LinearOpSourceBase<double> > M 
+    Teuchos::RCP<const Thyra::LinearOpSourceBase<double> > M
       = Teuchos::rcp(new Thyra::DefaultLinearOpSource<double>(tmpM), true);
 
     //Thyra::ConstLinearOperator<double> opM = tmpM;
 
                                        // Create a Thyra version of
                                        // the preconditioner.
-    Teuchos::RCP<const Thyra::LinearOpBase<double> > tmpP = 
+    Teuchos::RCP<const Thyra::LinearOpBase<double> > tmpP =
       Thyra::epetraLinearOp(Teuchos::rcp(const_cast<Epetra_Operator*>(input_P),
-                                        false), 
+                                        false),
                            Thyra::NOTRANS,
                            Thyra::EPETRA_OP_APPLY_APPLY_INVERSE,
                            Thyra::EPETRA_OP_ADJOINT_SUPPORTED);
-       
+
     //Thyra::ConstLinearOperator<double> opPM = tmpP;
 
-    Teuchos::RCP<Thyra::PreconditionerBase<double> > PM = 
+    Teuchos::RCP<Thyra::PreconditionerBase<double> > PM =
       Teuchos::rcp (new Thyra::DefaultPreconditioner<double>(), true);
 
     {
@@ -94,12 +93,12 @@ namespace TrilinosWrappers
     }
 
                                        // Set up the solver.
-    Teuchos::RCP<Teuchos::ParameterList> aztecParams 
+    Teuchos::RCP<Teuchos::ParameterList> aztecParams
       = Teuchos::rcp(new Teuchos::ParameterList("aztecOOFSolverFactory"), true);
 
-    aztecParams->sublist("Forward Solve").set("Max Iterations", 
+    aztecParams->sublist("Forward Solve").set("Max Iterations",
                                              (int)n_iterations);
-    aztecParams->sublist("Forward Solve").set("Tolerance", 
+    aztecParams->sublist("Forward Solve").set("Tolerance",
                                              solve_tolerance);
 
                                        // aztecOO solver settings
@@ -113,7 +112,7 @@ namespace TrilinosWrappers
        aztecParams->sublist("Forward Solve")
          .sublist("AztecOO Settings").set("Aztec Solver", "GMRES");
        aztecParams->sublist("Forward Solve")
-         .sublist("AztecOO Settings").set("Size of Krylov Subspace", 
+         .sublist("AztecOO Settings").set("Size of Krylov Subspace",
                                           (int)n_iterations);
       }
 
@@ -141,7 +140,7 @@ namespace TrilinosWrappers
 
     aztecLowsFactory->setParameterList(aztecParams);
 
-    Teuchos::RCP<Thyra::LinearOpWithSolveBase<double> > rcpAztec 
+    Teuchos::RCP<Thyra::LinearOpWithSolveBase<double> > rcpAztec
       = aztecLowsFactory->createOp();
 
                                        // Does not work like
@@ -152,20 +151,20 @@ namespace TrilinosWrappers
                                        // side vector, which makes
                                        // the results wrong. So try
                                        // something else...
-    //Meros::LinearSolveStrategy<double> azM 
+    //Meros::LinearSolveStrategy<double> azM
     //  = new Meros::AztecSolveStrategy(*(aztecParams.get()));
-    //Thyra::LinearOperator<double> Minverse 
+    //Thyra::LinearOperator<double> Minverse
     //  = Thyra::inverse(*aztecLowsFactory, opM);
     //return new Meros::InverseOperator<double>(opM * opPM, azM);
 
                                        // Attach the preconditioner
                                        // to the solver.
-    aztecLowsFactory->initializePreconditionedOp(M, PM, &*rcpAztec, 
+    aztecLowsFactory->initializePreconditionedOp(M, PM, &*rcpAztec,
                                                 Thyra::SUPPORT_SOLVE_FORWARD_ONLY);
+
                                        // Create an inverse matrix
                                        // object and return.
-    Teuchos::RCP<const Thyra::LinearOpBase<double> > Minverse = 
+    Teuchos::RCP<const Thyra::LinearOpBase<double> > Minverse =
       Teuchos::rcp(new Thyra::DefaultInverseLinearOp<double>(rcpAztec));
 
     return Minverse;
@@ -266,7 +265,7 @@ namespace TrilinosWrappers
 
   }
 
-  void 
+  void
   PreconditionStokes::initialize (const BlockSparseMatrix  &system_matrix,
                                  const SparseMatrix       &Mp_matrix,
                                  const AdditionalData     &additional_data,
@@ -296,7 +295,7 @@ namespace TrilinosWrappers
       {
        Teuchos::RCP<const Thyra::LinearOpBase<double> >
          tmpAvp = Thyra::epetraLinearOp(Teuchos::rcp(&*Av_preconditioner.preconditioner,
-                                                     false), 
+                                                     false),
                                         Thyra::NOTRANS,
                                         Thyra::EPETRA_OP_APPLY_APPLY_INVERSE,
                                         Thyra::EPETRA_OP_ADJOINT_SUPPORTED);
@@ -305,8 +304,8 @@ namespace TrilinosWrappers
 
 
                                        // Create Mp inverse matrix.
-    Thyra::ConstLinearOperator<double> Mp_inverse 
-      = inverse_matrix(Mp_matrix, &*Mp_preconditioner.preconditioner, true, 
+    Thyra::ConstLinearOperator<double> Mp_inverse
+      = inverse_matrix(Mp_matrix, &*Mp_preconditioner.preconditioner, true,
                       Mp_matrix.m(),
                       additional_data.inner_solve_tolerance,
                       additional_data.output_details);
@@ -320,7 +319,7 @@ namespace TrilinosWrappers
       {
                                        // Create Lp inverse matrix.
        Lp_inverse = inverse_matrix(Lp_matrix, &*Lp_preconditioner.preconditioner,
-                                   true, Lp_matrix.m(), 
+                                   true, Lp_matrix.m(),
                                    additional_data.inner_solve_tolerance,
                                    additional_data.output_details);
       }
@@ -346,9 +345,9 @@ namespace TrilinosWrappers
                                        // Build identity matrices on
                                        // the velocity and pressure
                                        // spaces
-    Thyra::ConstLinearOperator<double> Ivel 
+    Thyra::ConstLinearOperator<double> Ivel
       = Thyra::identity<double>(Av_inverse.range());
-    Thyra::ConstLinearOperator<double> Ipress 
+    Thyra::ConstLinearOperator<double> Ipress
       = Thyra::identity<double>(Mp_inverse.domain());
 
                                        // Build zero operators. Need
@@ -356,7 +355,7 @@ namespace TrilinosWrappers
                                        // velocity and one that is
                                        // velocity x pressure
     Thyra::ConstLinearOperator<double> zero;
-    
+
                                        // Build the composed Schur
                                        // complement approximation
                                        // inverse
@@ -369,13 +368,13 @@ namespace TrilinosWrappers
                                        // Create discrete pressure
                                        // gradient and divergence
                                        // operators in Thyra format.
-    Teuchos::RCP<const Thyra::LinearOpBase<double> > tmpS01 = 
-      Thyra::epetraLinearOp(Teuchos::rcp(&system_matrix.block(0,1).trilinos_matrix(), 
+    Teuchos::RCP<const Thyra::LinearOpBase<double> > tmpS01 =
+      Thyra::epetraLinearOp(Teuchos::rcp(&system_matrix.block(0,1).trilinos_matrix(),
                                         false));
     Thyra::ConstLinearOperator<double> S01 = tmpS01;
 
-    Teuchos::RCP<const Thyra::LinearOpBase<double> > tmpS10 = 
-      Thyra::epetraLinearOp(Teuchos::rcp(&system_matrix.block(1,0).trilinos_matrix(), 
+    Teuchos::RCP<const Thyra::LinearOpBase<double> > tmpS10 =
+      Thyra::epetraLinearOp(Teuchos::rcp(&system_matrix.block(1,0).trilinos_matrix(),
                                         false));
     Thyra::ConstLinearOperator<double> S10 = tmpS10;
 
@@ -386,7 +385,7 @@ namespace TrilinosWrappers
                                        // matrices depending on
                                        // whether we do right or left
                                        // preconditioning.
-    Thyra::ConstLinearOperator<double> P1 
+    Thyra::ConstLinearOperator<double> P1
       = block2x2( Av_inverse, zero, zero, Ipress );
 
     Thyra::ConstLinearOperator<double> P2;
@@ -395,14 +394,14 @@ namespace TrilinosWrappers
     else
       P2 = block2x2( Ivel, zero, (-1.0)*S10, Ipress );
 
-    Thyra::ConstLinearOperator<double> P3 
+    Thyra::ConstLinearOperator<double> P3
       = block2x2( Ivel,   zero, zero, (-1.0)*Xinv );
 
-    if (additional_data.right_preconditioning == true)    
-      preconditioner = Teuchos::rcp (new 
+    if (additional_data.right_preconditioning == true)
+      preconditioner = Teuchos::rcp (new
                       Thyra::ConstLinearOperator<double>(P1 * P2 * P3));
     else
-      preconditioner = Teuchos::rcp (new 
+      preconditioner = Teuchos::rcp (new
                       Thyra::ConstLinearOperator<double>(P3 * P2 * P1));
 
   }
index a9f1ed8faa1762c5ea6d6697244962a74b10ef0a..45e316213943e370fa822798df23f3f12630fec3 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 2008 by the deal.II authors
+//    Copyright (C) 2008, 2009 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -34,7 +34,6 @@
 #include <Thyra_MultiVectorDefaultBase.hpp>
 #include <Thyra_LinearOperatorDecl.hpp>
 #include <Thyra_LinearOperatorImpl.hpp>
-#include <Thyra_DefaultBlockedLinearOpDecl.hpp>
 #include <Thyra_DefaultBlockedLinearOp.hpp>
 #include <Thyra_EpetraLinearOp.hpp>
 #include <Thyra_EpetraThyraWrappers.hpp>
@@ -56,15 +55,15 @@ namespace TrilinosWrappers
                  output_details          (output_details)
   {}
 
-  
-  
+
+
   SolverBlockBase::SolverBlockBase (SolverControl  &cn)
                   :
                   solver_name    (gmres),
                   solver_control (cn)
   {}
 
-  
+
 
   SolverBlockBase::SolverBlockBase (SolverBlockBase::SolverBlockName solver_name,
                                    SolverControl                   &cn)
@@ -73,12 +72,12 @@ namespace TrilinosWrappers
                   solver_control (cn)
   {}
 
-  
+
 
   SolverBlockBase::~SolverBlockBase ()
   {}
 
-  
+
 
   SolverControl &
   SolverBlockBase::control() const
@@ -115,8 +114,8 @@ namespace TrilinosWrappers
     solve (A, tmpx, tmpb, preconditioner);
     x = tmpx;
   }
-  
-    
+
+
 
   void
   SolverBlockBase::solve (const BlockSparseMatrix     &input_A,
@@ -187,16 +186,16 @@ namespace TrilinosWrappers
                                        // abstract Thyra/Stratimikos
                                        // interfaces to the AztecOO
                                        // solver.
-                                       // 
+                                       //
                                        // As a first step, create a
                                        // copy of the vector spaces.
-    std::vector<Teuchos::RCP<const Thyra::VectorSpaceBase<double> > > 
+    std::vector<Teuchos::RCP<const Thyra::VectorSpaceBase<double> > >
       epetra_vector_spaces;
     for (unsigned int i=0; i<n_rows; ++i)
       {
        Teuchos::RCP<const Thyra::VectorSpaceBase<double> > tmp_space
          = Thyra::create_VectorSpace(
-                                     Teuchos::rcp(&input_A.block(i,i).domain_partitioner(), 
+                                     Teuchos::rcp(&input_A.block(i,i).domain_partitioner(),
                                                   false));
 
        epetra_vector_spaces.push_back(tmp_space);
@@ -211,8 +210,8 @@ namespace TrilinosWrappers
     for (unsigned int i=0; i<n_rows; ++i)
       for (unsigned int j=0; j<n_cols; ++j)
        {
-         Teuchos::RCP<const Thyra::LinearOpBase<double> > 
-           A_ij = Thyra::epetraLinearOp(Teuchos::rcp(&input_A.block(i,j).trilinos_matrix(), 
+         Teuchos::RCP<const Thyra::LinearOpBase<double> >
+           A_ij = Thyra::epetraLinearOp(Teuchos::rcp(&input_A.block(i,j).trilinos_matrix(),
                                                      false));
          tmpA->setBlock(i, j, A_ij);
        }
@@ -232,31 +231,31 @@ namespace TrilinosWrappers
        Epetra_Vector *block_ptr = const_cast<Epetra_Vector*>
          ((input_b.block(i).trilinos_vector())(0));
        Teuchos::RCP<Thyra::VectorBase<double> > tmp_rhs_i
-         = Thyra::create_Vector(Teuchos::rcp(block_ptr, false), 
+         = Thyra::create_Vector(Teuchos::rcp(block_ptr, false),
                                 epetra_vector_spaces[i]);
        const Thyra::Vector<double> rhs_i = tmp_rhs_i;
        rhs.setBlock(i, rhs_i);
 
        block_ptr = (input_x.block(i).trilinos_vector())(0);
        Teuchos::RCP<Thyra::VectorBase<double> > tmp_sol_i
-         = Thyra::create_Vector(Teuchos::rcp(block_ptr, false), 
+         = Thyra::create_Vector(Teuchos::rcp(block_ptr, false),
                                 epetra_vector_spaces[i]);
        Thyra::Vector<double> sol_i = tmp_sol_i;
        sol.setBlock(i, sol_i);
       }
 
-    // ------- Now build a solver factory for the block problem ------- 
+    // ------- Now build a solver factory for the block problem -------
 
                                        // Set up a parameter list for
                                        // the AztecOO solver.
-    Teuchos::RCP<Teuchos::ParameterList> aztecBlockParams 
+    Teuchos::RCP<Teuchos::ParameterList> aztecBlockParams
       = rcp(new Teuchos::ParameterList("AztecOO block solver parameters"));
-      
+
                                        // Set the number of
                                        // iterations and the solver
                                        // tolerance from the solver
                                        // control object.
-    aztecBlockParams->sublist("Forward Solve").set("Max Iterations", 
+    aztecBlockParams->sublist("Forward Solve").set("Max Iterations",
                                                   (int)solver_control.max_steps());
     aztecBlockParams->sublist("Forward Solve").set("Tolerance",
                                                    solver_control.tolerance());
@@ -279,7 +278,7 @@ namespace TrilinosWrappers
          aztecBlockParams->sublist("Forward Solve")
                    .sublist("AztecOO Settings").set("Aztec Solver", "GMRES");
          aztecBlockParams->sublist("Forward Solve")
-           .sublist("AztecOO Settings").set("Size of Krylov Subspace", 
+           .sublist("AztecOO Settings").set("Size of Krylov Subspace",
                                             (int)additional_data.gmres_restart_parameter);
          break;
         default:
@@ -296,7 +295,7 @@ namespace TrilinosWrappers
       aztecBlockParams->sublist("Forward Solve")
        .sublist("AztecOO Settings").set("Output Frequency", 1);
     else
-      aztecBlockParams->sublist("VerboseObject").set("Verbosity Level", 
+      aztecBlockParams->sublist("VerboseObject").set("Verbosity Level",
                                                     "none");
 
                                        // Create solve factory from
@@ -307,7 +306,7 @@ namespace TrilinosWrappers
 
     aztecBlockLowsFactory->setParameterList(aztecBlockParams);
 
-    Teuchos::RCP<Thyra::LinearOpWithSolveBase<double> > rcpBlockAztec 
+    Teuchos::RCP<Thyra::LinearOpWithSolveBase<double> > rcpBlockAztec
       = aztecBlockLowsFactory->createOp();
 
 
@@ -316,10 +315,10 @@ namespace TrilinosWrappers
                                        // Extract base operators from
                                        // block matrix A and block
                                        // preconditioner P.
-    Teuchos::RCP<const Thyra::LinearOpSourceBase<double> > A_ptr 
-      = Teuchos::rcp(new Thyra::DefaultLinearOpSource<double>(A.constPtr()), 
+    Teuchos::RCP<const Thyra::LinearOpSourceBase<double> > A_ptr
+      = Teuchos::rcp(new Thyra::DefaultLinearOpSource<double>(A.constPtr()),
                     true);
-    Teuchos::RCP<Thyra::PreconditionerBase<double> > P_ptr = 
+    Teuchos::RCP<Thyra::PreconditionerBase<double> > P_ptr =
       Teuchos::rcp (new Thyra::DefaultPreconditioner<double>(), true);
     {
       Thyra::DefaultPreconditioner<double>
@@ -334,13 +333,13 @@ namespace TrilinosWrappers
                                        // Attach the matrix and the
                                        // preconditioner to the
                                        // solver object.
-    aztecBlockLowsFactory->initializePreconditionedOp(A_ptr, P_ptr, 
-                                                     &*rcpBlockAztec, 
+    aztecBlockLowsFactory->initializePreconditionedOp(A_ptr, P_ptr,
+                                                     &*rcpBlockAztec,
                                                      Thyra::SUPPORT_SOLVE_FORWARD_ONLY);
 
                                        // Now do the solve.
     Thyra::SolveStatus<double>
-      solveStatus = Thyra::solve( *rcpBlockAztec, Thyra::NOTRANS, 
+      solveStatus = Thyra::solve( *rcpBlockAztec, Thyra::NOTRANS,
                                  *rhs.constPtr().get(), &*sol.ptr().get() );
 
                                        // Extract the number of
@@ -350,7 +349,7 @@ namespace TrilinosWrappers
     {
       std::string output_text = solveStatus.message;
       unsigned int position = output_text.find ("using ");
-      const std::pair<int,unsigned int> tmp 
+      const std::pair<int,unsigned int> tmp
        = Utilities::get_integer_at_position (output_text, position+6);
       n_iterations = tmp.first;
     }
@@ -367,11 +366,11 @@ namespace TrilinosWrappers
     solver_control.check (n_iterations, 0);
 
   }
-  
-    
 
 
-  
+
+
+
 /* ------------------------ SolverCG -------------------------- */
 
   SolverBlockCG::AdditionalData::
@@ -382,8 +381,8 @@ namespace TrilinosWrappers
                  output_details          (output_details)
   {}
 
-  
-  
+
+
   SolverBlockCG::SolverBlockCG (SolverControl        &cn,
                                const AdditionalData &data)
                   :
@@ -394,7 +393,7 @@ namespace TrilinosWrappers
     additional_data.right_preconditioning = data.right_preconditioning;
     additional_data.output_details = data.output_details;
   }
-  
+
 
 /* ---------------------- SolverGMRES ------------------------- */
 
@@ -408,7 +407,7 @@ namespace TrilinosWrappers
                  output_details          (output_details)
   {}
 
-  
+
 
   SolverBlockGMRES::SolverBlockGMRES (SolverControl        &cn,
                                      const AdditionalData &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.