]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Add instantiation for spacedim 3 and add changelog
authorSascha Hofstetter <hofssasc@gmail.com>
Sun, 6 Jul 2025 11:53:59 +0000 (13:53 +0200)
committerSascha Hofstetter <hofssasc@gmail.com>
Sun, 6 Jul 2025 12:13:19 +0000 (14:13 +0200)
doc/news/changes/minor/20250701Hofstetter [new file with mode: 0644]
doc/news/changes/minor/20250706Hofstetter [new file with mode: 0644]
source/grid/grid_tools_topology.cc
source/grid/grid_tools_topology.inst.in

diff --git a/doc/news/changes/minor/20250701Hofstetter b/doc/news/changes/minor/20250701Hofstetter
new file mode 100644 (file)
index 0000000..8441c69
--- /dev/null
@@ -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
+<br>
+(Sascha Hofstetter, 2025/07/01)
diff --git a/doc/news/changes/minor/20250706Hofstetter b/doc/news/changes/minor/20250706Hofstetter
new file mode 100644 (file)
index 0000000..ff2f480
--- /dev/null
@@ -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.
+<br>
+(Sascha Hofstetter, 2025/07/06)
index de422ad36fda0d184f9f8daf2ea9dd70a82e4065..500c38a69f3ab3437dae9367f429a56488bee776 100644 (file)
@@ -1675,16 +1675,17 @@ namespace GridTools
 
 
 
-  template <>
-  std::vector<std::vector<std::pair<unsigned int, Point<2>>>>
-  extract_ordered_boundary_vertices<2, 2>(const Triangulation<2, 2> &tria,
-                                          const Mapping<2, 2>       &mapping)
+  template <int dim, int spacedim>
+  std::vector<std::vector<std::pair<unsigned int, Point<spacedim>>>>
+  extract_ordered_boundary_vertices(const Triangulation<dim, spacedim> &tria,
+                                    const Mapping<dim, spacedim>       &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<unsigned int, unsigned int> face_vertex_indices;
-    std::map<unsigned int, Point<2>>     vertex_to_point;
+    std::map<unsigned int, unsigned int>    face_vertex_indices;
+    std::map<unsigned int, Point<spacedim>> 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<std::vector<std::pair<unsigned int, Point<2>>>> boundaries;
-    std::vector<std::pair<unsigned int, Point<2>>> current_boundary;
+    std::vector<std::vector<std::pair<unsigned int, Point<spacedim>>>>
+                                                          boundaries;
+    std::vector<std::pair<unsigned int, Point<spacedim>>> current_boundary;
 
     // Vertex to start counterclockwise insertion
     unsigned int start_index   = face_vertex_indices.begin()->first;
index b4cc4ebf719ca2046747bbc64d75d1e9e6ed1340..03d9dfa1339eb0e285d0a0be1f7371d71f9eee8b 100644 (file)
@@ -60,6 +60,14 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
       get_all_vertices_at_boundary(
         const Triangulation<deal_II_dimension, deal_II_space_dimension> &tria);
 
+#  if deal_II_dimension == 2
+      template std::vector<
+        std::vector<std::pair<unsigned int, Point<deal_II_space_dimension>>>>
+      extract_ordered_boundary_vertices(
+        const Triangulation<deal_II_dimension, deal_II_space_dimension> &tria,
+        const Mapping<deal_II_dimension, deal_II_space_dimension> &mapping);
+#  endif
+
       template std::vector<
         std::set<Triangulation<deal_II_dimension,
                                deal_II_space_dimension>::active_cell_iterator>>

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.