From 368ba4ae7a1df34733601b5bfd344acbcfc8605c Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 24 Jun 2009 16:54:18 +0000 Subject: [PATCH] Add a forgotten implementation of a function (this fixes trilinos/49a). git-svn-id: https://svn.dealii.org/trunk@18966 0785d39b-7218-0410-832d-ea1e28bc413d --- .../lac/include/lac/trilinos_block_vector.h | 44 ++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) 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 -- 2.39.5