From 8b6ca1f8af21e6aca967ea97aeb91d027a9ebfff Mon Sep 17 00:00:00 2001 From: bangerth Date: Tue, 1 Jun 2010 21:17:48 +0000 Subject: [PATCH] New test. git-svn-id: https://svn.dealii.org/trunk@21142 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/base/data_out_base_pvtu.cc | 79 +++++++++++++++++++++++ tests/base/data_out_base_pvtu/cmp/generic | 23 +++++++ 2 files changed, 102 insertions(+) create mode 100644 tests/base/data_out_base_pvtu.cc create mode 100644 tests/base/data_out_base_pvtu/cmp/generic diff --git a/tests/base/data_out_base_pvtu.cc b/tests/base/data_out_base_pvtu.cc new file mode 100644 index 0000000000..cdf834a7d0 --- /dev/null +++ b/tests/base/data_out_base_pvtu.cc @@ -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 +#include + +#include +#include +#include +#include +#include + +#include "patches.h" + + + +std::vector > patches; +std::vector names; + +class DataOutX : public DataOutInterface<2,2> +{ + virtual + const std::vector< ::DataOutBase::Patch<2,2> > & + get_patches () const + { + return patches; + } + + virtual + std::vector + get_dataset_names () const + { + return names; + } +}; + + +template +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 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 index 0000000000..991bbf0c21 --- /dev/null +++ b/tests/base/data_out_base_pvtu/cmp/generic @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + -- 2.39.5