From: Guido Kanschat Date: Mon, 16 Jan 2006 15:14:47 +0000 (+0000) Subject: test programs for several output formats X-Git-Tag: v8.0.0~12617 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86bce4c2d2d015e0dc03e25ca2e73d1c05671e9d;p=dealii.git test programs for several output formats git-svn-id: https://svn.dealii.org/trunk@12051 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/base/Makefile b/tests/base/Makefile index ebf87b9702..6fe12b733a 100644 --- a/tests/base/Makefile +++ b/tests/base/Makefile @@ -1,6 +1,6 @@ ############################################################ # $Id$ -# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 by the deal.II authors +# Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors ############################################################ ############################################################ diff --git a/tests/base/data_out_base.cc b/tests/base/data_out_base.cc index ce813631ed..642c62f641 100644 --- a/tests/base/data_out_base.cc +++ b/tests/base/data_out_base.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 by the deal.II authors +// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -34,7 +34,7 @@ write_patches(const std::vector >& patches, names[1] = std::string("last name"); DataOutBase::DXFlags dxflags; -// DataOutBase::EpsFlags epsflags; + DataOutBase::EpsFlags epsflags; DataOutBase::GnuplotFlags gnuplotflags; DataOutBase::GmvFlags gmvflags; DataOutBase::PovrayFlags povrayflags; @@ -43,7 +43,8 @@ write_patches(const std::vector >& patches, DataOutBase::Deal_II_IntermediateFlags deal_II_intermediateflags; WRITE(dx); -// WRITE(eps); + if (dim==2) + WRITE(eps); WRITE(gnuplot); WRITE(gmv); if (dim==2 && spacedim==2) diff --git a/tests/base/data_out_base_dx/view.cfg b/tests/base/data_out_base_dx/view.cfg new file mode 100644 index 0000000000..0338480baf --- /dev/null +++ b/tests/base/data_out_base_dx/view.cfg @@ -0,0 +1,63 @@ +// +// time: Mon Jan 16 15:15:55 2006 +// +// version: 3.1.2 (format), 4.2.0 (DX) +// +// Message Window: +// window: position = (0.0000,0.0000), size = 0.4781x0.2568 +// +// panel[0]: position = (0.6391,0.4043), size = 0.2930x0.4395, startup = 1, devstyle = 1 +// title: value = Control Panel +// +// workspace: width = 201, height = 133 +// layout: snap = 0, width = 50, height = 50, align = NN +// +// panel[1]: position = (0.0000,0.0000), size = 0.2930x0.4395, startup = 1, devstyle = 1 +// title: value = Control Panel +// +// workspace: width = 123, height = 61 +// layout: snap = 0, width = 50, height = 50, align = NN +// +// interactor FileSelector[1]: num_components = 1, value = "/export/local/deal.II/tests/base/data_out_base_dx/fff3ff22.dx" +// instance: panel = 0, x = 5, y = 5, style = FileSelector, vertical = 1, size = 196x57 +// filter = /export/local/deal.II/tests/base/data_out_base_dx/*.dx +// +// interactor Integer[1]: num_components = 1, value = 4 +// component[0]: minimum = 0, maximum = 5, global increment = 1, decimal = 0, global continuous = 0 +// instance: panel = 1, x = 5, y = 5, style = Stepper, vertical = 1, size = 118x56 +// local continuous: value = 0, mode = global +// local increment[0]: value = 1, mode = global +// instance: panel = 0, x = 12, y = 77, style = Stepper, vertical = 1, size = 118x56 +// local continuous: value = 0, mode = global +// local increment[0]: value = 1, mode = global +// +// node Image[1]: +// depth: value = 16 +// window: position = (0.0000,0.1328), size = 0.5195x0.6553 +// input[1]: defaulting = 0, value = "Image_1" +// input[4]: defaulting = 0, value = 1 +// input[5]: defaulting = 0, value = [2 2 2] +// input[6]: defaulting = 0, value = [-10.6507 8.26531 -8.18867] +// input[7]: defaulting = 0, value = 9.32998 +// input[8]: defaulting = 0, value = 651 +// input[9]: defaulting = 0, value = 0.964 +// input[10]: defaulting = 0, value = [0.625501 -0.00578044 -0.780202] +// input[11]: defaulting = 1, value = 30.0002 +// input[12]: defaulting = 0, value = 0 +// input[14]: defaulting = 0, value = 1 +// input[15]: defaulting = 1, value = "none" +// input[16]: defaulting = 1, value = "none" +// input[17]: defaulting = 1, value = 1 +// input[18]: defaulting = 1, value = 1 +// input[19]: defaulting = 0, value = 0 +// input[22]: defaulting = 0, value = "white" +// input[26]: defaulting = 0, value = "eps color dpi=65 orient=landscape" +// input[29]: defaulting = 0, value = 1 +// input[30]: defaulting = 0, value = {"x", "y", "z"} +// input[33]: defaulting = 0, value = 0 +// input[36]: defaulting = 0, value = 0 +// input[37]: defaulting = 0, value = {"blue", "grey5", "black", "black"} +// input[38]: defaulting = 0, value = {"background", "grid", "ticks", "labels"} +// input[39]: defaulting = 0, value = 0.5 +// input[41]: defaulting = 0, value = "roam" +// internal caching: 1 diff --git a/tests/base/data_out_base_dx/view.net b/tests/base/data_out_base_dx/view.net index cb96a393a2..95a4843c1e 100644 --- a/tests/base/data_out_base_dx/view.net +++ b/tests/base/data_out_base_dx/view.net @@ -1,5 +1,5 @@ // -// time: Thu Jan 12 22:30:50 2006 +// time: Mon Jan 16 15:15:55 2006 // // version: 3.1.2 (format), 4.2.0 (DX) // @@ -16,7 +16,7 @@ macro main( ) { // // node FileSelector[1]: x = 331, y = 9, inputs = 0, label = FileSelector - // output[1]: visible = 1, type = 32, value = "/home/kanschat/deal.II/tests/base/data_out_base_dx/fff3ff22.dx" + // output[1]: visible = 1, type = 32, value = "/export/local/deal.II/tests/base/data_out_base_dx/fff3ff22.dx" // output[2]: visible = 1, type = 32, value = "fff3ff22.dx" // page group: Input // @@ -126,6 +126,21 @@ main_AutoColor_1_out_2[cache: 0] = main_AutoColor_1_in_10 ) [instance: 1, cache: 1]; // + // node AutoGlyph[1]: x = 315, y = 169, inputs = 7, label = AutoGlyph + // input[2]: defaulting = 0, visible = 1, type = 32, value = "text" + // page group: Color + // +main_AutoGlyph_1_out_1 = + AutoGlyph( + main_Receiver_1_out_1, + main_AutoGlyph_1_in_2, + main_AutoGlyph_1_in_3, + main_AutoGlyph_1_in_4, + main_AutoGlyph_1_in_5, + main_AutoGlyph_1_in_6, + main_AutoGlyph_1_in_7 + ) [instance: 1, cache: 1]; + // // node Format[1]: x = 398, y = 409, inputs = 3, label = Format // input[1]: defaulting = 0, visible = 0, type = 32, value = "%s: %d" // page group: Input @@ -200,57 +215,13 @@ main_Collect_3_out_1 = main_AutoColor_1_out_1 ) [instance: 3, cache: 1]; // - // node Statistics[2]: x = 315, y = 89, inputs = 1, label = Statistics - // page group: Color - // -main_Statistics_2_out_1, -main_Statistics_2_out_2, -main_Statistics_2_out_3, -main_Statistics_2_out_4, -main_Statistics_2_out_5 = - Statistics( - main_Receiver_1_out_1 - ) [instance: 2, cache: 1]; - // - // node ColorBar[1]: x = 339, y = 249, inputs = 16, label = ColorBar - // input[2]: defaulting = 0, visible = 0, type = 8, value = [0.99 0.5] - // input[3]: visible = 0 - // input[4]: defaulting = 0, visible = 0, type = 3, value = 0 - // input[6]: visible = 1 - // input[7]: visible = 1 - // input[8]: defaulting = 0, visible = 0, type = 32, value = NULL - // input[9]: defaulting = 0, visible = 0, type = 16777248, value = {"black"} - // input[11]: defaulting = 0, visible = 0, type = 5, value = .9 - // input[14]: defaulting = 1, visible = 0, type = 16777248, value = NULL - // page group: Color - // -main_ColorBar_1_out_1 = - ColorBar( - main_AutoColor_1_out_2, - main_ColorBar_1_in_2, - main_ColorBar_1_in_3, - main_ColorBar_1_in_4, - main_ColorBar_1_in_5, - main_Statistics_2_out_4, - main_Statistics_2_out_5, - main_ColorBar_1_in_8, - main_ColorBar_1_in_9, - main_ColorBar_1_in_10, - main_ColorBar_1_in_11, - main_ColorBar_1_in_12, - main_ColorBar_1_in_13, - main_ColorBar_1_in_14, - main_ColorBar_1_in_15, - main_ColorBar_1_in_16 - ) [instance: 1, cache: 1]; - // // node Collect[1]: x = 248, y = 409, inputs = 2, label = Collect // page group: Color // main_Collect_1_out_1 = Collect( main_Collect_3_out_1, - main_ColorBar_1_out_1 + main_AutoGlyph_1_out_1 ) [instance: 1, cache: 1]; // // node Transmitter[3]: x = 253, y = 489, inputs = 1, label = image @@ -290,12 +261,12 @@ main_Collect_2_out_1 = // input[1]: defaulting = 0, visible = 0, type = 67108863, value = "Image_1" // input[4]: defaulting = 0, visible = 0, type = 1, value = 1 // input[5]: defaulting = 0, visible = 0, type = 8, value = [2 2 2] - // input[6]: defaulting = 0, visible = 0, type = 8, value = [-0.575087 15.779 -8.32521] + // input[6]: defaulting = 0, visible = 0, type = 8, value = [-10.6507 8.26531 -8.18867] // input[7]: defaulting = 0, visible = 0, type = 5, value = 9.32998 - // input[8]: defaulting = 0, visible = 0, type = 1, value = 859 - // input[9]: defaulting = 0, visible = 0, type = 5, value = 0.75 - // input[10]: defaulting = 0, visible = 0, type = 8, value = [0.294646 -0.537169 -0.790338] - // input[11]: defaulting = 1, visible = 0, type = 5, value = 30.0003 + // input[8]: defaulting = 0, visible = 0, type = 1, value = 651 + // input[9]: defaulting = 0, visible = 0, type = 5, value = 0.964 + // input[10]: defaulting = 0, visible = 0, type = 8, value = [0.625501 -0.00578044 -0.780202] + // input[11]: defaulting = 1, visible = 0, type = 5, value = 30.0002 // input[12]: defaulting = 0, visible = 0, type = 1, value = 0 // input[14]: defaulting = 0, visible = 0, type = 1, value = 1 // input[15]: defaulting = 1, visible = 0, type = 32, value = "none" @@ -314,8 +285,8 @@ main_Collect_2_out_1 = // input[39]: defaulting = 0, visible = 0, type = 5, value = 0.5 // input[41]: defaulting = 0, visible = 0, type = 32, value = "roam" // page group: Display - // depth: value = 24 - // window: position = (0.0000,0.1333), size = 0.5196x0.6552 + // depth: value = 16 + // window: position = (0.0000,0.1328), size = 0.5195x0.6553 // internal caching: 1 // main_Image_1_out_1[cache: 0], @@ -375,7 +346,7 @@ main_Image_1_out_3[cache: 0] = // network: end of macro body CacheScene(main_Image_1_in_1, main_Image_1_out_1, main_Image_1_out_2); } -main_FileSelector_1_out_1 = "/home/kanschat/deal.II/tests/base/data_out_base_dx/fff3ff22.dx"; +main_FileSelector_1_out_1 = "/export/local/deal.II/tests/base/data_out_base_dx/fff3ff22.dx"; main_FileSelector_1_out_2 = "fff3ff22.dx"; main_Import_1_in_2 = NULL; main_Import_1_in_3 = NULL; @@ -413,7 +384,13 @@ main_AutoColor_1_in_8 = NULL; main_AutoColor_1_in_9 = NULL; main_AutoColor_1_in_10 = NULL; main_AutoColor_1_out_1 = NULL; -main_AutoColor_1_out_2 = NULL; +main_AutoGlyph_1_in_2 = "text"; +main_AutoGlyph_1_in_3 = NULL; +main_AutoGlyph_1_in_4 = NULL; +main_AutoGlyph_1_in_5 = NULL; +main_AutoGlyph_1_in_6 = NULL; +main_AutoGlyph_1_in_7 = NULL; +main_AutoGlyph_1_out_1 = NULL; main_Format_1_in_1 = "%s: %d"; main_Format_1_out_1 = NULL; main_Transmitter_2_out_1 = NULL; @@ -439,22 +416,6 @@ main_Color_2_in_4 = NULL; main_Color_2_in_5 = NULL; main_Color_2_out_1 = NULL; main_Collect_3_out_1 = NULL; -main_Statistics_2_out_4 = NULL; -main_Statistics_2_out_5 = NULL; -main_ColorBar_1_in_2 = [0.99 0.5]; -main_ColorBar_1_in_3 = NULL; -main_ColorBar_1_in_4 = 0; -main_ColorBar_1_in_5 = NULL; -main_ColorBar_1_in_8 = NULL; -main_ColorBar_1_in_9 = {"black"}; -main_ColorBar_1_in_10 = NULL; -main_ColorBar_1_in_11 = .9; -main_ColorBar_1_in_12 = NULL; -main_ColorBar_1_in_13 = NULL; -main_ColorBar_1_in_14 = NULL; -main_ColorBar_1_in_15 = NULL; -main_ColorBar_1_in_16 = NULL; -main_ColorBar_1_out_1 = NULL; main_Collect_1_out_1 = NULL; main_Transmitter_3_out_1 = NULL; main_Receiver_2_out_1 = NULL; @@ -777,14 +738,14 @@ macro Image( RECformat) [instance: 2, cache: 1]; } main_Image_1_in_1 = "Image_1"; -main_Image_1_in_3 = "X24,,"; +main_Image_1_in_3 = "X16,,"; main_Image_1_in_4 = 1; main_Image_1_in_5 = [2 2 2]; -main_Image_1_in_6 = [-0.575087 15.779 -8.32521]; +main_Image_1_in_6 = [-10.6507 8.26531 -8.18867]; main_Image_1_in_7 = 9.32998; -main_Image_1_in_8 = 859; -main_Image_1_in_9 = 0.75; -main_Image_1_in_10 = [0.294646 -0.537169 -0.790338]; +main_Image_1_in_8 = 651; +main_Image_1_in_9 = 0.964; +main_Image_1_in_10 = [0.625501 -0.00578044 -0.780202]; main_Image_1_in_11 = NULL; main_Image_1_in_12 = 0; main_Image_1_in_13 = NULL; diff --git a/tests/base/data_out_base_eps.cc b/tests/base/data_out_base_eps.cc new file mode 100644 index 0000000000..df450bc922 --- /dev/null +++ b/tests/base/data_out_base_eps.cc @@ -0,0 +1,79 @@ +//----------------------------------------------------------------------------- +// $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. +// +//----------------------------------------------------------------------------- + +#include "../tests.h" +#include +#include + +#include +#include +#include +#include + +#include "patches.h" + +// Output data on repetitions of the unit hypercube + +template +void check(DataOutBase::EpsFlags flags, + std::ostream& out) +{ + const unsigned int np = 4; + + std::vector > patches(np); + + create_patches(patches); + + std::vector names(5); + names[0] = "x1"; + names[1] = "x2"; + names[2] = "x3"; + names[3] = "x4"; + names[4] = "i"; + DataOutBase::write_eps(patches, names, flags, out); +} + + +template +void check_all() +{ + DataOutBase::EpsFlags flags; + if (true) { + std::ofstream out("data_out_base_dx/fff3ff22.dx"); + check(flags, out); + } + flags.int_binary = true; + if (true) { + std::ofstream out("data_out_base_dx/tff3ff22.dx"); + check(flags, out); + } + flags.coordinates_binary = true; + if (true) { + std::ofstream out("data_out_base_dx/ttf3ff22.dx"); + check(flags, out); + } + flags.data_binary = true; + if (true) { + std::ofstream out("data_out_base_dx/ttt3ff22.dx"); + check(flags, out); + } +} + +int main() +{ + check_all<1,1>(); + check_all<1,2>(); + check_all<2,2>(); + check_all<2,3>(); + check_all<3,3>(); +} diff --git a/tests/base/data_out_base_vtk.cc b/tests/base/data_out_base_vtk.cc new file mode 100644 index 0000000000..ee662ee17b --- /dev/null +++ b/tests/base/data_out_base_vtk.cc @@ -0,0 +1,67 @@ +//----------------------------------------------------------------------------- +// $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. +// +//----------------------------------------------------------------------------- + +#include "../tests.h" +#include +#include + +#include +#include +#include +#include +#include + +#include "patches.h" + +// Output data on repetitions of the unit hypercube + +template +void check(DataOutBase::VtkFlags flags, + std::ostream& out) +{ + const unsigned int np = 4; + + std::vector > patches(np); + + create_patches(patches); + + std::vector names(5); + names[0] = "x1"; + names[1] = "x2"; + names[2] = "x3"; + names[3] = "x4"; + names[4] = "i"; + DataOutBase::write_vtk(patches, names, flags, out); +} + + +template +void check_all() +{ + char name[100]; + DataOutBase::VtkFlags flags; + if (true) { + sprintf(name, "data_out_base_vtk/%d%d.vtk", dim, spacedim); + std::ofstream out(name); + check(flags, out); + } +} + +int main() +{ + check_all<1,1>(); + check_all<1,2>(); + check_all<2,2>(); + check_all<2,3>(); + check_all<3,3>(); +} diff --git a/tests/base/patches.h b/tests/base/patches.h index 3617b53820..1704a496a9 100644 --- a/tests/base/patches.h +++ b/tests/base/patches.h @@ -62,9 +62,8 @@ create_patches(std::vector > & patches) patch.data(1,i) = p+x2; patch.data(2,i) = p+x3; patch.data(3,i) = p+x4; - patch.data(4,i) = i;//x1*x1+x2*x2+x3*x3+x4*x4; + patch.data(4,i) = i; } - } }