From: christian.wuelker Date: Thu, 21 Mar 2013 13:31:44 +0000 (+0000) Subject: Test fuer write_svg X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ffcb97b7d989e1218586ea8acd0e98097cec6e43;p=dealii-svn.git Test fuer write_svg git-svn-id: https://svn.dealii.org/trunk@28967 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/grid/grid_out_svg_01.cc b/tests/grid/grid_out_svg_01.cc new file mode 100644 index 0000000000..dde286cb90 --- /dev/null +++ b/tests/grid/grid_out_svg_01.cc @@ -0,0 +1,65 @@ +#include "../tests.h" + +#include +#include +#include +#include +#include +#include + +#include +#include + +using namespace dealii; + +Triangulation<2,2> create_grid() +{ + Triangulation<2,2> triangulation; + + double inner_radius = .5; + double outer_radius = 1.; + + Point<2> center(0., 0.); + + GridGenerator::hyper_cube_with_cylindrical_hole(triangulation, inner_radius, outer_radius); + triangulation.refine_global(1); + + Triangulation<2>::active_cell_iterator + + cell = triangulation.begin_active(), + endc = triangulation.end(); + + for(; cell!=endc; ++cell) + { + for (unsigned int v=0; v < GeometryInfo<2>::vertices_per_cell; ++v) + { + const double distance_from_center = center.distance(cell->vertex(v)); + + if (std::fabs(distance_from_center - inner_radius) < .25) + { + cell->set_refine_flag(); + break; + } + } + } + + triangulation.execute_coarsening_and_refinement(); + + return triangulation; +} + +int main() +{ + initlog(__FILE__); + + GridOut grid_out; + GridOutFlags::Svg svg_flags; + + svg_flags.coloring = GridOutFlags::Svg::level_number; + svg_flags.label_material_id = true; + + grid_out.set_flags(svg_flags); + grid_out.write_svg(create_grid(), deallog.get_file_stream()); + + return 0; +} diff --git a/tests/grid/grid_out_svg_01/cmp/generic b/tests/grid/grid_out_svg_01/cmp/generic new file mode 100644 index 0000000000..60dd90c175 --- /dev/null +++ b/tests/grid/grid_out_svg_01/cmp/generic @@ -0,0 +1,255 @@ + + + + + + + + + + + + + + deal.II + 21/3/2013 - 14:30 + + + + 1,0,0 + + + 1,1,0 + + + 1,4,0 + + + 1,5,0 + + + 1,8,0 + + + 1,9,0 + + + 1,12,0 + + + 1,13,0 + + + 1,16,0 + + + 1,17,0 + + + 1,20,0 + + + 1,21,0 + + + 1,24,0 + + + 1,25,0 + + + 1,28,0 + + + 1,29,0 + + + 2,0,0 + + 2,1,0 + + 2,2,0 + + + 2,3,0 + + + 2,4,0 + + 2,5,0 + + 2,6,0 + + + 2,7,0 + + + 2,8,0 + + 2,9,0 + + 2,10,0 + + + 2,11,0 + + + 2,12,0 + + 2,13,0 + + 2,14,0 + + + 2,15,0 + + + 2,16,0 + + 2,17,0 + + 2,18,0 + + + 2,19,0 + + + 2,20,0 + + 2,21,0 + + 2,22,0 + + + 2,23,0 + + + 2,24,0 + + 2,25,0 + + 2,26,0 + + + 2,27,0 + + + 2,28,0 + + 2,29,0 + + 2,30,0 + + + 2,31,0 + + + 2,32,0 + + 2,33,0 + + 2,34,0 + + + 2,35,0 + + + 2,36,0 + + 2,37,0 + + 2,38,0 + + + 2,39,0 + + + 2,40,0 + + 2,41,0 + + 2,42,0 + + + 2,43,0 + + + 2,44,0 + + 2,45,0 + + 2,46,0 + + + 2,47,0 + + + 2,48,0 + + 2,49,0 + + 2,50,0 + + + 2,51,0 + + + 2,52,0 + + 2,53,0 + + 2,54,0 + + + 2,55,0 + + + 2,56,0 + + 2,57,0 + + 2,58,0 + + + 2,59,0 + + + 2,60,0 + + 2,61,0 + + 2,62,0 + + + 2,63,0 + + + + + cell label + level_number, + cell_index, + material_id + + + level_number + + 1 min + + 2 max + + \ No newline at end of file