]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
prepare transfer for Trilinos matrices
authorkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 25 May 2013 07:27:26 +0000 (07:27 +0000)
committerkanschat <kanschat@0785d39b-7218-0410-832d-ea1e28bc413d>
Sat, 25 May 2013 07:27:26 +0000 (07:27 +0000)
git-svn-id: https://svn.dealii.org/trunk@29581 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/include/deal.II/multigrid/mg_transfer.h
deal.II/source/multigrid/mg_transfer_prebuilt.cc

index 8ea9888b270dde2609dd363708e1fd3501f1bb34..612424573b9d71d29bcb1e74c2786f4f85ebe499 100644 (file)
@@ -1,7 +1,7 @@
 //---------------------------------------------------------------------------
 //    $Id$
 //
-//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2012 by the deal.II authors
+//    Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009, 2010, 2012, 2013 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -43,6 +43,13 @@ namespace internal
   {
     typedef ::dealii::SparsityPattern Sparsity;
     typedef ::dealii::SparseMatrix<typename VECTOR::value_type> Matrix;
+    
+    template <class CSP, class DH>
+    static void reinit(Matrix& matrix, Sparsity& sparsity, int level, const CSP& csp, const DH&)
+    {
+      sparsity.copy_from (csp);
+      matrix.reinit (sparsity);
+    }
   };
 
 #ifdef DEAL_II_WITH_TRILINOS
@@ -51,6 +58,15 @@ namespace internal
   {
     typedef ::dealii::TrilinosWrappers::SparsityPattern Sparsity;
     typedef ::dealii::TrilinosWrappers::SparseMatrix Matrix;
+    
+    template <class CSP, class DH>
+    static void reinit(Matrix& matrix, Sparsity& sparsity, int level, const CSP& csp, DH& dh)
+    {
+      matrix.reinit(dh.locally_owned_mg_dofs(level+1),
+                   dh.locally_owned_mg_dofs(level),
+                   csp, MPI_COMM_WORLD, true);
+    }
+    
   };
 
   template <>
@@ -58,6 +74,11 @@ namespace internal
   {
     typedef ::dealii::TrilinosWrappers::SparsityPattern Sparsity;
     typedef ::dealii::TrilinosWrappers::SparseMatrix Matrix;
+    
+    template <class CSP, class DH>
+    static void reinit(Matrix& matrix, Sparsity& sparsity, int level, const CSP& csp, DH& dh)
+    {
+    }
   };
 #endif
 }
index de6e664ef851db77e82423313878fefb840ff610..1ae25aab42311219325ac47359ad99a6db20a6f4 100644 (file)
@@ -175,10 +175,13 @@ void MGTransferPrebuilt<VECTOR>::build_matrices (
                   }
               }
           }
-
-      prolongation_sparsities[level]->copy_from (csp);
+      
+      internal::MatrixSelector<VECTOR>::reinit(*prolongation_matrices[level],
+                                              *prolongation_sparsities[level],
+                                              level,
+                                              csp,
+                                              mg_dof);
       csp.reinit(0,0);
-      prolongation_matrices[level]->reinit (*prolongation_sparsities[level]);
 
       // now actually build the matrices
       for (typename DoFHandler<dim,spacedim>::cell_iterator cell=mg_dof.begin(level);

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.