]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix variadic 13904/head
authorMarco Feder <marco.feder@sissa.it>
Thu, 2 Jun 2022 22:11:05 +0000 (00:11 +0200)
committerLuca Heltai <luca.heltai@sissa.it>
Mon, 6 Jun 2022 08:11:07 +0000 (10:11 +0200)
include/deal.II/cgal/utilities.h
tests/cgal/cgal_mesh_criteria.cc

index ae8b7178f9797d8798e22f21fd36486a069b02b1..d94bc384cfcdc1593a13a7b2dd1a5a11f6395fe9 100644 (file)
@@ -237,52 +237,18 @@ namespace CGALWrappers
    * Given a closed CGAL::Surface_mesh, this function fills the
    * region bounded by the surface with tets.
    *
-   * The optional variable arguments @p cgal_args can be used to pass additional
-   * arguments to the CGAL::Mesh_criteria_3 class (see
-   * https://doc.cgal.org/latest/Mesh_3/index.html) for more information.
-   *
-   * The arguments allow for fine control on the size, quality, and distribution
-   * of the cells of the final triangulation. CGAL uses named parameters for
-   * these arguments in dimension three, i.e., they must be specified with the
-   * syntax `CGAL::parameters::parameter_name=parameter_value`, irrespective of
-   * their order. Accepted parameters are:
-   *
-   * - CGAL::parameters::edge_size: a scalar field (resp. a constant) providing
-   * a space varying (resp. a uniform) upper bound for the lengths of curve
-   * edges. This parameter has to be set to a positive value when 1-dimensional
-   * features protection is used.
-   * - CGAL::parameters::facet_angle: a lower bound for the angles (in degrees)
-   * of the surface mesh facets.
-   * - CGAL::parameters::facet_size: a scalar field (resp. a constant)
-   * describing a space varying (resp. a uniform) upper-bound or for the radii
-   * of the surface Delaunay balls.
-   * - CGAL::parameters::facet_distance: a scalar field (resp. a constant)
-   * describing a space varying (resp. a uniform) upper bound for the distance
-   * between the facet circumcenter and the center of its surface Delaunay ball.
-   * - CGAL::parameters::facet_topology: the set of topological constraints
-   * which have to be verified by each surface facet. The default value is
-   * CGAL::FACET_VERTICES_ON_SURFACE. See CGAL::Mesh_facet_topology manual page
-   * to get all possible values.
-   * - CGAL::parameters::cell_radius_edge_ratio: an upper bound for the
-   * radius-edge ratio of the mesh tetrahedra.
-   * - CGAL::parameters::cell_size: a scalar field (resp. a constant) describing
-   * a space varying (resp. a uniform) upper-bound for the circumradii of the
-   * mesh tetrahedra.
-   *
-   * If no parameters are specified, all the values will be set to `ignored` by
-   * CGAL.
-   *
    *
    * @param [in] surface_mesh The (closed) surface mesh bounding the volume that has to be filled.
    * @param [out] triangulation The output triangulation filled with tetrahedra.
-   * @param [in] cgal_args Additional parameters to pass to the CGAL::make_mesh_3 function.
+   * @param [in] data AdditionalData object to pass to the CGAL::make_mesh_3 function. See the documentation
+   * of that struct for a description of those parameters.
    */
-  template <typename C3t3, typename... Args>
+  template <typename C3t3>
   void
   cgal_surface_mesh_to_cgal_triangulation(
     CGAL::Surface_mesh<typename C3t3::Point::Point> &surface_mesh,
     C3t3 &                                           triangulation,
-    Args... cgal_args);
+    const AdditionalData<3> &data = AdditionalData<3>{});
 
   /**
    * Given two triangulated surface meshes that bound two volumes, execute a
@@ -448,12 +414,12 @@ namespace CGALWrappers
 
 
 
-  template <typename C3t3, typename... Args>
+  template <typename C3t3>
   void
   cgal_surface_mesh_to_cgal_triangulation(
     CGAL::Surface_mesh<typename C3t3::Point::Point> &surface_mesh,
     C3t3 &                                           triangulation,
-    Args... cgal_args)
+    const AdditionalData<3> &                        data)
   {
     using CGALPointType = typename C3t3::Point::Point;
     Assert(CGAL::is_closed(surface_mesh),
@@ -470,7 +436,13 @@ namespace CGALWrappers
     CGAL::Polygon_mesh_processing::triangulate_faces(surface_mesh);
     Mesh_domain domain(surface_mesh);
     domain.detect_features();
-    Mesh_criteria criteria(cgal_args...);
+    Mesh_criteria criteria(CGAL::parameters::facet_size  = data.facet_size,
+                           CGAL::parameters::facet_angle = data.facet_angle,
+                           CGAL::parameters::facet_distance =
+                             data.facet_distance,
+                           CGAL::parameters::cell_radius_edge_ratio =
+                             data.cell_radius_edge_ratio,
+                           CGAL::parameters::cell_size = data.cell_size);
     // Mesh generation
     triangulation = CGAL::make_mesh_3<C3t3>(domain,
                                             criteria,
index f62e432fd8dc317fdc12874bd208c8551e6dd6cf..daeca0e6efc341ee10b997a610ab004d25af4f83 100644 (file)
@@ -46,14 +46,13 @@ test()
   C3t3                          tria;
   std::ifstream                 input("input_grids/cube.off");
   input >> sm;
-  cgal_surface_mesh_to_cgal_triangulation(sm,
-                                          tria,
-                                          CGAL::parameters::cell_size = 0.1);
+  AdditionalData<3> data;
+  data.cell_size = .1;
+  cgal_surface_mesh_to_cgal_triangulation(sm, tria, data);
   const unsigned int n_intial_facets = tria.number_of_facets_in_complex();
   tria.clear();
-  cgal_surface_mesh_to_cgal_triangulation(sm,
-                                          tria,
-                                          CGAL::parameters::cell_size = 0.5);
+  data.cell_size = .5;
+  cgal_surface_mesh_to_cgal_triangulation(sm, tria, data);
 
   Assert(
     n_intial_facets > tria.number_of_facets_in_complex(),

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.