From 72c69ff8b2e7f77e4ce24c86bfa785ad60c954f7 Mon Sep 17 00:00:00 2001 From: Guido Kanschat Date: Tue, 4 Apr 2006 14:18:23 +0000 Subject: [PATCH] join tests and change format to opendx git-svn-id: https://svn.dealii.org/trunk@12814 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/bits/data_out_stack_03.cc | 15 +- tests/bits/data_out_stack_03/cmp/generic | 335 +++++++++++++++++++++-- tests/bits/data_out_stack_04.cc | 77 ------ 3 files changed, 324 insertions(+), 103 deletions(-) delete mode 100644 tests/bits/data_out_stack_04.cc diff --git a/tests/bits/data_out_stack_03.cc b/tests/bits/data_out_stack_03.cc index f23937bafa..fc318830f9 100644 --- a/tests/bits/data_out_stack_03.cc +++ b/tests/bits/data_out_stack_03.cc @@ -1,4 +1,4 @@ -//---------------------------- data_out_stack_01.cc --------------------------- +//---------------------------------------------------------------------- // $Id$ // Version: $Name$ // @@ -9,9 +9,9 @@ // to the file deal.II/doc/license.html for the text and // further information on this license. // -//---------------------------- data_out_stack_03.cc --------------------------- +//---------------------------------------------------------------------- -// the order of vertices on 1d cells was confused somewhere somewhen. fix this +// Output a field constant in time #include "../tests.h" #include @@ -43,7 +43,8 @@ void run () // create a continuous field over // this DoFHandler Vector v(dof_handler.n_dofs()); - v(v.size()/2) = 1; + v = 1.; + v(v.size()/2) = 2.; // output this field using // DataOutStack. the result should @@ -54,10 +55,10 @@ void run () data_out_stack.new_parameter_value (1,1); data_out_stack.attach_dof_handler (dof_handler); data_out_stack.add_data_vector (v, "solution"); - data_out_stack.build_patches (1); + data_out_stack.build_patches (2); data_out_stack.finish_parameter_value (); - data_out_stack.write_gnuplot (deallog.get_file_stream()); + data_out_stack.write_dx (deallog.get_file_stream()); } @@ -70,6 +71,6 @@ int main () deallog.threshold_double(1.e-10); run<1> (); - + run<2> (); return 0; } diff --git a/tests/bits/data_out_stack_03/cmp/generic b/tests/bits/data_out_stack_03/cmp/generic index 0337bf8cf2..29bb2eca08 100644 --- a/tests/bits/data_out_stack_03/cmp/generic +++ b/tests/bits/data_out_stack_03/cmp/generic @@ -1,22 +1,319 @@ -# This file was generated by the deal.II library. - - -# -# For a description of the GNUPLOT format see the GNUPLOT manual. -# -# --1.00000 0.00000 0.00000 --1.00000 1.00000 0.00000 - -0.00000 0.00000 1.00000 -0.00000 1.00000 1.00000 - - -0.00000 0.00000 1.00000 -0.00000 1.00000 1.00000 - -1.00000 0.00000 0.00000 -1.00000 1.00000 0.00000 +object "vertices" class array type float rank 1 shape 2 items 18 data follows +-1.00000 0.00000 +-0.500000 0.00000 +0.00000 0.00000 +-1.00000 0.500000 +-0.500000 0.500000 +0.00000 0.500000 +-1.00000 1.00000 +-0.500000 1.00000 +0.00000 1.00000 +0.00000 0.00000 +0.500000 0.00000 +1.00000 0.00000 +0.00000 0.500000 +0.500000 0.500000 +1.00000 0.500000 +0.00000 1.00000 +0.500000 1.00000 +1.00000 1.00000 +object "cells" class array type int rank 1 shape 4 items 8 data follows +0 3 1 4 +1 4 2 5 +3 6 4 7 +4 7 5 8 +9 12 10 13 +10 13 11 14 +12 15 13 16 +13 16 14 17 +attribute "element type" string "quads" +attribute "ref" string "positions" +object "data" class array type float rank 1 shape 1 items 18 data follows + 1.00000 + 1.50000 + 2.00000 + 1.00000 + 1.50000 + 2.00000 + 1.00000 + 1.50000 + 2.00000 + 2.00000 + 1.50000 + 1.00000 + 2.00000 + 1.50000 + 1.00000 + 2.00000 + 1.50000 + 1.00000 +attribute "dep" string "positions" +object "deal data" class field +component "positions" value "vertices" +component "connections" value "cells" +component "data" value "data" +attribute +end +object "vertices" class array type float rank 1 shape 3 items 108 data follows +-1.00000 -1.00000 0.00000 +-0.500000 -1.00000 0.00000 +0.00000 -1.00000 0.00000 +-1.00000 -0.500000 0.00000 +-0.500000 -0.500000 0.00000 +0.00000 -0.500000 0.00000 +-1.00000 0.00000 0.00000 +-0.500000 0.00000 0.00000 +0.00000 0.00000 0.00000 +-1.00000 -1.00000 0.500000 +-0.500000 -1.00000 0.500000 +0.00000 -1.00000 0.500000 +-1.00000 -0.500000 0.500000 +-0.500000 -0.500000 0.500000 +0.00000 -0.500000 0.500000 +-1.00000 0.00000 0.500000 +-0.500000 0.00000 0.500000 +0.00000 0.00000 0.500000 +-1.00000 -1.00000 1.00000 +-0.500000 -1.00000 1.00000 +0.00000 -1.00000 1.00000 +-1.00000 -0.500000 1.00000 +-0.500000 -0.500000 1.00000 +0.00000 -0.500000 1.00000 +-1.00000 0.00000 1.00000 +-0.500000 0.00000 1.00000 +0.00000 0.00000 1.00000 +0.00000 -1.00000 0.00000 +0.500000 -1.00000 0.00000 +1.00000 -1.00000 0.00000 +0.00000 -0.500000 0.00000 +0.500000 -0.500000 0.00000 +1.00000 -0.500000 0.00000 +0.00000 0.00000 0.00000 +0.500000 0.00000 0.00000 +1.00000 0.00000 0.00000 +0.00000 -1.00000 0.500000 +0.500000 -1.00000 0.500000 +1.00000 -1.00000 0.500000 +0.00000 -0.500000 0.500000 +0.500000 -0.500000 0.500000 +1.00000 -0.500000 0.500000 +0.00000 0.00000 0.500000 +0.500000 0.00000 0.500000 +1.00000 0.00000 0.500000 +0.00000 -1.00000 1.00000 +0.500000 -1.00000 1.00000 +1.00000 -1.00000 1.00000 +0.00000 -0.500000 1.00000 +0.500000 -0.500000 1.00000 +1.00000 -0.500000 1.00000 +0.00000 0.00000 1.00000 +0.500000 0.00000 1.00000 +1.00000 0.00000 1.00000 +-1.00000 0.00000 0.00000 +-0.500000 0.00000 0.00000 +0.00000 0.00000 0.00000 +-1.00000 0.500000 0.00000 +-0.500000 0.500000 0.00000 +0.00000 0.500000 0.00000 +-1.00000 1.00000 0.00000 +-0.500000 1.00000 0.00000 +0.00000 1.00000 0.00000 +-1.00000 0.00000 0.500000 +-0.500000 0.00000 0.500000 +0.00000 0.00000 0.500000 +-1.00000 0.500000 0.500000 +-0.500000 0.500000 0.500000 +0.00000 0.500000 0.500000 +-1.00000 1.00000 0.500000 +-0.500000 1.00000 0.500000 +0.00000 1.00000 0.500000 +-1.00000 0.00000 1.00000 +-0.500000 0.00000 1.00000 +0.00000 0.00000 1.00000 +-1.00000 0.500000 1.00000 +-0.500000 0.500000 1.00000 +0.00000 0.500000 1.00000 +-1.00000 1.00000 1.00000 +-0.500000 1.00000 1.00000 +0.00000 1.00000 1.00000 +0.00000 0.00000 0.00000 +0.500000 0.00000 0.00000 +1.00000 0.00000 0.00000 +0.00000 0.500000 0.00000 +0.500000 0.500000 0.00000 +1.00000 0.500000 0.00000 +0.00000 1.00000 0.00000 +0.500000 1.00000 0.00000 +1.00000 1.00000 0.00000 +0.00000 0.00000 0.500000 +0.500000 0.00000 0.500000 +1.00000 0.00000 0.500000 +0.00000 0.500000 0.500000 +0.500000 0.500000 0.500000 +1.00000 0.500000 0.500000 +0.00000 1.00000 0.500000 +0.500000 1.00000 0.500000 +1.00000 1.00000 0.500000 +0.00000 0.00000 1.00000 +0.500000 0.00000 1.00000 +1.00000 0.00000 1.00000 +0.00000 0.500000 1.00000 +0.500000 0.500000 1.00000 +1.00000 0.500000 1.00000 +0.00000 1.00000 1.00000 +0.500000 1.00000 1.00000 +1.00000 1.00000 1.00000 +object "cells" class array type int rank 1 shape 8 items 32 data follows +0 9 3 12 1 10 4 13 +1 10 4 13 2 11 5 14 +3 12 6 15 4 13 7 16 +4 13 7 16 5 14 8 17 +9 18 12 21 10 19 13 22 +10 19 13 22 11 20 14 23 +12 21 15 24 13 22 16 25 +13 22 16 25 14 23 17 26 +27 36 30 39 28 37 31 40 +28 37 31 40 29 38 32 41 +30 39 33 42 31 40 34 43 +31 40 34 43 32 41 35 44 +36 45 39 48 37 46 40 49 +37 46 40 49 38 47 41 50 +39 48 42 51 40 49 43 52 +40 49 43 52 41 50 44 53 +54 63 57 66 55 64 58 67 +55 64 58 67 56 65 59 68 +57 66 60 69 58 67 61 70 +58 67 61 70 59 68 62 71 +63 72 66 75 64 73 67 76 +64 73 67 76 65 74 68 77 +66 75 69 78 67 76 70 79 +67 76 70 79 68 77 71 80 +81 90 84 93 82 91 85 94 +82 91 85 94 83 92 86 95 +84 93 87 96 85 94 88 97 +85 94 88 97 86 95 89 98 +90 99 93 102 91 100 94 103 +91 100 94 103 92 101 95 104 +93 102 96 105 94 103 97 106 +94 103 97 106 95 104 98 107 +attribute "element type" string "cubes" +attribute "ref" string "positions" +object "data" class array type float rank 1 shape 1 items 108 data follows + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.50000 + 2.00000 + 1.00000 + 1.25000 + 1.50000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.50000 + 2.00000 + 1.00000 + 1.25000 + 1.50000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.50000 + 2.00000 + 1.00000 + 1.25000 + 1.50000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 + 1.00000 +attribute "dep" string "positions" +object "deal data" class field +component "positions" value "vertices" +component "connections" value "cells" +component "data" value "data" +attribute +end diff --git a/tests/bits/data_out_stack_04.cc b/tests/bits/data_out_stack_04.cc deleted file mode 100644 index aac2ac38bd..0000000000 --- a/tests/bits/data_out_stack_04.cc +++ /dev/null @@ -1,77 +0,0 @@ -//---------------------------- data_out_stack_01.cc --------------------------- -// $Id$ -// Version: $Name$ -// -// Copyright (C) 2006 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. -// -//---------------------------- data_out_stack_04.cc --------------------------- - -// same as data_out_stack_04, but test for 2d - -#include "../tests.h" -#include -#include -#include -#include -#include - -#include -#include -#include - -#include - - - - -template -void run () -{ - Triangulation triangulation; - GridGenerator::hyper_cube (triangulation, -1, 1); - triangulation.refine_global (1); - - FE_Q fe(1); - DoFHandler dof_handler(triangulation); - dof_handler.distribute_dofs (fe); - - // create a continuous field over - // this DoFHandler, where all nodes - // are zero, except for a single - // one - Vector v(dof_handler.n_dofs()); - v(v.size()/2) = 1; - - // output this field using - // DataOutStack. the result should - // be a continuous field again - DataOutStack data_out_stack; - data_out_stack.declare_data_vector ("solution", - DataOutStack::dof_vector); - data_out_stack.new_parameter_value (1,1); - data_out_stack.attach_dof_handler (dof_handler); - data_out_stack.add_data_vector (v, "solution"); - data_out_stack.build_patches (1); - data_out_stack.finish_parameter_value (); - - data_out_stack.write_gnuplot (deallog.get_file_stream()); -} - - - -int main () -{ - std::ofstream logfile("data_out_stack_04/output"); - deallog.attach(logfile); - deallog.depth_console(0); - deallog.threshold_double(1.e-10); - - run<2> (); - - return 0; -} -- 2.39.5