From: kanschat Date: Sat, 25 May 2013 07:27:26 +0000 (+0000) Subject: prepare transfer for Trilinos matrices X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c033021ef9ec51385d913b4322306673999a7686;p=dealii-svn.git prepare transfer for Trilinos matrices git-svn-id: https://svn.dealii.org/trunk@29581 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/multigrid/mg_transfer.h b/deal.II/include/deal.II/multigrid/mg_transfer.h index 8ea9888b27..612424573b 100644 --- a/deal.II/include/deal.II/multigrid/mg_transfer.h +++ b/deal.II/include/deal.II/multigrid/mg_transfer.h @@ -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 Matrix; + + template + 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 + 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 + static void reinit(Matrix& matrix, Sparsity& sparsity, int level, const CSP& csp, DH& dh) + { + } }; #endif } diff --git a/deal.II/source/multigrid/mg_transfer_prebuilt.cc b/deal.II/source/multigrid/mg_transfer_prebuilt.cc index de6e664ef8..1ae25aab42 100644 --- a/deal.II/source/multigrid/mg_transfer_prebuilt.cc +++ b/deal.II/source/multigrid/mg_transfer_prebuilt.cc @@ -175,10 +175,13 @@ void MGTransferPrebuilt::build_matrices ( } } } - - prolongation_sparsities[level]->copy_from (csp); + + internal::MatrixSelector::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::cell_iterator cell=mg_dof.begin(level);