]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Take over patch 18966 from mainline.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 24 Jun 2009 16:55:58 +0000 (16:55 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 24 Jun 2009 16:55:58 +0000 (16:55 +0000)
git-svn-id: https://svn.dealii.org/branches/releases/Branch-6-2@18967 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/include/lac/trilinos_block_vector.h

index cf313ad4fef86888c9ac59b4d941cf69aa4b1023..845399c8a0c58d6aaa3827b9b7b67a2c51025871 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
@@ -399,6 +399,27 @@ namespace TrilinosWrappers
 
 
 
+    template <typename Number>
+    BlockVector &
+    BlockVector::operator = (const ::dealii::BlockVector<Number> &v)
+    {
+      if (n_blocks() != v.n_blocks())
+       {
+         std::vector<unsigned int> 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; i<this->n_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 <typename Number>
+  BlockVector &
+  BlockVector::operator = (const ::dealii::BlockVector<Number> &v)
+  {
+    if (n_blocks() != v.n_blocks())
+      {
+       std::vector<unsigned int> 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; i<this->n_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

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.