From: bangerth Date: Wed, 24 Jun 2009 16:55:58 +0000 (+0000) Subject: Take over patch 18966 from mainline. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b07a2781d4af03475dff92ab4622c164115e4b16;p=dealii-svn.git Take over patch 18966 from mainline. git-svn-id: https://svn.dealii.org/branches/releases/Branch-6-2@18967 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/trilinos_block_vector.h b/deal.II/lac/include/lac/trilinos_block_vector.h index cf313ad4fe..845399c8a0 100644 --- a/deal.II/lac/include/lac/trilinos_block_vector.h +++ b/deal.II/lac/include/lac/trilinos_block_vector.h @@ -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 @@ -399,6 +399,27 @@ namespace TrilinosWrappers + template + BlockVector & + BlockVector::operator = (const ::dealii::BlockVector &v) + { + if (n_blocks() != v.n_blocks()) + { + std::vector block_sizes (v.n_blocks(), 0); + block_indices.reinit (block_sizes); + if (components.size() != n_blocks()) + components.resize(n_blocks()); + } + + for (unsigned int i=0; in_blocks(); ++i) + this->components[i] = v.block(i); + + collect_sizes(); + + return *this; + } + + inline void BlockVector::swap (BlockVector &v) @@ -851,6 +872,27 @@ namespace TrilinosWrappers } + template + BlockVector & + BlockVector::operator = (const ::dealii::BlockVector &v) + { + if (n_blocks() != v.n_blocks()) + { + std::vector block_sizes (v.n_blocks(), 0); + block_indices.reinit (block_sizes); + if (components.size() != n_blocks()) + components.resize(n_blocks()); + } + + for (unsigned int i=0; in_blocks(); ++i) + this->components[i] = v.block(i); + + collect_sizes(); + + return *this; + } + + /** * Global function which overloads the default implementation * of the C++ standard library which uses a temporary object. The