From: guido Date: Thu, 17 Jan 2002 20:46:28 +0000 (+0000) Subject: discontinuous output X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2d36452939adbc55a6be25ba837b5f634f9008c7;p=dealii-svn.git discontinuous output git-svn-id: https://svn.dealii.org/trunk@5389 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/matrix_out.h b/deal.II/lac/include/lac/matrix_out.h index 1b12d09409..4ce9c56e00 100644 --- a/deal.II/lac/include/lac/matrix_out.h +++ b/deal.II/lac/include/lac/matrix_out.h @@ -98,6 +98,12 @@ class MatrixOut : public DataOutInterface<2,2> */ unsigned int block_size; + /** + * If true, plot discontinuous + * patches, one for each entry. + **/ + bool discontinuous; + /** * Default constructor. Set * all elements of this @@ -105,7 +111,8 @@ class MatrixOut : public DataOutInterface<2,2> * values. */ Options (const bool show_absolute_values = false, - const unsigned int block_size = 1); + const unsigned int block_size = 1, + const bool discontinuous = false); }; /** @@ -337,23 +344,31 @@ MatrixOut::build_patches (const Matrix &matrix, const std::string &name, const Options &options) { - const unsigned int + unsigned int gridpoints_x = (matrix.n() / options.block_size + (matrix.n() % options.block_size != 0 ? 1 : 0)), gridpoints_y = (matrix.m() / options.block_size + (matrix.m() % options.block_size != 0 ? 1 : 0)); - + + // If continuous, the number of + // plotted patches is matrix size-1 + if (!options.discontinuous) + { + --gridpoints_x; + --gridpoints_y; + } + // first clear old data and set it // to virgin state patches.clear (); - patches.resize ((gridpoints_x-1) * (gridpoints_y-1)); + patches.resize ((gridpoints_x) * (gridpoints_y)); // now build the patches unsigned int index=0; - for (unsigned int i=0; i