]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
shift argument to merge_patches.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 1 Jul 2003 00:52:12 +0000 (00:52 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 1 Jul 2003 00:52:12 +0000 (00:52 +0000)
git-svn-id: https://svn.dealii.org/trunk@7820 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/numerics/data_out.h
deal.II/deal.II/source/numerics/data_out.cc

index da37b64190dadbad5e77f86926b65c4849a59292..cfc53da39d7f5f6001d8900e94e283d4e52a465e 100644 (file)
@@ -386,12 +386,22 @@ class DataOut_DoFData : public DataOutInterface<patch_dim,patch_space_dim>
                                       * 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<patch_space_dim> &shift = Point<patch_space_dim>());
     
                                     /**
                                      * Release the pointers to the
index b1f19c8cc6e820c56d76da2297642b3955ab238b..0fb47ba80c663715a13cef5ab1ad9fe3fb68cc63 100644 (file)
@@ -260,7 +260,8 @@ clear_input_data_references ()
 template <int dof_handler_dim, int patch_dim, int patch_space_dim>
 void
 DataOut_DoFData<dof_handler_dim,patch_dim,patch_space_dim>::
-merge_patches (const DataOut_DoFData &source)
+merge_patches (const DataOut_DoFData        &source,
+              const Point<patch_space_dim> &shift)
 {
   const std::vector<Patch> 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<patch_space_dim>())
+    for (unsigned int i=old_n_patches; i<patches.size(); ++i)
+      for (unsigned int v=0; v<GeometryInfo<patch_dim>::vertices_per_cell; ++v)
+       patches[i].vertices[v] += shift;
+  
                                    // adjust patch numbers
   for (unsigned int i=old_n_patches; i<patches.size(); ++i)
     patches[i].patch_index += old_n_patches;
+  
                                    // adjust patch neighbors
   for (unsigned int i=old_n_patches; i<patches.size(); ++i)
     for (unsigned int n=0; n<GeometryInfo<patch_dim>::faces_per_cell; ++n)

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.