From a3cf4822b5283c6e76a4f1c8dbcd7b61636cd2df Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Wed, 25 Nov 2015 09:14:22 -0600 Subject: [PATCH] Allow setting manifold ids on interior edges and faces. --- doc/news/changes.h | 14 + include/deal.II/grid/tria.h | 12 +- source/grid/grid_generator.cc | 56 +- source/grid/tria.cc | 32 +- tests/codim_one/extract_boundary_mesh_10.cc | 74 +++ .../codim_one/extract_boundary_mesh_10.output | 507 ++++++++++++++++++ tests/codim_one/extract_boundary_mesh_11.cc | 79 +++ .../codim_one/extract_boundary_mesh_11.output | 507 ++++++++++++++++++ tests/codim_one/extract_boundary_mesh_13.cc | 80 +++ .../codim_one/extract_boundary_mesh_13.output | 507 ++++++++++++++++++ 10 files changed, 1848 insertions(+), 20 deletions(-) create mode 100644 tests/codim_one/extract_boundary_mesh_10.cc create mode 100644 tests/codim_one/extract_boundary_mesh_10.output create mode 100644 tests/codim_one/extract_boundary_mesh_11.cc create mode 100644 tests/codim_one/extract_boundary_mesh_11.output create mode 100644 tests/codim_one/extract_boundary_mesh_13.cc create mode 100644 tests/codim_one/extract_boundary_mesh_13.output diff --git a/doc/news/changes.h b/doc/news/changes.h index ba93a5e553..436249b091 100644 --- a/doc/news/changes.h +++ b/doc/news/changes.h @@ -444,6 +444,20 @@ inconvenience this causes. (Martin Kronbichler, 2015/11/26) +
  • New: In 3d, GridGenerator::extract_boundary_mesh() now copies the + manifold ids of edges of the volume mesh to the manifold ids of the edges + of the extracted surface mesh. +
    + (Wolfgang Bangerth, 2015/11/25) +
  • + +
  • New: Triangulation::create_triangulation() now accepts subcell-data + objects that may include information about interior edges and faces, to + facilitate setting manifold indicators on interior edges and faces. +
    + (Wolfgang Bangerth, 2015/11/25) +
  • +
  • Fixed: GridGenerator::extract_boundary_mesh() in 3d could generate surface cells that did not uniformly had a right- or left-handed coordinate system associated with them when viewed from one side of the surface. This diff --git a/include/deal.II/grid/tria.h b/include/deal.II/grid/tria.h index abe2993c30..115af08038 100644 --- a/include/deal.II/grid/tria.h +++ b/include/deal.II/grid/tria.h @@ -160,9 +160,15 @@ struct CellData * a common number describing the boundary condition to hold on this part of * the boundary. The triangulation creation function gives lines not in this * list either the boundary indicator zero (if on the boundary) or - * numbers::internal_face_boundary_id (if in the interior). Explicitly giving - * a line the indicator numbers::internal_face_boundary_id will result in an - * error, as well as giving an interior line a boundary indicator. + * numbers::internal_face_boundary_id (if in the interior). + * + * You will get an error if you try to set the boundary indicator of + * an interior edge or face, i.e., an edge or face that is not at the + * boundary of the mesh. However, one may sometimes want to set the + * manifold indicator to an interior object. In this case, set its + * boundary indicator to numbers::internal_face_boundary_id, to + * indicate that you understand that it is an interior object, but set + * its manifold id to the value you want. * * @ingroup grid */ diff --git a/source/grid/grid_generator.cc b/source/grid/grid_generator.cc index 57a4480fc1..d6d7768b91 100644 --- a/source/grid/grid_generator.cc +++ b/source/grid/grid_generator.cc @@ -4209,7 +4209,8 @@ namespace GridGenerator std::vector< bool > touched (get_tria(volume_mesh).n_vertices(), false); std::vector< CellData< boundary_dim > > cells; - std::vector< Point > vertices; + SubCellData subcell_data; + std::vector< Point > vertices; std::map map_vert_index; //volume vertex indices to surf ones @@ -4258,6 +4259,57 @@ namespace GridGenerator if (i % 2 == 1) std::swap (c_data.vertices[1], c_data.vertices[2]); + // in 3d, we also need to make sure we copy the manifold + // indicators from the edges of the volume mesh to the + // edges of the surface mesh + // + // one might think that we we can also prescribe + // boundary indicators for edges, but this is only + // possible for edges that aren't just on the boundary + // of the domain (all of the edges we consider are!) but + // that would actually end up at the boundary of the + // surface mesh. there is no easy way to check this, so + // we simply don't do it and instead set it to an + // invalid value that makes sure + // Triangulation::create_triangulation doesn't copy it + if (dim == 3) + for (unsigned int e=0; e<4; ++e) + { + // see if we already saw this edge from a + // neighboring face, either in this or the reverse + // orientation. if so, skip it. + { + bool edge_found = false; + for (unsigned int i=0; iline(e)->vertex_index(0)]) + && + (subcell_data.boundary_lines[i].vertices[1] + == map_vert_index[face->line(e)->vertex_index(1)])) + || + ((subcell_data.boundary_lines[i].vertices[0] + == map_vert_index[face->line(e)->vertex_index(1)]) + && + (subcell_data.boundary_lines[i].vertices[1] + == map_vert_index[face->line(e)->vertex_index(0)]))) + { + edge_found = true; + break; + } + if (edge_found == true) + continue; // try next edge of current face + } + + CellData<1> edge; + edge.vertices[0] = map_vert_index[face->line(e)->vertex_index(0)]; + edge.vertices[1] = map_vert_index[face->line(e)->vertex_index(1)]; + edge.boundary_id = numbers::internal_face_boundary_id; + edge.manifold_id = face->line(e)->manifold_id(); + + subcell_data.boundary_lines.push_back (edge); + } + + cells.push_back(c_data); mapping.push_back(face); } @@ -4266,7 +4318,7 @@ namespace GridGenerator // create level 0 surface triangulation Assert (cells.size() > 0, ExcMessage ("No boundary faces selected")); const_cast&>(get_tria(surface_mesh)) - .create_triangulation (vertices, cells, SubCellData()); + .create_triangulation (vertices, cells, subcell_data); // Make the actual mapping for (typename Container::active_cell_iterator diff --git a/source/grid/tria.cc b/source/grid/tria.cc index ec95159c5c..0dc87a5423 100644 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@ -1884,8 +1884,7 @@ namespace internal line->set_manifold_id(numbers::flat_manifold_id); } - // set boundary indicators where - // given + // set boundary indicators where given std::vector >::const_iterator boundary_line = subcelldata.boundary_lines.begin(); std::vector >::const_iterator end_boundary_line @@ -1896,13 +1895,11 @@ namespace internal std::pair line_vertices(std::make_pair(boundary_line->vertices[0], boundary_line->vertices[1])); if (needed_lines.find(line_vertices) != needed_lines.end()) - // line found in this - // direction + // line found in this direction line = needed_lines[line_vertices]; else { - // look whether it exists - // in reverse direction + // look whether it exists in reverse direction std::swap (line_vertices.first, line_vertices.second); if (needed_lines.find(line_vertices) != needed_lines.end()) line = needed_lines[line_vertices]; @@ -1912,21 +1909,26 @@ namespace internal line_vertices.second)); } - // assert that we only set - // boundary info once + // assert that we only set boundary info once AssertThrow (! (line->boundary_id() != 0 && line->boundary_id() != numbers::internal_face_boundary_id), ExcMultiplySetLineInfoOfLine(line_vertices.first, line_vertices.second)); - // Assert that only exterior lines - // are given a boundary indicator - AssertThrow (! (line->boundary_id() == numbers::internal_face_boundary_id), - ExcInteriorLineCantBeBoundary(line->vertex_index(0), - line->vertex_index(1), - boundary_line->boundary_id)); + // Assert that only exterior lines are given a boundary + // indicator; however, it is possible that someone may + // want to give an interior line a manifold id (and thus + // lists this line in the subcell_data structure), and we + // need to allow that + if (boundary_line->boundary_id != numbers::internal_face_boundary_id) + { + AssertThrow (! (line->boundary_id() == numbers::internal_face_boundary_id), + ExcInteriorLineCantBeBoundary(line->vertex_index(0), + line->vertex_index(1), + boundary_line->boundary_id)); + line->set_boundary_id (boundary_line->boundary_id); + } - line->set_boundary_id (boundary_line->boundary_id); line->set_manifold_id (boundary_line->manifold_id); } diff --git a/tests/codim_one/extract_boundary_mesh_10.cc b/tests/codim_one/extract_boundary_mesh_10.cc new file mode 100644 index 0000000000..721fbc84b6 --- /dev/null +++ b/tests/codim_one/extract_boundary_mesh_10.cc @@ -0,0 +1,74 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2010 - 2015 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 at +// the top level of the deal.II distribution. +// +// --------------------------------------------------------------------- + + +// We can not copy boundary ids from edges of the volume mesh to edges +// of the surface mesh in 3d because the boundary edges of the volume +// mesh are not necessarily boundary edges of the surface mesh. +// +// if the original mesh's geometry was only defined via the boundary +// indicators, this leads to a surface mesh with a geometry +// description of edges that is not likely what was desired. there is +// little one can do about it with only boundary_ids, and without +// resorting to manifold_ids. this testcase in essence just ensures +// that we continue to get this "undesirable" behavior until someone +// comes up with a better idea + +#include "../tests.h" + +#include +#include +#include +#include +#include + + + +void test() +{ + const int dim=3; + + Triangulation triangulation; + GridGenerator::cylinder(triangulation, 100, 200); + + static const CylinderBoundary outer_cylinder (100,0); + triangulation.set_boundary(0,outer_cylinder); + + // now extract the surface mesh + Triangulation triangulation_surface; + + static const CylinderBoundary surface_cyl(100,0); + triangulation_surface.set_boundary(0,surface_cyl); + + GridGenerator::extract_boundary_mesh(triangulation,triangulation_surface); + + // refine the surface mesh to see the effect of boundary/manifold + // indicators + triangulation_surface.refine_global (1); + GridOut().write_gnuplot(triangulation_surface, deallog.get_file_stream()); + + deallog << triangulation_surface.n_used_vertices() << std::endl; + deallog << triangulation_surface.n_active_cells() << std::endl; +} + + +int main () +{ + std::ofstream logfile("output"); + deallog.attach(logfile); + deallog.depth_console(0); + + test(); +} diff --git a/tests/codim_one/extract_boundary_mesh_10.output b/tests/codim_one/extract_boundary_mesh_10.output new file mode 100644 index 0000000000..65e6d91e62 --- /dev/null +++ b/tests/codim_one/extract_boundary_mesh_10.output @@ -0,0 +1,507 @@ + +-200.000 70.7107 -70.7107 1 1 +-200.000 50.0000 -50.0000 1 1 +-200.000 0.00000 -53.6612 1 1 +-200.000 0.00000 -100.000 1 1 +-200.000 70.7107 -70.7107 1 1 + + +-200.000 50.0000 -50.0000 1 1 +-200.000 29.2893 -29.2893 1 1 +-200.000 0.00000 -29.2893 1 1 +-200.000 0.00000 -53.6612 1 1 +-200.000 50.0000 -50.0000 1 1 + + +-200.000 0.00000 -100.000 1 1 +-200.000 0.00000 -53.6612 1 1 +-200.000 -50.0000 -50.0000 1 1 +-200.000 -70.7107 -70.7107 1 1 +-200.000 0.00000 -100.000 1 1 + + +-200.000 0.00000 -53.6612 1 1 +-200.000 0.00000 -29.2893 1 1 +-200.000 -29.2893 -29.2893 1 1 +-200.000 -50.0000 -50.0000 1 1 +-200.000 0.00000 -53.6612 1 1 + + +-200.000 70.7107 -70.7107 1 0 +-200.000 0.00000 -100.000 1 0 +-100.000 0.00000 -100.000 1 0 +-100.000 70.7107 -70.7107 1 0 +-200.000 70.7107 -70.7107 1 0 + + +-200.000 0.00000 -100.000 1 0 +-200.000 -70.7107 -70.7107 1 0 +-100.000 -70.7107 -70.7107 1 0 +-100.000 0.00000 -100.000 1 0 +-200.000 0.00000 -100.000 1 0 + + +-100.000 70.7107 -70.7107 1 0 +-100.000 0.00000 -100.000 1 0 +0.00000 0.00000 -100.000 1 0 +0.00000 70.7107 -70.7107 1 0 +-100.000 70.7107 -70.7107 1 0 + + +-100.000 0.00000 -100.000 1 0 +-100.000 -70.7107 -70.7107 1 0 +0.00000 -70.7107 -70.7107 1 0 +0.00000 0.00000 -100.000 1 0 +-100.000 0.00000 -100.000 1 0 + + +-200.000 70.7107 -70.7107 1 0 +-100.000 70.7107 -70.7107 1 0 +-100.000 100.000 0.00000 1 0 +-200.000 70.7107 0.00000 1 0 +-200.000 70.7107 -70.7107 1 0 + + +-100.000 70.7107 -70.7107 1 0 +0.00000 70.7107 -70.7107 1 0 +0.00000 100.000 0.00000 1 0 +-100.000 100.000 0.00000 1 0 +-100.000 70.7107 -70.7107 1 0 + + +-200.000 70.7107 0.00000 1 0 +-100.000 100.000 0.00000 1 0 +-100.000 70.7107 70.7107 1 0 +-200.000 70.7107 70.7107 1 0 +-200.000 70.7107 0.00000 1 0 + + +-100.000 100.000 0.00000 1 0 +0.00000 100.000 0.00000 1 0 +0.00000 70.7107 70.7107 1 0 +-100.000 70.7107 70.7107 1 0 +-100.000 100.000 0.00000 1 0 + + +-200.000 70.7107 -70.7107 1 1 +-200.000 70.7107 0.00000 1 1 +-200.000 50.0000 0.00000 1 1 +-200.000 50.0000 -50.0000 1 1 +-200.000 70.7107 -70.7107 1 1 + + +-200.000 70.7107 0.00000 1 1 +-200.000 70.7107 70.7107 1 1 +-200.000 50.0000 50.0000 1 1 +-200.000 50.0000 0.00000 1 1 +-200.000 70.7107 0.00000 1 1 + + +-200.000 50.0000 -50.0000 1 1 +-200.000 50.0000 0.00000 1 1 +-200.000 29.2893 0.00000 1 1 +-200.000 29.2893 -29.2893 1 1 +-200.000 50.0000 -50.0000 1 1 + + +-200.000 50.0000 0.00000 1 1 +-200.000 50.0000 50.0000 1 1 +-200.000 29.2893 29.2893 1 1 +-200.000 29.2893 0.00000 1 1 +-200.000 50.0000 0.00000 1 1 + + +-200.000 29.2893 -29.2893 1 1 +-200.000 29.2893 0.00000 1 1 +-200.000 0.00000 0.00000 1 1 +-200.000 0.00000 -29.2893 1 1 +-200.000 29.2893 -29.2893 1 1 + + +-200.000 29.2893 0.00000 1 1 +-200.000 29.2893 29.2893 1 1 +-200.000 0.00000 29.2893 1 1 +-200.000 0.00000 0.00000 1 1 +-200.000 29.2893 0.00000 1 1 + + +-200.000 0.00000 -29.2893 1 1 +-200.000 0.00000 0.00000 1 1 +-200.000 -29.2893 0.00000 1 1 +-200.000 -29.2893 -29.2893 1 1 +-200.000 0.00000 -29.2893 1 1 + + +-200.000 0.00000 0.00000 1 1 +-200.000 0.00000 29.2893 1 1 +-200.000 -29.2893 29.2893 1 1 +-200.000 -29.2893 0.00000 1 1 +-200.000 0.00000 0.00000 1 1 + + +-200.000 -70.7107 -70.7107 1 1 +-200.000 -50.0000 -50.0000 1 1 +-200.000 -53.6612 0.00000 1 1 +-200.000 -100.000 0.00000 1 1 +-200.000 -70.7107 -70.7107 1 1 + + +-200.000 -50.0000 -50.0000 1 1 +-200.000 -29.2893 -29.2893 1 1 +-200.000 -29.2893 0.00000 1 1 +-200.000 -53.6612 0.00000 1 1 +-200.000 -50.0000 -50.0000 1 1 + + +-200.000 -100.000 0.00000 1 1 +-200.000 -53.6612 0.00000 1 1 +-200.000 -50.0000 50.0000 1 1 +-200.000 -70.7107 70.7107 1 1 +-200.000 -100.000 0.00000 1 1 + + +-200.000 -53.6612 0.00000 1 1 +-200.000 -29.2893 0.00000 1 1 +-200.000 -29.2893 29.2893 1 1 +-200.000 -50.0000 50.0000 1 1 +-200.000 -53.6612 0.00000 1 1 + + +-200.000 -70.7107 -70.7107 1 0 +-200.000 -100.000 0.00000 1 0 +-100.000 -100.000 0.00000 1 0 +-100.000 -70.7107 -70.7107 1 0 +-200.000 -70.7107 -70.7107 1 0 + + +-200.000 -100.000 0.00000 1 0 +-200.000 -70.7107 70.7107 1 0 +-100.000 -70.7107 70.7107 1 0 +-100.000 -100.000 0.00000 1 0 +-200.000 -100.000 0.00000 1 0 + + +-100.000 -70.7107 -70.7107 1 0 +-100.000 -100.000 0.00000 1 0 +0.00000 -100.000 0.00000 1 0 +0.00000 -70.7107 -70.7107 1 0 +-100.000 -70.7107 -70.7107 1 0 + + +-100.000 -100.000 0.00000 1 0 +-100.000 -70.7107 70.7107 1 0 +0.00000 -70.7107 70.7107 1 0 +0.00000 -100.000 0.00000 1 0 +-100.000 -100.000 0.00000 1 0 + + +-200.000 70.7107 70.7107 1 0 +-100.000 70.7107 70.7107 1 0 +-100.000 0.00000 100.000 1 0 +-200.000 0.00000 70.7107 1 0 +-200.000 70.7107 70.7107 1 0 + + +-100.000 70.7107 70.7107 1 0 +0.00000 70.7107 70.7107 1 0 +0.00000 0.00000 100.000 1 0 +-100.000 0.00000 100.000 1 0 +-100.000 70.7107 70.7107 1 0 + + +-200.000 0.00000 70.7107 1 0 +-100.000 0.00000 100.000 1 0 +-100.000 -70.7107 70.7107 1 0 +-200.000 -70.7107 70.7107 1 0 +-200.000 0.00000 70.7107 1 0 + + +-100.000 0.00000 100.000 1 0 +0.00000 0.00000 100.000 1 0 +0.00000 -70.7107 70.7107 1 0 +-100.000 -70.7107 70.7107 1 0 +-100.000 0.00000 100.000 1 0 + + +-200.000 70.7107 70.7107 1 1 +-200.000 0.00000 70.7107 1 1 +-200.000 0.00000 50.0000 1 1 +-200.000 50.0000 50.0000 1 1 +-200.000 70.7107 70.7107 1 1 + + +-200.000 0.00000 70.7107 1 1 +-200.000 -70.7107 70.7107 1 1 +-200.000 -50.0000 50.0000 1 1 +-200.000 0.00000 50.0000 1 1 +-200.000 0.00000 70.7107 1 1 + + +-200.000 50.0000 50.0000 1 1 +-200.000 0.00000 50.0000 1 1 +-200.000 0.00000 29.2893 1 1 +-200.000 29.2893 29.2893 1 1 +-200.000 50.0000 50.0000 1 1 + + +-200.000 0.00000 50.0000 1 1 +-200.000 -50.0000 50.0000 1 1 +-200.000 -29.2893 29.2893 1 1 +-200.000 0.00000 29.2893 1 1 +-200.000 0.00000 50.0000 1 1 + + +200.000 70.7107 -70.7107 1 2 +200.000 0.00000 -100.000 1 2 +200.000 0.00000 -53.6612 1 2 +200.000 50.0000 -50.0000 1 2 +200.000 70.7107 -70.7107 1 2 + + +200.000 0.00000 -100.000 1 2 +200.000 -70.7107 -70.7107 1 2 +200.000 -50.0000 -50.0000 1 2 +200.000 0.00000 -53.6612 1 2 +200.000 0.00000 -100.000 1 2 + + +200.000 50.0000 -50.0000 1 2 +200.000 0.00000 -53.6612 1 2 +200.000 0.00000 -29.2893 1 2 +200.000 29.2893 -29.2893 1 2 +200.000 50.0000 -50.0000 1 2 + + +200.000 0.00000 -53.6612 1 2 +200.000 -50.0000 -50.0000 1 2 +200.000 -29.2893 -29.2893 1 2 +200.000 0.00000 -29.2893 1 2 +200.000 0.00000 -53.6612 1 2 + + +0.00000 70.7107 -70.7107 1 0 +0.00000 0.00000 -100.000 1 0 +100.000 0.00000 -100.000 1 0 +100.000 70.7107 -70.7107 1 0 +0.00000 70.7107 -70.7107 1 0 + + +0.00000 0.00000 -100.000 1 0 +0.00000 -70.7107 -70.7107 1 0 +100.000 -70.7107 -70.7107 1 0 +100.000 0.00000 -100.000 1 0 +0.00000 0.00000 -100.000 1 0 + + +100.000 70.7107 -70.7107 1 0 +100.000 0.00000 -100.000 1 0 +200.000 0.00000 -100.000 1 0 +200.000 70.7107 -70.7107 1 0 +100.000 70.7107 -70.7107 1 0 + + +100.000 0.00000 -100.000 1 0 +100.000 -70.7107 -70.7107 1 0 +200.000 -70.7107 -70.7107 1 0 +200.000 0.00000 -100.000 1 0 +100.000 0.00000 -100.000 1 0 + + +0.00000 70.7107 -70.7107 1 0 +100.000 70.7107 -70.7107 1 0 +100.000 100.000 0.00000 1 0 +0.00000 100.000 0.00000 1 0 +0.00000 70.7107 -70.7107 1 0 + + +100.000 70.7107 -70.7107 1 0 +200.000 70.7107 -70.7107 1 0 +200.000 70.7107 0.00000 1 0 +100.000 100.000 0.00000 1 0 +100.000 70.7107 -70.7107 1 0 + + +0.00000 100.000 0.00000 1 0 +100.000 100.000 0.00000 1 0 +100.000 70.7107 70.7107 1 0 +0.00000 70.7107 70.7107 1 0 +0.00000 100.000 0.00000 1 0 + + +100.000 100.000 0.00000 1 0 +200.000 70.7107 0.00000 1 0 +200.000 70.7107 70.7107 1 0 +100.000 70.7107 70.7107 1 0 +100.000 100.000 0.00000 1 0 + + +200.000 70.7107 -70.7107 1 2 +200.000 50.0000 -50.0000 1 2 +200.000 50.0000 0.00000 1 2 +200.000 70.7107 0.00000 1 2 +200.000 70.7107 -70.7107 1 2 + + +200.000 50.0000 -50.0000 1 2 +200.000 29.2893 -29.2893 1 2 +200.000 29.2893 0.00000 1 2 +200.000 50.0000 0.00000 1 2 +200.000 50.0000 -50.0000 1 2 + + +200.000 70.7107 0.00000 1 2 +200.000 50.0000 0.00000 1 2 +200.000 50.0000 50.0000 1 2 +200.000 70.7107 70.7107 1 2 +200.000 70.7107 0.00000 1 2 + + +200.000 50.0000 0.00000 1 2 +200.000 29.2893 0.00000 1 2 +200.000 29.2893 29.2893 1 2 +200.000 50.0000 50.0000 1 2 +200.000 50.0000 0.00000 1 2 + + +200.000 29.2893 -29.2893 1 2 +200.000 0.00000 -29.2893 1 2 +200.000 0.00000 0.00000 1 2 +200.000 29.2893 0.00000 1 2 +200.000 29.2893 -29.2893 1 2 + + +200.000 0.00000 -29.2893 1 2 +200.000 -29.2893 -29.2893 1 2 +200.000 -29.2893 0.00000 1 2 +200.000 0.00000 0.00000 1 2 +200.000 0.00000 -29.2893 1 2 + + +200.000 29.2893 0.00000 1 2 +200.000 0.00000 0.00000 1 2 +200.000 0.00000 29.2893 1 2 +200.000 29.2893 29.2893 1 2 +200.000 29.2893 0.00000 1 2 + + +200.000 0.00000 0.00000 1 2 +200.000 -29.2893 0.00000 1 2 +200.000 -29.2893 29.2893 1 2 +200.000 0.00000 29.2893 1 2 +200.000 0.00000 0.00000 1 2 + + +200.000 -70.7107 -70.7107 1 2 +200.000 -100.000 0.00000 1 2 +200.000 -53.6612 0.00000 1 2 +200.000 -50.0000 -50.0000 1 2 +200.000 -70.7107 -70.7107 1 2 + + +200.000 -100.000 0.00000 1 2 +200.000 -70.7107 70.7107 1 2 +200.000 -50.0000 50.0000 1 2 +200.000 -53.6612 0.00000 1 2 +200.000 -100.000 0.00000 1 2 + + +200.000 -50.0000 -50.0000 1 2 +200.000 -53.6612 0.00000 1 2 +200.000 -29.2893 0.00000 1 2 +200.000 -29.2893 -29.2893 1 2 +200.000 -50.0000 -50.0000 1 2 + + +200.000 -53.6612 0.00000 1 2 +200.000 -50.0000 50.0000 1 2 +200.000 -29.2893 29.2893 1 2 +200.000 -29.2893 0.00000 1 2 +200.000 -53.6612 0.00000 1 2 + + +0.00000 -70.7107 -70.7107 1 0 +0.00000 -100.000 0.00000 1 0 +100.000 -100.000 0.00000 1 0 +100.000 -70.7107 -70.7107 1 0 +0.00000 -70.7107 -70.7107 1 0 + + +0.00000 -100.000 0.00000 1 0 +0.00000 -70.7107 70.7107 1 0 +100.000 -70.7107 70.7107 1 0 +100.000 -100.000 0.00000 1 0 +0.00000 -100.000 0.00000 1 0 + + +100.000 -70.7107 -70.7107 1 0 +100.000 -100.000 0.00000 1 0 +200.000 -100.000 0.00000 1 0 +200.000 -70.7107 -70.7107 1 0 +100.000 -70.7107 -70.7107 1 0 + + +100.000 -100.000 0.00000 1 0 +100.000 -70.7107 70.7107 1 0 +200.000 -70.7107 70.7107 1 0 +200.000 -100.000 0.00000 1 0 +100.000 -100.000 0.00000 1 0 + + +0.00000 70.7107 70.7107 1 0 +100.000 70.7107 70.7107 1 0 +100.000 0.00000 100.000 1 0 +0.00000 0.00000 100.000 1 0 +0.00000 70.7107 70.7107 1 0 + + +100.000 70.7107 70.7107 1 0 +200.000 70.7107 70.7107 1 0 +200.000 0.00000 70.7107 1 0 +100.000 0.00000 100.000 1 0 +100.000 70.7107 70.7107 1 0 + + +0.00000 0.00000 100.000 1 0 +100.000 0.00000 100.000 1 0 +100.000 -70.7107 70.7107 1 0 +0.00000 -70.7107 70.7107 1 0 +0.00000 0.00000 100.000 1 0 + + +100.000 0.00000 100.000 1 0 +200.000 0.00000 70.7107 1 0 +200.000 -70.7107 70.7107 1 0 +100.000 -70.7107 70.7107 1 0 +100.000 0.00000 100.000 1 0 + + +200.000 70.7107 70.7107 1 2 +200.000 50.0000 50.0000 1 2 +200.000 0.00000 50.0000 1 2 +200.000 0.00000 70.7107 1 2 +200.000 70.7107 70.7107 1 2 + + +200.000 50.0000 50.0000 1 2 +200.000 29.2893 29.2893 1 2 +200.000 0.00000 29.2893 1 2 +200.000 0.00000 50.0000 1 2 +200.000 50.0000 50.0000 1 2 + + +200.000 0.00000 70.7107 1 2 +200.000 0.00000 50.0000 1 2 +200.000 -50.0000 50.0000 1 2 +200.000 -70.7107 70.7107 1 2 +200.000 0.00000 70.7107 1 2 + + +200.000 0.00000 50.0000 1 2 +200.000 0.00000 29.2893 1 2 +200.000 -29.2893 29.2893 1 2 +200.000 -50.0000 50.0000 1 2 +200.000 0.00000 50.0000 1 2 + + +DEAL::74 +DEAL::72 diff --git a/tests/codim_one/extract_boundary_mesh_11.cc b/tests/codim_one/extract_boundary_mesh_11.cc new file mode 100644 index 0000000000..6e0acaf6ea --- /dev/null +++ b/tests/codim_one/extract_boundary_mesh_11.cc @@ -0,0 +1,79 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2010 - 2015 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 at +// the top level of the deal.II distribution. +// +// --------------------------------------------------------------------- + + +// like _10, but this time try to use manifold ids that can be copied +// from the volume to the surface mesh + +#include "../tests.h" + +#include +#include +#include +#include +#include + + + +void test() +{ + const int dim=3; + + Triangulation triangulation; + GridGenerator::cylinder(triangulation, 100, 200); + + // copy boundary indicators to manifold indicators for boundary + // faces. for boundary zero (the outer hull of the cylinder), we + // need to make sure that the adjacent edges are also all + // correct. for the other boundaries, don't bother with adjacent + // edges + for (Triangulation::active_cell_iterator cell=triangulation.begin_active(); + cell != triangulation.end(); ++cell) + for (unsigned int f=0; f::faces_per_cell; ++f) + if (cell->face(f)->at_boundary()) + if (cell->face(f)->boundary_id() == 0) + cell->face(f)->set_all_manifold_ids(0); + else + cell->face(f)->set_manifold_id(cell->face(f)->boundary_id()); + + static const CylinderBoundary outer_cylinder (100,0); + triangulation.set_manifold(0,outer_cylinder); + + // now extract the surface mesh + Triangulation triangulation_surface; + + static const CylinderBoundary surface_cyl(100,0); + triangulation_surface.set_manifold(0,surface_cyl); + + GridGenerator::extract_boundary_mesh(triangulation,triangulation_surface); + + // refine the surface mesh to see the effect of boundary/manifold + // indicators + triangulation_surface.refine_global (1); + GridOut().write_gnuplot(triangulation_surface, deallog.get_file_stream()); + + deallog << triangulation_surface.n_used_vertices() << std::endl; + deallog << triangulation_surface.n_active_cells() << std::endl; +} + + +int main () +{ + std::ofstream logfile("output"); + deallog.attach(logfile); + deallog.depth_console(0); + + test(); +} diff --git a/tests/codim_one/extract_boundary_mesh_11.output b/tests/codim_one/extract_boundary_mesh_11.output new file mode 100644 index 0000000000..cfab62ea4d --- /dev/null +++ b/tests/codim_one/extract_boundary_mesh_11.output @@ -0,0 +1,507 @@ + +-200.000 70.7107 -70.7107 1 1 +-200.000 50.0000 -50.0000 1 1 +-200.000 0.00000 -53.6612 1 1 +-200.000 0.00000 -100.000 1 1 +-200.000 70.7107 -70.7107 1 1 + + +-200.000 50.0000 -50.0000 1 1 +-200.000 29.2893 -29.2893 1 1 +-200.000 0.00000 -29.2893 1 1 +-200.000 0.00000 -53.6612 1 1 +-200.000 50.0000 -50.0000 1 1 + + +-200.000 0.00000 -100.000 1 1 +-200.000 0.00000 -53.6612 1 1 +-200.000 -50.0000 -50.0000 1 1 +-200.000 -70.7107 -70.7107 1 1 +-200.000 0.00000 -100.000 1 1 + + +-200.000 0.00000 -53.6612 1 1 +-200.000 0.00000 -29.2893 1 1 +-200.000 -29.2893 -29.2893 1 1 +-200.000 -50.0000 -50.0000 1 1 +-200.000 0.00000 -53.6612 1 1 + + +-200.000 70.7107 -70.7107 1 0 +-200.000 0.00000 -100.000 1 0 +-100.000 0.00000 -100.000 1 0 +-100.000 70.7107 -70.7107 1 0 +-200.000 70.7107 -70.7107 1 0 + + +-200.000 0.00000 -100.000 1 0 +-200.000 -70.7107 -70.7107 1 0 +-100.000 -70.7107 -70.7107 1 0 +-100.000 0.00000 -100.000 1 0 +-200.000 0.00000 -100.000 1 0 + + +-100.000 70.7107 -70.7107 1 0 +-100.000 0.00000 -100.000 1 0 +0.00000 0.00000 -100.000 1 0 +0.00000 70.7107 -70.7107 1 0 +-100.000 70.7107 -70.7107 1 0 + + +-100.000 0.00000 -100.000 1 0 +-100.000 -70.7107 -70.7107 1 0 +0.00000 -70.7107 -70.7107 1 0 +0.00000 0.00000 -100.000 1 0 +-100.000 0.00000 -100.000 1 0 + + +-200.000 70.7107 -70.7107 1 0 +-100.000 70.7107 -70.7107 1 0 +-100.000 100.000 0.00000 1 0 +-200.000 100.000 0.00000 1 0 +-200.000 70.7107 -70.7107 1 0 + + +-100.000 70.7107 -70.7107 1 0 +0.00000 70.7107 -70.7107 1 0 +0.00000 100.000 0.00000 1 0 +-100.000 100.000 0.00000 1 0 +-100.000 70.7107 -70.7107 1 0 + + +-200.000 100.000 0.00000 1 0 +-100.000 100.000 0.00000 1 0 +-100.000 70.7107 70.7107 1 0 +-200.000 70.7107 70.7107 1 0 +-200.000 100.000 0.00000 1 0 + + +-100.000 100.000 0.00000 1 0 +0.00000 100.000 0.00000 1 0 +0.00000 70.7107 70.7107 1 0 +-100.000 70.7107 70.7107 1 0 +-100.000 100.000 0.00000 1 0 + + +-200.000 70.7107 -70.7107 1 1 +-200.000 100.000 0.00000 1 1 +-200.000 53.6612 0.00000 1 1 +-200.000 50.0000 -50.0000 1 1 +-200.000 70.7107 -70.7107 1 1 + + +-200.000 100.000 0.00000 1 1 +-200.000 70.7107 70.7107 1 1 +-200.000 50.0000 50.0000 1 1 +-200.000 53.6612 0.00000 1 1 +-200.000 100.000 0.00000 1 1 + + +-200.000 50.0000 -50.0000 1 1 +-200.000 53.6612 0.00000 1 1 +-200.000 29.2893 0.00000 1 1 +-200.000 29.2893 -29.2893 1 1 +-200.000 50.0000 -50.0000 1 1 + + +-200.000 53.6612 0.00000 1 1 +-200.000 50.0000 50.0000 1 1 +-200.000 29.2893 29.2893 1 1 +-200.000 29.2893 0.00000 1 1 +-200.000 53.6612 0.00000 1 1 + + +-200.000 29.2893 -29.2893 1 1 +-200.000 29.2893 0.00000 1 1 +-200.000 0.00000 0.00000 1 1 +-200.000 0.00000 -29.2893 1 1 +-200.000 29.2893 -29.2893 1 1 + + +-200.000 29.2893 0.00000 1 1 +-200.000 29.2893 29.2893 1 1 +-200.000 0.00000 29.2893 1 1 +-200.000 0.00000 0.00000 1 1 +-200.000 29.2893 0.00000 1 1 + + +-200.000 0.00000 -29.2893 1 1 +-200.000 0.00000 0.00000 1 1 +-200.000 -29.2893 0.00000 1 1 +-200.000 -29.2893 -29.2893 1 1 +-200.000 0.00000 -29.2893 1 1 + + +-200.000 0.00000 0.00000 1 1 +-200.000 0.00000 29.2893 1 1 +-200.000 -29.2893 29.2893 1 1 +-200.000 -29.2893 0.00000 1 1 +-200.000 0.00000 0.00000 1 1 + + +-200.000 -70.7107 -70.7107 1 1 +-200.000 -50.0000 -50.0000 1 1 +-200.000 -53.6612 0.00000 1 1 +-200.000 -100.000 0.00000 1 1 +-200.000 -70.7107 -70.7107 1 1 + + +-200.000 -50.0000 -50.0000 1 1 +-200.000 -29.2893 -29.2893 1 1 +-200.000 -29.2893 0.00000 1 1 +-200.000 -53.6612 0.00000 1 1 +-200.000 -50.0000 -50.0000 1 1 + + +-200.000 -100.000 0.00000 1 1 +-200.000 -53.6612 0.00000 1 1 +-200.000 -50.0000 50.0000 1 1 +-200.000 -70.7107 70.7107 1 1 +-200.000 -100.000 0.00000 1 1 + + +-200.000 -53.6612 0.00000 1 1 +-200.000 -29.2893 0.00000 1 1 +-200.000 -29.2893 29.2893 1 1 +-200.000 -50.0000 50.0000 1 1 +-200.000 -53.6612 0.00000 1 1 + + +-200.000 -70.7107 -70.7107 1 0 +-200.000 -100.000 0.00000 1 0 +-100.000 -100.000 0.00000 1 0 +-100.000 -70.7107 -70.7107 1 0 +-200.000 -70.7107 -70.7107 1 0 + + +-200.000 -100.000 0.00000 1 0 +-200.000 -70.7107 70.7107 1 0 +-100.000 -70.7107 70.7107 1 0 +-100.000 -100.000 0.00000 1 0 +-200.000 -100.000 0.00000 1 0 + + +-100.000 -70.7107 -70.7107 1 0 +-100.000 -100.000 0.00000 1 0 +0.00000 -100.000 0.00000 1 0 +0.00000 -70.7107 -70.7107 1 0 +-100.000 -70.7107 -70.7107 1 0 + + +-100.000 -100.000 0.00000 1 0 +-100.000 -70.7107 70.7107 1 0 +0.00000 -70.7107 70.7107 1 0 +0.00000 -100.000 0.00000 1 0 +-100.000 -100.000 0.00000 1 0 + + +-200.000 70.7107 70.7107 1 0 +-100.000 70.7107 70.7107 1 0 +-100.000 0.00000 100.000 1 0 +-200.000 0.00000 100.000 1 0 +-200.000 70.7107 70.7107 1 0 + + +-100.000 70.7107 70.7107 1 0 +0.00000 70.7107 70.7107 1 0 +0.00000 0.00000 100.000 1 0 +-100.000 0.00000 100.000 1 0 +-100.000 70.7107 70.7107 1 0 + + +-200.000 0.00000 100.000 1 0 +-100.000 0.00000 100.000 1 0 +-100.000 -70.7107 70.7107 1 0 +-200.000 -70.7107 70.7107 1 0 +-200.000 0.00000 100.000 1 0 + + +-100.000 0.00000 100.000 1 0 +0.00000 0.00000 100.000 1 0 +0.00000 -70.7107 70.7107 1 0 +-100.000 -70.7107 70.7107 1 0 +-100.000 0.00000 100.000 1 0 + + +-200.000 70.7107 70.7107 1 1 +-200.000 0.00000 100.000 1 1 +-200.000 0.00000 53.6612 1 1 +-200.000 50.0000 50.0000 1 1 +-200.000 70.7107 70.7107 1 1 + + +-200.000 0.00000 100.000 1 1 +-200.000 -70.7107 70.7107 1 1 +-200.000 -50.0000 50.0000 1 1 +-200.000 0.00000 53.6612 1 1 +-200.000 0.00000 100.000 1 1 + + +-200.000 50.0000 50.0000 1 1 +-200.000 0.00000 53.6612 1 1 +-200.000 0.00000 29.2893 1 1 +-200.000 29.2893 29.2893 1 1 +-200.000 50.0000 50.0000 1 1 + + +-200.000 0.00000 53.6612 1 1 +-200.000 -50.0000 50.0000 1 1 +-200.000 -29.2893 29.2893 1 1 +-200.000 0.00000 29.2893 1 1 +-200.000 0.00000 53.6612 1 1 + + +200.000 70.7107 -70.7107 1 2 +200.000 0.00000 -100.000 1 2 +200.000 0.00000 -53.6612 1 2 +200.000 50.0000 -50.0000 1 2 +200.000 70.7107 -70.7107 1 2 + + +200.000 0.00000 -100.000 1 2 +200.000 -70.7107 -70.7107 1 2 +200.000 -50.0000 -50.0000 1 2 +200.000 0.00000 -53.6612 1 2 +200.000 0.00000 -100.000 1 2 + + +200.000 50.0000 -50.0000 1 2 +200.000 0.00000 -53.6612 1 2 +200.000 0.00000 -29.2893 1 2 +200.000 29.2893 -29.2893 1 2 +200.000 50.0000 -50.0000 1 2 + + +200.000 0.00000 -53.6612 1 2 +200.000 -50.0000 -50.0000 1 2 +200.000 -29.2893 -29.2893 1 2 +200.000 0.00000 -29.2893 1 2 +200.000 0.00000 -53.6612 1 2 + + +0.00000 70.7107 -70.7107 1 0 +0.00000 0.00000 -100.000 1 0 +100.000 0.00000 -100.000 1 0 +100.000 70.7107 -70.7107 1 0 +0.00000 70.7107 -70.7107 1 0 + + +0.00000 0.00000 -100.000 1 0 +0.00000 -70.7107 -70.7107 1 0 +100.000 -70.7107 -70.7107 1 0 +100.000 0.00000 -100.000 1 0 +0.00000 0.00000 -100.000 1 0 + + +100.000 70.7107 -70.7107 1 0 +100.000 0.00000 -100.000 1 0 +200.000 0.00000 -100.000 1 0 +200.000 70.7107 -70.7107 1 0 +100.000 70.7107 -70.7107 1 0 + + +100.000 0.00000 -100.000 1 0 +100.000 -70.7107 -70.7107 1 0 +200.000 -70.7107 -70.7107 1 0 +200.000 0.00000 -100.000 1 0 +100.000 0.00000 -100.000 1 0 + + +0.00000 70.7107 -70.7107 1 0 +100.000 70.7107 -70.7107 1 0 +100.000 100.000 0.00000 1 0 +0.00000 100.000 0.00000 1 0 +0.00000 70.7107 -70.7107 1 0 + + +100.000 70.7107 -70.7107 1 0 +200.000 70.7107 -70.7107 1 0 +200.000 100.000 0.00000 1 0 +100.000 100.000 0.00000 1 0 +100.000 70.7107 -70.7107 1 0 + + +0.00000 100.000 0.00000 1 0 +100.000 100.000 0.00000 1 0 +100.000 70.7107 70.7107 1 0 +0.00000 70.7107 70.7107 1 0 +0.00000 100.000 0.00000 1 0 + + +100.000 100.000 0.00000 1 0 +200.000 100.000 0.00000 1 0 +200.000 70.7107 70.7107 1 0 +100.000 70.7107 70.7107 1 0 +100.000 100.000 0.00000 1 0 + + +200.000 70.7107 -70.7107 1 2 +200.000 50.0000 -50.0000 1 2 +200.000 53.6612 0.00000 1 2 +200.000 100.000 0.00000 1 2 +200.000 70.7107 -70.7107 1 2 + + +200.000 50.0000 -50.0000 1 2 +200.000 29.2893 -29.2893 1 2 +200.000 29.2893 0.00000 1 2 +200.000 53.6612 0.00000 1 2 +200.000 50.0000 -50.0000 1 2 + + +200.000 100.000 0.00000 1 2 +200.000 53.6612 0.00000 1 2 +200.000 50.0000 50.0000 1 2 +200.000 70.7107 70.7107 1 2 +200.000 100.000 0.00000 1 2 + + +200.000 53.6612 0.00000 1 2 +200.000 29.2893 0.00000 1 2 +200.000 29.2893 29.2893 1 2 +200.000 50.0000 50.0000 1 2 +200.000 53.6612 0.00000 1 2 + + +200.000 29.2893 -29.2893 1 2 +200.000 0.00000 -29.2893 1 2 +200.000 0.00000 0.00000 1 2 +200.000 29.2893 0.00000 1 2 +200.000 29.2893 -29.2893 1 2 + + +200.000 0.00000 -29.2893 1 2 +200.000 -29.2893 -29.2893 1 2 +200.000 -29.2893 0.00000 1 2 +200.000 0.00000 0.00000 1 2 +200.000 0.00000 -29.2893 1 2 + + +200.000 29.2893 0.00000 1 2 +200.000 0.00000 0.00000 1 2 +200.000 0.00000 29.2893 1 2 +200.000 29.2893 29.2893 1 2 +200.000 29.2893 0.00000 1 2 + + +200.000 0.00000 0.00000 1 2 +200.000 -29.2893 0.00000 1 2 +200.000 -29.2893 29.2893 1 2 +200.000 0.00000 29.2893 1 2 +200.000 0.00000 0.00000 1 2 + + +200.000 -70.7107 -70.7107 1 2 +200.000 -100.000 0.00000 1 2 +200.000 -53.6612 0.00000 1 2 +200.000 -50.0000 -50.0000 1 2 +200.000 -70.7107 -70.7107 1 2 + + +200.000 -100.000 0.00000 1 2 +200.000 -70.7107 70.7107 1 2 +200.000 -50.0000 50.0000 1 2 +200.000 -53.6612 0.00000 1 2 +200.000 -100.000 0.00000 1 2 + + +200.000 -50.0000 -50.0000 1 2 +200.000 -53.6612 0.00000 1 2 +200.000 -29.2893 0.00000 1 2 +200.000 -29.2893 -29.2893 1 2 +200.000 -50.0000 -50.0000 1 2 + + +200.000 -53.6612 0.00000 1 2 +200.000 -50.0000 50.0000 1 2 +200.000 -29.2893 29.2893 1 2 +200.000 -29.2893 0.00000 1 2 +200.000 -53.6612 0.00000 1 2 + + +0.00000 -70.7107 -70.7107 1 0 +0.00000 -100.000 0.00000 1 0 +100.000 -100.000 0.00000 1 0 +100.000 -70.7107 -70.7107 1 0 +0.00000 -70.7107 -70.7107 1 0 + + +0.00000 -100.000 0.00000 1 0 +0.00000 -70.7107 70.7107 1 0 +100.000 -70.7107 70.7107 1 0 +100.000 -100.000 0.00000 1 0 +0.00000 -100.000 0.00000 1 0 + + +100.000 -70.7107 -70.7107 1 0 +100.000 -100.000 0.00000 1 0 +200.000 -100.000 0.00000 1 0 +200.000 -70.7107 -70.7107 1 0 +100.000 -70.7107 -70.7107 1 0 + + +100.000 -100.000 0.00000 1 0 +100.000 -70.7107 70.7107 1 0 +200.000 -70.7107 70.7107 1 0 +200.000 -100.000 0.00000 1 0 +100.000 -100.000 0.00000 1 0 + + +0.00000 70.7107 70.7107 1 0 +100.000 70.7107 70.7107 1 0 +100.000 0.00000 100.000 1 0 +0.00000 0.00000 100.000 1 0 +0.00000 70.7107 70.7107 1 0 + + +100.000 70.7107 70.7107 1 0 +200.000 70.7107 70.7107 1 0 +200.000 0.00000 100.000 1 0 +100.000 0.00000 100.000 1 0 +100.000 70.7107 70.7107 1 0 + + +0.00000 0.00000 100.000 1 0 +100.000 0.00000 100.000 1 0 +100.000 -70.7107 70.7107 1 0 +0.00000 -70.7107 70.7107 1 0 +0.00000 0.00000 100.000 1 0 + + +100.000 0.00000 100.000 1 0 +200.000 0.00000 100.000 1 0 +200.000 -70.7107 70.7107 1 0 +100.000 -70.7107 70.7107 1 0 +100.000 0.00000 100.000 1 0 + + +200.000 70.7107 70.7107 1 2 +200.000 50.0000 50.0000 1 2 +200.000 0.00000 53.6612 1 2 +200.000 0.00000 100.000 1 2 +200.000 70.7107 70.7107 1 2 + + +200.000 50.0000 50.0000 1 2 +200.000 29.2893 29.2893 1 2 +200.000 0.00000 29.2893 1 2 +200.000 0.00000 53.6612 1 2 +200.000 50.0000 50.0000 1 2 + + +200.000 0.00000 100.000 1 2 +200.000 0.00000 53.6612 1 2 +200.000 -50.0000 50.0000 1 2 +200.000 -70.7107 70.7107 1 2 +200.000 0.00000 100.000 1 2 + + +200.000 0.00000 53.6612 1 2 +200.000 0.00000 29.2893 1 2 +200.000 -29.2893 29.2893 1 2 +200.000 -50.0000 50.0000 1 2 +200.000 0.00000 53.6612 1 2 + + +DEAL::74 +DEAL::72 diff --git a/tests/codim_one/extract_boundary_mesh_13.cc b/tests/codim_one/extract_boundary_mesh_13.cc new file mode 100644 index 0000000000..27223b23b3 --- /dev/null +++ b/tests/codim_one/extract_boundary_mesh_13.cc @@ -0,0 +1,80 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2010 - 2015 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 at +// the top level of the deal.II distribution. +// +// --------------------------------------------------------------------- + + +// like _11, but refine the volume mesh and not the surface mesh. this +// should yield the same result + +#include "../tests.h" + +#include +#include +#include +#include +#include + + + +void test() +{ + const int dim=3; + + Triangulation triangulation; + GridGenerator::cylinder(triangulation, 100, 200); + + // copy boundary indicators to manifold indicators for boundary + // faces. for boundary zero (the outer hull of the cylinder), we + // need to make sure that the adjacent edges are also all + // correct. for the other boundaries, don't bother with adjacent + // edges + for (Triangulation::active_cell_iterator cell=triangulation.begin_active(); + cell != triangulation.end(); ++cell) + for (unsigned int f=0; f::faces_per_cell; ++f) + if (cell->face(f)->at_boundary()) + if (cell->face(f)->boundary_id() == 0) + cell->face(f)->set_all_manifold_ids(0); + else + cell->face(f)->set_manifold_id(cell->face(f)->boundary_id()); + + static const CylinderBoundary outer_cylinder (100,0); + triangulation.set_manifold(0,outer_cylinder); + + // refine the surface mesh to see the effect of boundary/manifold + // indicators + triangulation.refine_global (1); + + // now extract the surface mesh + Triangulation triangulation_surface; + + static const CylinderBoundary surface_cyl(100,0); + triangulation_surface.set_manifold(0,surface_cyl); + + GridGenerator::extract_boundary_mesh(triangulation,triangulation_surface); + + GridOut().write_gnuplot(triangulation_surface, deallog.get_file_stream()); + + deallog << triangulation_surface.n_used_vertices() << std::endl; + deallog << triangulation_surface.n_active_cells() << std::endl; +} + + +int main () +{ + std::ofstream logfile("output"); + deallog.attach(logfile); + deallog.depth_console(0); + + test(); +} diff --git a/tests/codim_one/extract_boundary_mesh_13.output b/tests/codim_one/extract_boundary_mesh_13.output new file mode 100644 index 0000000000..cfab62ea4d --- /dev/null +++ b/tests/codim_one/extract_boundary_mesh_13.output @@ -0,0 +1,507 @@ + +-200.000 70.7107 -70.7107 1 1 +-200.000 50.0000 -50.0000 1 1 +-200.000 0.00000 -53.6612 1 1 +-200.000 0.00000 -100.000 1 1 +-200.000 70.7107 -70.7107 1 1 + + +-200.000 50.0000 -50.0000 1 1 +-200.000 29.2893 -29.2893 1 1 +-200.000 0.00000 -29.2893 1 1 +-200.000 0.00000 -53.6612 1 1 +-200.000 50.0000 -50.0000 1 1 + + +-200.000 0.00000 -100.000 1 1 +-200.000 0.00000 -53.6612 1 1 +-200.000 -50.0000 -50.0000 1 1 +-200.000 -70.7107 -70.7107 1 1 +-200.000 0.00000 -100.000 1 1 + + +-200.000 0.00000 -53.6612 1 1 +-200.000 0.00000 -29.2893 1 1 +-200.000 -29.2893 -29.2893 1 1 +-200.000 -50.0000 -50.0000 1 1 +-200.000 0.00000 -53.6612 1 1 + + +-200.000 70.7107 -70.7107 1 0 +-200.000 0.00000 -100.000 1 0 +-100.000 0.00000 -100.000 1 0 +-100.000 70.7107 -70.7107 1 0 +-200.000 70.7107 -70.7107 1 0 + + +-200.000 0.00000 -100.000 1 0 +-200.000 -70.7107 -70.7107 1 0 +-100.000 -70.7107 -70.7107 1 0 +-100.000 0.00000 -100.000 1 0 +-200.000 0.00000 -100.000 1 0 + + +-100.000 70.7107 -70.7107 1 0 +-100.000 0.00000 -100.000 1 0 +0.00000 0.00000 -100.000 1 0 +0.00000 70.7107 -70.7107 1 0 +-100.000 70.7107 -70.7107 1 0 + + +-100.000 0.00000 -100.000 1 0 +-100.000 -70.7107 -70.7107 1 0 +0.00000 -70.7107 -70.7107 1 0 +0.00000 0.00000 -100.000 1 0 +-100.000 0.00000 -100.000 1 0 + + +-200.000 70.7107 -70.7107 1 0 +-100.000 70.7107 -70.7107 1 0 +-100.000 100.000 0.00000 1 0 +-200.000 100.000 0.00000 1 0 +-200.000 70.7107 -70.7107 1 0 + + +-100.000 70.7107 -70.7107 1 0 +0.00000 70.7107 -70.7107 1 0 +0.00000 100.000 0.00000 1 0 +-100.000 100.000 0.00000 1 0 +-100.000 70.7107 -70.7107 1 0 + + +-200.000 100.000 0.00000 1 0 +-100.000 100.000 0.00000 1 0 +-100.000 70.7107 70.7107 1 0 +-200.000 70.7107 70.7107 1 0 +-200.000 100.000 0.00000 1 0 + + +-100.000 100.000 0.00000 1 0 +0.00000 100.000 0.00000 1 0 +0.00000 70.7107 70.7107 1 0 +-100.000 70.7107 70.7107 1 0 +-100.000 100.000 0.00000 1 0 + + +-200.000 70.7107 -70.7107 1 1 +-200.000 100.000 0.00000 1 1 +-200.000 53.6612 0.00000 1 1 +-200.000 50.0000 -50.0000 1 1 +-200.000 70.7107 -70.7107 1 1 + + +-200.000 100.000 0.00000 1 1 +-200.000 70.7107 70.7107 1 1 +-200.000 50.0000 50.0000 1 1 +-200.000 53.6612 0.00000 1 1 +-200.000 100.000 0.00000 1 1 + + +-200.000 50.0000 -50.0000 1 1 +-200.000 53.6612 0.00000 1 1 +-200.000 29.2893 0.00000 1 1 +-200.000 29.2893 -29.2893 1 1 +-200.000 50.0000 -50.0000 1 1 + + +-200.000 53.6612 0.00000 1 1 +-200.000 50.0000 50.0000 1 1 +-200.000 29.2893 29.2893 1 1 +-200.000 29.2893 0.00000 1 1 +-200.000 53.6612 0.00000 1 1 + + +-200.000 29.2893 -29.2893 1 1 +-200.000 29.2893 0.00000 1 1 +-200.000 0.00000 0.00000 1 1 +-200.000 0.00000 -29.2893 1 1 +-200.000 29.2893 -29.2893 1 1 + + +-200.000 29.2893 0.00000 1 1 +-200.000 29.2893 29.2893 1 1 +-200.000 0.00000 29.2893 1 1 +-200.000 0.00000 0.00000 1 1 +-200.000 29.2893 0.00000 1 1 + + +-200.000 0.00000 -29.2893 1 1 +-200.000 0.00000 0.00000 1 1 +-200.000 -29.2893 0.00000 1 1 +-200.000 -29.2893 -29.2893 1 1 +-200.000 0.00000 -29.2893 1 1 + + +-200.000 0.00000 0.00000 1 1 +-200.000 0.00000 29.2893 1 1 +-200.000 -29.2893 29.2893 1 1 +-200.000 -29.2893 0.00000 1 1 +-200.000 0.00000 0.00000 1 1 + + +-200.000 -70.7107 -70.7107 1 1 +-200.000 -50.0000 -50.0000 1 1 +-200.000 -53.6612 0.00000 1 1 +-200.000 -100.000 0.00000 1 1 +-200.000 -70.7107 -70.7107 1 1 + + +-200.000 -50.0000 -50.0000 1 1 +-200.000 -29.2893 -29.2893 1 1 +-200.000 -29.2893 0.00000 1 1 +-200.000 -53.6612 0.00000 1 1 +-200.000 -50.0000 -50.0000 1 1 + + +-200.000 -100.000 0.00000 1 1 +-200.000 -53.6612 0.00000 1 1 +-200.000 -50.0000 50.0000 1 1 +-200.000 -70.7107 70.7107 1 1 +-200.000 -100.000 0.00000 1 1 + + +-200.000 -53.6612 0.00000 1 1 +-200.000 -29.2893 0.00000 1 1 +-200.000 -29.2893 29.2893 1 1 +-200.000 -50.0000 50.0000 1 1 +-200.000 -53.6612 0.00000 1 1 + + +-200.000 -70.7107 -70.7107 1 0 +-200.000 -100.000 0.00000 1 0 +-100.000 -100.000 0.00000 1 0 +-100.000 -70.7107 -70.7107 1 0 +-200.000 -70.7107 -70.7107 1 0 + + +-200.000 -100.000 0.00000 1 0 +-200.000 -70.7107 70.7107 1 0 +-100.000 -70.7107 70.7107 1 0 +-100.000 -100.000 0.00000 1 0 +-200.000 -100.000 0.00000 1 0 + + +-100.000 -70.7107 -70.7107 1 0 +-100.000 -100.000 0.00000 1 0 +0.00000 -100.000 0.00000 1 0 +0.00000 -70.7107 -70.7107 1 0 +-100.000 -70.7107 -70.7107 1 0 + + +-100.000 -100.000 0.00000 1 0 +-100.000 -70.7107 70.7107 1 0 +0.00000 -70.7107 70.7107 1 0 +0.00000 -100.000 0.00000 1 0 +-100.000 -100.000 0.00000 1 0 + + +-200.000 70.7107 70.7107 1 0 +-100.000 70.7107 70.7107 1 0 +-100.000 0.00000 100.000 1 0 +-200.000 0.00000 100.000 1 0 +-200.000 70.7107 70.7107 1 0 + + +-100.000 70.7107 70.7107 1 0 +0.00000 70.7107 70.7107 1 0 +0.00000 0.00000 100.000 1 0 +-100.000 0.00000 100.000 1 0 +-100.000 70.7107 70.7107 1 0 + + +-200.000 0.00000 100.000 1 0 +-100.000 0.00000 100.000 1 0 +-100.000 -70.7107 70.7107 1 0 +-200.000 -70.7107 70.7107 1 0 +-200.000 0.00000 100.000 1 0 + + +-100.000 0.00000 100.000 1 0 +0.00000 0.00000 100.000 1 0 +0.00000 -70.7107 70.7107 1 0 +-100.000 -70.7107 70.7107 1 0 +-100.000 0.00000 100.000 1 0 + + +-200.000 70.7107 70.7107 1 1 +-200.000 0.00000 100.000 1 1 +-200.000 0.00000 53.6612 1 1 +-200.000 50.0000 50.0000 1 1 +-200.000 70.7107 70.7107 1 1 + + +-200.000 0.00000 100.000 1 1 +-200.000 -70.7107 70.7107 1 1 +-200.000 -50.0000 50.0000 1 1 +-200.000 0.00000 53.6612 1 1 +-200.000 0.00000 100.000 1 1 + + +-200.000 50.0000 50.0000 1 1 +-200.000 0.00000 53.6612 1 1 +-200.000 0.00000 29.2893 1 1 +-200.000 29.2893 29.2893 1 1 +-200.000 50.0000 50.0000 1 1 + + +-200.000 0.00000 53.6612 1 1 +-200.000 -50.0000 50.0000 1 1 +-200.000 -29.2893 29.2893 1 1 +-200.000 0.00000 29.2893 1 1 +-200.000 0.00000 53.6612 1 1 + + +200.000 70.7107 -70.7107 1 2 +200.000 0.00000 -100.000 1 2 +200.000 0.00000 -53.6612 1 2 +200.000 50.0000 -50.0000 1 2 +200.000 70.7107 -70.7107 1 2 + + +200.000 0.00000 -100.000 1 2 +200.000 -70.7107 -70.7107 1 2 +200.000 -50.0000 -50.0000 1 2 +200.000 0.00000 -53.6612 1 2 +200.000 0.00000 -100.000 1 2 + + +200.000 50.0000 -50.0000 1 2 +200.000 0.00000 -53.6612 1 2 +200.000 0.00000 -29.2893 1 2 +200.000 29.2893 -29.2893 1 2 +200.000 50.0000 -50.0000 1 2 + + +200.000 0.00000 -53.6612 1 2 +200.000 -50.0000 -50.0000 1 2 +200.000 -29.2893 -29.2893 1 2 +200.000 0.00000 -29.2893 1 2 +200.000 0.00000 -53.6612 1 2 + + +0.00000 70.7107 -70.7107 1 0 +0.00000 0.00000 -100.000 1 0 +100.000 0.00000 -100.000 1 0 +100.000 70.7107 -70.7107 1 0 +0.00000 70.7107 -70.7107 1 0 + + +0.00000 0.00000 -100.000 1 0 +0.00000 -70.7107 -70.7107 1 0 +100.000 -70.7107 -70.7107 1 0 +100.000 0.00000 -100.000 1 0 +0.00000 0.00000 -100.000 1 0 + + +100.000 70.7107 -70.7107 1 0 +100.000 0.00000 -100.000 1 0 +200.000 0.00000 -100.000 1 0 +200.000 70.7107 -70.7107 1 0 +100.000 70.7107 -70.7107 1 0 + + +100.000 0.00000 -100.000 1 0 +100.000 -70.7107 -70.7107 1 0 +200.000 -70.7107 -70.7107 1 0 +200.000 0.00000 -100.000 1 0 +100.000 0.00000 -100.000 1 0 + + +0.00000 70.7107 -70.7107 1 0 +100.000 70.7107 -70.7107 1 0 +100.000 100.000 0.00000 1 0 +0.00000 100.000 0.00000 1 0 +0.00000 70.7107 -70.7107 1 0 + + +100.000 70.7107 -70.7107 1 0 +200.000 70.7107 -70.7107 1 0 +200.000 100.000 0.00000 1 0 +100.000 100.000 0.00000 1 0 +100.000 70.7107 -70.7107 1 0 + + +0.00000 100.000 0.00000 1 0 +100.000 100.000 0.00000 1 0 +100.000 70.7107 70.7107 1 0 +0.00000 70.7107 70.7107 1 0 +0.00000 100.000 0.00000 1 0 + + +100.000 100.000 0.00000 1 0 +200.000 100.000 0.00000 1 0 +200.000 70.7107 70.7107 1 0 +100.000 70.7107 70.7107 1 0 +100.000 100.000 0.00000 1 0 + + +200.000 70.7107 -70.7107 1 2 +200.000 50.0000 -50.0000 1 2 +200.000 53.6612 0.00000 1 2 +200.000 100.000 0.00000 1 2 +200.000 70.7107 -70.7107 1 2 + + +200.000 50.0000 -50.0000 1 2 +200.000 29.2893 -29.2893 1 2 +200.000 29.2893 0.00000 1 2 +200.000 53.6612 0.00000 1 2 +200.000 50.0000 -50.0000 1 2 + + +200.000 100.000 0.00000 1 2 +200.000 53.6612 0.00000 1 2 +200.000 50.0000 50.0000 1 2 +200.000 70.7107 70.7107 1 2 +200.000 100.000 0.00000 1 2 + + +200.000 53.6612 0.00000 1 2 +200.000 29.2893 0.00000 1 2 +200.000 29.2893 29.2893 1 2 +200.000 50.0000 50.0000 1 2 +200.000 53.6612 0.00000 1 2 + + +200.000 29.2893 -29.2893 1 2 +200.000 0.00000 -29.2893 1 2 +200.000 0.00000 0.00000 1 2 +200.000 29.2893 0.00000 1 2 +200.000 29.2893 -29.2893 1 2 + + +200.000 0.00000 -29.2893 1 2 +200.000 -29.2893 -29.2893 1 2 +200.000 -29.2893 0.00000 1 2 +200.000 0.00000 0.00000 1 2 +200.000 0.00000 -29.2893 1 2 + + +200.000 29.2893 0.00000 1 2 +200.000 0.00000 0.00000 1 2 +200.000 0.00000 29.2893 1 2 +200.000 29.2893 29.2893 1 2 +200.000 29.2893 0.00000 1 2 + + +200.000 0.00000 0.00000 1 2 +200.000 -29.2893 0.00000 1 2 +200.000 -29.2893 29.2893 1 2 +200.000 0.00000 29.2893 1 2 +200.000 0.00000 0.00000 1 2 + + +200.000 -70.7107 -70.7107 1 2 +200.000 -100.000 0.00000 1 2 +200.000 -53.6612 0.00000 1 2 +200.000 -50.0000 -50.0000 1 2 +200.000 -70.7107 -70.7107 1 2 + + +200.000 -100.000 0.00000 1 2 +200.000 -70.7107 70.7107 1 2 +200.000 -50.0000 50.0000 1 2 +200.000 -53.6612 0.00000 1 2 +200.000 -100.000 0.00000 1 2 + + +200.000 -50.0000 -50.0000 1 2 +200.000 -53.6612 0.00000 1 2 +200.000 -29.2893 0.00000 1 2 +200.000 -29.2893 -29.2893 1 2 +200.000 -50.0000 -50.0000 1 2 + + +200.000 -53.6612 0.00000 1 2 +200.000 -50.0000 50.0000 1 2 +200.000 -29.2893 29.2893 1 2 +200.000 -29.2893 0.00000 1 2 +200.000 -53.6612 0.00000 1 2 + + +0.00000 -70.7107 -70.7107 1 0 +0.00000 -100.000 0.00000 1 0 +100.000 -100.000 0.00000 1 0 +100.000 -70.7107 -70.7107 1 0 +0.00000 -70.7107 -70.7107 1 0 + + +0.00000 -100.000 0.00000 1 0 +0.00000 -70.7107 70.7107 1 0 +100.000 -70.7107 70.7107 1 0 +100.000 -100.000 0.00000 1 0 +0.00000 -100.000 0.00000 1 0 + + +100.000 -70.7107 -70.7107 1 0 +100.000 -100.000 0.00000 1 0 +200.000 -100.000 0.00000 1 0 +200.000 -70.7107 -70.7107 1 0 +100.000 -70.7107 -70.7107 1 0 + + +100.000 -100.000 0.00000 1 0 +100.000 -70.7107 70.7107 1 0 +200.000 -70.7107 70.7107 1 0 +200.000 -100.000 0.00000 1 0 +100.000 -100.000 0.00000 1 0 + + +0.00000 70.7107 70.7107 1 0 +100.000 70.7107 70.7107 1 0 +100.000 0.00000 100.000 1 0 +0.00000 0.00000 100.000 1 0 +0.00000 70.7107 70.7107 1 0 + + +100.000 70.7107 70.7107 1 0 +200.000 70.7107 70.7107 1 0 +200.000 0.00000 100.000 1 0 +100.000 0.00000 100.000 1 0 +100.000 70.7107 70.7107 1 0 + + +0.00000 0.00000 100.000 1 0 +100.000 0.00000 100.000 1 0 +100.000 -70.7107 70.7107 1 0 +0.00000 -70.7107 70.7107 1 0 +0.00000 0.00000 100.000 1 0 + + +100.000 0.00000 100.000 1 0 +200.000 0.00000 100.000 1 0 +200.000 -70.7107 70.7107 1 0 +100.000 -70.7107 70.7107 1 0 +100.000 0.00000 100.000 1 0 + + +200.000 70.7107 70.7107 1 2 +200.000 50.0000 50.0000 1 2 +200.000 0.00000 53.6612 1 2 +200.000 0.00000 100.000 1 2 +200.000 70.7107 70.7107 1 2 + + +200.000 50.0000 50.0000 1 2 +200.000 29.2893 29.2893 1 2 +200.000 0.00000 29.2893 1 2 +200.000 0.00000 53.6612 1 2 +200.000 50.0000 50.0000 1 2 + + +200.000 0.00000 100.000 1 2 +200.000 0.00000 53.6612 1 2 +200.000 -50.0000 50.0000 1 2 +200.000 -70.7107 70.7107 1 2 +200.000 0.00000 100.000 1 2 + + +200.000 0.00000 53.6612 1 2 +200.000 0.00000 29.2893 1 2 +200.000 -29.2893 29.2893 1 2 +200.000 -50.0000 50.0000 1 2 +200.000 0.00000 53.6612 1 2 + + +DEAL::74 +DEAL::72 -- 2.39.5