From 3e43beaf0955504dc4efcd9e53a23516d216b4fd Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 1 Jul 2003 00:52:12 +0000 Subject: [PATCH] shift argument to merge_patches. git-svn-id: https://svn.dealii.org/trunk@7820 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/numerics/data_out.h | 12 +++++++++++- deal.II/deal.II/source/numerics/data_out.cc | 11 ++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/deal.II/deal.II/include/numerics/data_out.h b/deal.II/deal.II/include/numerics/data_out.h index da37b64190..cfc53da39d 100644 --- a/deal.II/deal.II/include/numerics/data_out.h +++ b/deal.II/deal.II/include/numerics/data_out.h @@ -386,12 +386,22 @@ class DataOut_DoFData : public DataOutInterface * overwritten, and the merged-in * patches are lost. * + * The second parameter allows to + * shift the patches in the + * object passed in in the first + * parameter by a certain + * amount. This is sometimes + * useful to generated "exploded" + * views of a collection of + * blocks. + * * This function will fail if * either this or the other * object did not yet set up any * patches. */ - void merge_patches (const DataOut_DoFData &source); + void merge_patches (const DataOut_DoFData &source, + const Point &shift = Point()); /** * Release the pointers to the diff --git a/deal.II/deal.II/source/numerics/data_out.cc b/deal.II/deal.II/source/numerics/data_out.cc index b1f19c8cc6..0fb47ba80c 100644 --- a/deal.II/deal.II/source/numerics/data_out.cc +++ b/deal.II/deal.II/source/numerics/data_out.cc @@ -260,7 +260,8 @@ clear_input_data_references () template void DataOut_DoFData:: -merge_patches (const DataOut_DoFData &source) +merge_patches (const DataOut_DoFData &source, + const Point &shift) { const std::vector source_patches = source.get_patches (); Assert (patches.size () != 0, ExcNoPatches ()); @@ -285,9 +286,17 @@ merge_patches (const DataOut_DoFData &source) patches.insert (patches.end(), source_patches.begin(), source_patches.end()); + + // perform shift, if so desired + if (shift != Point()) + for (unsigned int i=old_n_patches; i::vertices_per_cell; ++v) + patches[i].vertices[v] += shift; + // adjust patch numbers for (unsigned int i=old_n_patches; i::faces_per_cell; ++n) -- 2.39.5