From 15242e941b3fd048e0be82cb1459051f50249dc6 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Tue, 12 Dec 2023 18:56:55 -0700 Subject: [PATCH] Add a second test. --- tests/grid/grid_in_vtk_1d_3d_replicate.cc | 50 +++++++++++++++++++ tests/grid/grid_in_vtk_1d_3d_replicate.output | 33 ++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 tests/grid/grid_in_vtk_1d_3d_replicate.cc create mode 100644 tests/grid/grid_in_vtk_1d_3d_replicate.output diff --git a/tests/grid/grid_in_vtk_1d_3d_replicate.cc b/tests/grid/grid_in_vtk_1d_3d_replicate.cc new file mode 100644 index 0000000000..133d5fe951 --- /dev/null +++ b/tests/grid/grid_in_vtk_1d_3d_replicate.cc @@ -0,0 +1,50 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2023 by the deal.II authors +// +// This file is part of the deal.II library. +// +// The deal.II library is free software; you can use it, redistribute +// it, and/or modify it under the terms of the GNU Lesser General +// Public License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// The full text of the license can be found in the file LICENSE.md at +// the top level directory of deal.II. +// +// --------------------------------------------------------------------- + + +// Read in a dim=1, spacedim=3 file in VTK format, and replicate +// it. This failed at one point because we erroneously tried to find +// correct directions for each line. + + +#include +#include +#include +#include + +#include +#include +#include + +#include "../tests.h" + + +int +main() +{ + initlog(); + + Triangulation<1, 3> triangulation2; + GridIn<1, 3> grid_in1; + grid_in1.attach_triangulation(triangulation2); + std::ifstream input_file1(SOURCE_DIR "/grid_in_vtk_1d_3d.tria2.vtk"); + grid_in1.read_vtk(input_file1); + + Triangulation<1, 3> triangulation3; + GridGenerator::replicate_triangulation(triangulation2, {2}, triangulation3); + + GridOut go; + go.write_gnuplot(triangulation3, deallog.get_file_stream()); +} diff --git a/tests/grid/grid_in_vtk_1d_3d_replicate.output b/tests/grid/grid_in_vtk_1d_3d_replicate.output new file mode 100644 index 0000000000..5a0df99ce8 --- /dev/null +++ b/tests/grid/grid_in_vtk_1d_3d_replicate.output @@ -0,0 +1,33 @@ + +0.00000 0.00000 0.00000 0 0 +0.00000 0.00000 1.00000 0 0 + + +0.00000 0.00000 0.00000 0 1 +0.00000 -1.00000 0.00000 0 1 + + +0.00000 0.00000 0.00000 0 2 +0.00000 0.00000 -1.00000 0 2 + + +0.00000 0.00000 0.00000 0 3 +0.00000 1.00000 0.00000 0 3 + + +0.00000 0.00000 0.00000 0 0 +0.00000 0.00000 1.00000 0 0 + + +0.00000 0.00000 0.00000 0 1 +0.00000 -1.00000 0.00000 0 1 + + +0.00000 0.00000 0.00000 0 2 +0.00000 0.00000 -1.00000 0 2 + + +0.00000 0.00000 0.00000 0 3 +0.00000 1.00000 0.00000 0 3 + + -- 2.39.5