]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
make_block_vector: takes a vector, converts it to a block vector.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 3 Apr 2003 23:11:14 +0000 (23:11 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 3 Apr 2003 23:11:14 +0000 (23:11 +0000)
git-svn-id: https://svn.dealii.org/trunk@7356 0785d39b-7218-0410-832d-ea1e28bc413d

tests/bits/data_out_common.cc

index cb50d4ba987eaf1d4fbcc0d36cd8265a64cd27b1..80b4c25976a65ee8b1f1f9f64a6d16aea6f13283 100644 (file)
@@ -16,6 +16,7 @@
 
 #include <base/logstream.h>
 #include <lac/vector.h>
+#include <lac/block_vector.h>
 #include <grid/tria.h>
 #include <grid/tria_iterator.h>
 #include <grid/grid_generator.h>
@@ -45,7 +46,21 @@ check_this (const DoFHandler<dim> &dof_handler,
 // forward declaration of a variable with the name of the output file
 extern std::string output_file_name;
 
-  
+
+// take a vector, and make a block vector out of it
+void
+make_block_vector (const Vector<double> &in,
+                   BlockVector<double>  &out)
+{
+  std::vector<unsigned int> block_sizes(2);
+  block_sizes[0] = in.size() / 2;
+  block_sizes[1] = in.size() - block_sizes[0];
+
+  out.reinit (block_sizes);
+  std::copy (in.begin(), in.end(), out.begin());
+}
+
+
 
 
 template <int dim>

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.