From 2749330633815bbfdd539204f7764c70fee55348 Mon Sep 17 00:00:00 2001 From: David Wells Date: Sat, 8 Feb 2020 21:23:22 -0500 Subject: [PATCH] Remove EPS output from step-6. --- examples/step-6/doc/results.dox | 15 +++++++++++++++ examples/step-6/step-6.cc | 29 ++++++++++++++++------------- 2 files changed, 31 insertions(+), 13 deletions(-) diff --git a/examples/step-6/doc/results.dox b/examples/step-6/doc/results.dox index c622d26075..6de1e95dbd 100644 --- a/examples/step-6/doc/results.dox +++ b/examples/step-6/doc/results.dox @@ -247,6 +247,21 @@ the Triangulation what to do when a cell is refined: where should the new vertices at the edge midpoints and the cell midpoint be located so that the child cells better represent the desired geometry than the parent cell. +To visualize this output, we have to output more lines on interior line +segments as well as boundary line segments so that the interior lines look +curved. We can do this by making one change to the gnuplot part of +output_results: +@code +{ + GridOut grid_out; + std::ofstream output("grid-" + std::to_string(cycle) + ".gnuplot"); + GridOutFlags::Gnuplot gnuplot_flags(false, 5, /*curved_interior_cells*/true); + grid_out.set_flags(gnuplot_flags); + MappingQGeneric mapping(3); + grid_out.write_gnuplot(triangulation, output, &mapping); +} +@endcode + In the code above, we already do this for faces that sit at the boundary: this happens automatically since we use GridGenerator::hyper_ball, which attaches a SphericalManifold to the boundary of the domain. To make the mesh diff --git a/examples/step-6/step-6.cc b/examples/step-6/step-6.cc index 71e8889a5f..a7cfd5eace 100644 --- a/examples/step-6/step-6.cc +++ b/examples/step-6/step-6.cc @@ -464,21 +464,24 @@ void Step6::refine_grid() // cycle. // // We have already seen in step-1 how this can be achieved for the -// mesh itself. The only thing we have to change is the generation of -// the file name, since it should contain the number of the present -// refinement cycle provided to this function as an argument. To this -// end, we simply append the number of the refinement cycle as a -// string to the file name. -// -// We also output the solution in the same way as we did before, with -// a similarly constructed file name. +// mesh itself. Here, we change a few things: +//
    +//
  1. We use two different formats: gnuplot and VTU.
  2. +//
  3. We embed the cycle number in the output file name.
  4. +//
  5. For gnuplot output, we set up a GridOutFlags::Gnuplot object to +// provide a few extra visualization arguments so that edges appear +// curved. This is explained in further detail in step-10.
  6. +//
template void Step6::output_results(const unsigned int cycle) const { { - GridOut grid_out; - std::ofstream output("grid-" + std::to_string(cycle) + ".eps"); - grid_out.write_eps(triangulation, output); + GridOut grid_out; + std::ofstream output("grid-" + std::to_string(cycle) + ".gnuplot"); + GridOutFlags::Gnuplot gnuplot_flags(false, 5); + grid_out.set_flags(gnuplot_flags); + MappingQGeneric mapping(3); + grid_out.write_gnuplot(triangulation, output, &mapping); } { @@ -487,8 +490,8 @@ void Step6::output_results(const unsigned int cycle) const data_out.add_data_vector(solution, "solution"); data_out.build_patches(); - std::ofstream output("solution-" + std::to_string(cycle) + ".vtk"); - data_out.write_vtk(output); + std::ofstream output("solution-" + std::to_string(cycle) + ".vtu"); + data_out.write_vtu(output); } } -- 2.39.5