#include <deal.II/base/subscriptor.h>
#include <deal.II/base/exceptions.h>
#include <deal.II/base/logstream.h>
+#include <deal.II/base/utilities.h>
#include <cstddef>
#include <vector>
*/
size_type block_size (const unsigned int i) const;
+ /**
+ * String representation of the block sizes. The output is of the
+ * form `[nb->b1,b2,b3|s]`, where `nb` is n_blocks(), `s`
+ * is total_size() and `b1` etc. are the values of block_size().
+ */
+ std::string to_string () const;
+
//@}
/**
+inline
+std::string
+BlockIndices::to_string () const
+{
+ std::string result = "[" + Utilities::int_to_string(n_blocks) + "->";
+ for (unsigned int i=0; i<n_blocks; ++i)
+ {
+ if (i>0)
+ result += ',';
+ result += Utilities::int_to_string(block_size(i));
+ }
+ result += "|" + Utilities::int_to_string(total_size()) + ']';
+ return result;
+}
+
+
+
inline
BlockIndices::size_type
BlockIndices::block_start (const unsigned int block) const
for (unsigned i=0; i<n; ++i)
deallog << ' ' << idx.block_start(i);
- deallog << std::endl;
+ deallog << std::endl << "string: " << idx.to_string() << std::endl;
for (unsigned int i=0; i<idx.total_size(); ++i)
{
DEAL::empty: 0:[]->0
DEAL::sizes: 3:[0 0 0]->0
DEAL::start: 0 0 0
+DEAL::string: [3->0,0,0|0]
DEAL::
DEAL::
DEAL::sizes: 3:[4 4 4]->12
DEAL::start: 0 4 8
+DEAL::string: [3->4,4,4|12]
DEAL:: 0:0:0 1:0:1 2:0:2 3:0:3 4:1:0 5:1:1 6:1:2 7:1:3 8:2:0 9:2:1 10:2:2 11:2:3
DEAL:: 0:0:0 1:0:1 2:0:2 3:0:3 4:1:0 5:1:1 6:1:2 7:1:3 8:2:0 9:2:1 10:2:2 11:2:3
DEAL::push: 4:[4 4 4 2]->14
DEAL::push: 5:[4 4 4 2 5]->19
DEAL::sizes: 6:[4 4 4 2 5 4]->23
DEAL::start: 0 4 8 12 14 19
+DEAL::string: [6->4,4,4,2,5,4|23]
DEAL:: 0:0:0 1:0:1 2:0:2 3:0:3 4:1:0 5:1:1 6:1:2 7:1:3 8:2:0 9:2:1 10:2:2 11:2:3 12:3:0 13:3:1 14:4:0 15:4:1 16:4:2 17:4:3 18:4:4 19:5:0 20:5:1 21:5:2 22:5:3
DEAL:: 0:0:0 1:0:1 2:0:2 3:0:3 4:1:0 5:1:1 6:1:2 7:1:3 8:2:0 9:2:1 10:2:2 11:2:3 12:3:0 13:3:1 14:4:0 15:4:1 16:4:2 17:4:3 18:4:4 19:5:0 20:5:1 21:5:2 22:5:3
DEAL::sizes: 4:[4 3 2 1]->10
DEAL::start: 0 4 7 9
+DEAL::string: [4->4,3,2,1|10]
DEAL:: 0:0:0 1:0:1 2:0:2 3:0:3 4:1:0 5:1:1 6:1:2 7:2:0 8:2:1 9:3:0
DEAL:: 0:0:0 1:0:1 2:0:2 3:0:3 4:1:0 5:1:1 6:1:2 7:2:0 8:2:1 9:3:0