]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
New test.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 1 Jun 2010 21:17:48 +0000 (21:17 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 1 Jun 2010 21:17:48 +0000 (21:17 +0000)
git-svn-id: https://svn.dealii.org/trunk@21142 0785d39b-7218-0410-832d-ea1e28bc413d

tests/base/data_out_base_pvtu.cc [new file with mode: 0644]
tests/base/data_out_base_pvtu/cmp/generic [new file with mode: 0644]

diff --git a/tests/base/data_out_base_pvtu.cc b/tests/base/data_out_base_pvtu.cc
new file mode 100644 (file)
index 0000000..cdf834a
--- /dev/null
@@ -0,0 +1,79 @@
+//-----------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 2006, 2007, 2010 by the deal.II authors
+//
+//    This file is subject to QPL and may not be  distributed
+//    without copyright and license information. Please refer
+//    to the file deal.II/doc/license.html for the  text  and
+//    further information on this license.
+//
+//-----------------------------------------------------------------------------
+
+// write the pvtu master record for parallel visualization through the
+// vtu file format
+
+#include "../tests.h"
+#include <base/data_out_base.h>
+#include <base/logstream.h>
+
+#include <vector>
+#include <iomanip>
+#include <fstream>
+#include <string>
+#include <stdio.h>
+
+#include "patches.h"
+
+
+
+std::vector<DataOutBase::Patch<2,2> > patches;
+std::vector<std::string> names;
+
+class DataOutX : public DataOutInterface<2,2>
+{
+    virtual
+    const std::vector< ::DataOutBase::Patch<2,2> > &
+    get_patches () const
+      {
+       return patches;
+      }
+
+    virtual
+    std::vector<std::string>
+    get_dataset_names () const
+      {
+       return names;
+      }
+};
+
+
+template <int dim, int spacedim>
+void check(std::ostream& out)
+{
+  const unsigned int np = 4;
+  patches.resize (np);
+
+  create_patches(patches);
+
+  names.resize (5);
+  names[0] = "x1";
+  names[1] = "x2";
+  names[2] = "x3";
+  names[3] = "x4";
+  names[4] = "i";
+
+  std::vector<std::string> filenames = names;
+
+  DataOutX x;
+  x.write_pvtu_record (out, filenames);
+}
+
+
+
+int main()
+{
+  std::ofstream logfile("data_out_base_pvtu/output");
+  check<2,2>(logfile);
+}
diff --git a/tests/base/data_out_base_pvtu/cmp/generic b/tests/base/data_out_base_pvtu/cmp/generic
new file mode 100644 (file)
index 0000000..991bbf0
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0"?> 
+<!-- 
+#This file was generated 
+ --> 
+<VTKFile type="PUnstructuredGrid" version="0.1" byte_order="LittleEndian"> 
+  <PUnstructuredGrid GhostLevel="0"> 
+    <PPointData Scalars="scalars"> 
+    <PDataArray type="Float32" Name="x1" format="ascii"/> 
+    <PDataArray type="Float32" Name="x2" format="ascii"/> 
+    <PDataArray type="Float32" Name="x3" format="ascii"/> 
+    <PDataArray type="Float32" Name="x4" format="ascii"/> 
+    <PDataArray type="Float32" Name="i" format="ascii"/> 
+    </PPointData> 
+    <PPoints> 
+      <PDataArray type="Float32" NumberOfComponents="3"/> 
+    </PPoints> 
+    <Piece Source="x1"/> 
+    <Piece Source="x2"/> 
+    <Piece Source="x3"/> 
+    <Piece Source="x4"/> 
+    <Piece Source="i"/> 
+  </PUnstructuredGrid> 
+</VTKFile> 

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.