From f33cec70a11f74a0facde58d6924730e7cde903f Mon Sep 17 00:00:00 2001 From: wolf Date: Thu, 3 Apr 2003 23:11:14 +0000 Subject: [PATCH] make_block_vector: takes a vector, converts it to a block vector. git-svn-id: https://svn.dealii.org/trunk@7356 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/bits/data_out_common.cc | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/bits/data_out_common.cc b/tests/bits/data_out_common.cc index cb50d4ba98..80b4c25976 100644 --- a/tests/bits/data_out_common.cc +++ b/tests/bits/data_out_common.cc @@ -16,6 +16,7 @@ #include #include +#include #include #include #include @@ -45,7 +46,21 @@ check_this (const DoFHandler &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 &in, + BlockVector &out) +{ + std::vector 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 -- 2.39.5