From: Sascha Hofstetter Date: Sun, 6 Jul 2025 11:53:59 +0000 (+0200) Subject: Add instantiation for spacedim 3 and add changelog X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1462e1040776ce40517d5df3fedb18012fe8233;p=dealii.git Add instantiation for spacedim 3 and add changelog --- diff --git a/doc/news/changes/minor/20250701Hofstetter b/doc/news/changes/minor/20250701Hofstetter new file mode 100644 index 0000000000..8441c69120 --- /dev/null +++ b/doc/news/changes/minor/20250701Hofstetter @@ -0,0 +1,6 @@ +New: Implementation of CGAL functionalities for 2D. +Convert a dealii cell to a CGAL::Polygon_2 +Convert a dealii triangulation to a CGAL::Polygon_2 +Perform boolean operation on two CGAL::Polygon_2 +
+(Sascha Hofstetter, 2025/07/01) diff --git a/doc/news/changes/minor/20250706Hofstetter b/doc/news/changes/minor/20250706Hofstetter new file mode 100644 index 0000000000..ff2f48033d --- /dev/null +++ b/doc/news/changes/minor/20250706Hofstetter @@ -0,0 +1,7 @@ +New: GridTools::extract_ordered_boundary_vertices. +The function returns a vector with all closed boundaries. +Each closed boundary is a vector with vertices. +The outer boundary is ordered counter clockwise, +inner boundaries are ordered clockwise. +
+(Sascha Hofstetter, 2025/07/06) diff --git a/source/grid/grid_tools_topology.cc b/source/grid/grid_tools_topology.cc index de422ad36f..500c38a69f 100644 --- a/source/grid/grid_tools_topology.cc +++ b/source/grid/grid_tools_topology.cc @@ -1675,16 +1675,17 @@ namespace GridTools - template <> - std::vector>>> - extract_ordered_boundary_vertices<2, 2>(const Triangulation<2, 2> &tria, - const Mapping<2, 2> &mapping) + template + std::vector>>> + extract_ordered_boundary_vertices(const Triangulation &tria, + const Mapping &mapping) { + Assert(dim == 2, ExcMessage("Only implemented for 2D triangulations")); // This map holds the two vertex indices of each face. // Counterclockwise first vertex index on first position, // counterclockwise second vertex index on second position. - std::map face_vertex_indices; - std::map> vertex_to_point; + std::map face_vertex_indices; + std::map> vertex_to_point; // Iterate over all active cells at the boundary for (const auto &cell : tria.active_cell_iterators()) @@ -1734,8 +1735,9 @@ namespace GridTools } } - std::vector>>> boundaries; - std::vector>> current_boundary; + std::vector>>> + boundaries; + std::vector>> current_boundary; // Vertex to start counterclockwise insertion unsigned int start_index = face_vertex_indices.begin()->first; diff --git a/source/grid/grid_tools_topology.inst.in b/source/grid/grid_tools_topology.inst.in index b4cc4ebf71..03d9dfa133 100644 --- a/source/grid/grid_tools_topology.inst.in +++ b/source/grid/grid_tools_topology.inst.in @@ -60,6 +60,14 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS) get_all_vertices_at_boundary( const Triangulation &tria); +# if deal_II_dimension == 2 + template std::vector< + std::vector>>> + extract_ordered_boundary_vertices( + const Triangulation &tria, + const Mapping &mapping); +# endif + template std::vector< std::set::active_cell_iterator>>