-//---------------------------- data_out_stack_01.cc ---------------------------
+//----------------------------------------------------------------------
// $Id$
// Version: $Name$
//
// 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 <grid/tria.h>
// create a continuous field over
// this DoFHandler
Vector<double> 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
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());
}
deallog.threshold_double(1.e-10);
run<1> ();
-
+ run<2> ();
return 0;
}
-# This file was generated by the deal.II library.
-
-
-#
-# For a description of the GNUPLOT format see the GNUPLOT manual.
-#
-# <x> <y> <solution>
--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
+++ /dev/null
-//---------------------------- 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 <grid/tria.h>
-#include <dofs/dof_handler.h>
-#include <grid/grid_generator.h>
-#include <fe/fe_q.h>
-#include <lac/vector.h>
-
-#include <numerics/data_out_stack.h>
-#include <fstream>
-#include <iostream>
-
-#include <base/logstream.h>
-
-
-
-
-template <int dim>
-void run ()
-{
- Triangulation<dim> triangulation;
- GridGenerator::hyper_cube (triangulation, -1, 1);
- triangulation.refine_global (1);
-
- FE_Q<dim> fe(1);
- DoFHandler<dim> 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<double> v(dof_handler.n_dofs());
- v(v.size()/2) = 1;
-
- // output this field using
- // DataOutStack. the result should
- // be a continuous field again
- DataOutStack<dim> data_out_stack;
- data_out_stack.declare_data_vector ("solution",
- DataOutStack<dim>::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;
-}