Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename template parameters #16436

Merged
merged 1 commit into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 9 additions & 9 deletions include/deal.II/cgal/intersections.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ namespace CGALWrappers
* @param tol Threshold to decide whether or not a simplex is included.
* @return Vector of arrays, where each array identify a simplex by its vertices.
*/
template <int dim0, int dim1, int spacedim>
std::vector<std::array<Point<spacedim>, dim1 + 1>>
template <int structdim0, int structdim1, int spacedim>
std::vector<std::array<Point<spacedim>, structdim1 + 1>>
compute_intersection_of_cells(
const typename Triangulation<dim0, spacedim>::cell_iterator &cell0,
const typename Triangulation<dim1, spacedim>::cell_iterator &cell1,
const Mapping<dim0, spacedim> &mapping0,
const Mapping<dim1, spacedim> &mapping1,
const double tol = 1e-9);
const typename Triangulation<structdim0, spacedim>::cell_iterator &cell0,
const typename Triangulation<structdim1, spacedim>::cell_iterator &cell1,
const Mapping<structdim0, spacedim> &mapping0,
const Mapping<structdim1, spacedim> &mapping1,
const double tol = 1e-9);


/**
Expand All @@ -68,8 +68,8 @@ namespace CGALWrappers
*
* @note The vertices have to be given in CGAL order.
*/
template <int dim0, int dim1, int spacedim>
std::vector<std::array<Point<spacedim>, dim1 + 1>>
template <int structdim0, int structdim1, int spacedim>
std::vector<std::array<Point<spacedim>, structdim1 + 1>>
compute_intersection_of_cells(
const ArrayView<const Point<spacedim>> &vertices0,
const ArrayView<const Point<spacedim>> &vertices1,
Expand Down
57 changes: 28 additions & 29 deletions source/cgal/intersections.cc
Original file line number Diff line number Diff line change
Expand Up @@ -749,8 +749,8 @@ namespace CGALWrappers
} // namespace internal


template <int dim0, int dim1, int spacedim>
std::vector<std::array<Point<spacedim>, dim1 + 1>>
template <int structdim0, int structdim1, int spacedim>
std::vector<std::array<Point<spacedim>, structdim1 + 1>>
compute_intersection_of_cells(
const ArrayView<const Point<spacedim>> &vertices0,
const ArrayView<const Point<spacedim>> &vertices1,
Expand All @@ -764,7 +764,7 @@ namespace CGALWrappers
ExcMessage(
"The intersection cannot be computed as at least one of the two cells has no vertices."));

if constexpr (dim0 == 2 && dim1 == 2 && spacedim == 2)
if constexpr (structdim0 == 2 && structdim1 == 2 && spacedim == 2)
{
if (n_vertices0 == 4 && n_vertices1 == 4)
{
Expand All @@ -773,7 +773,7 @@ namespace CGALWrappers
tol);
}
}
else if constexpr (dim0 == 2 && dim1 == 1 && spacedim == 2)
else if constexpr (structdim0 == 2 && structdim1 == 1 && spacedim == 2)
{
if (n_vertices0 == 4 && n_vertices1 == 2)
{
Expand All @@ -782,7 +782,7 @@ namespace CGALWrappers
tol);
}
}
else if constexpr (dim0 == 3 && dim1 == 1 && spacedim == 3)
else if constexpr (structdim0 == 3 && structdim1 == 1 && spacedim == 3)
{
if (n_vertices0 == 8 && n_vertices1 == 2)
{
Expand All @@ -791,7 +791,7 @@ namespace CGALWrappers
tol);
}
}
else if constexpr (dim0 == 3 && dim1 == 2 && spacedim == 3)
else if constexpr (structdim0 == 3 && structdim1 == 2 && spacedim == 3)
{
if (n_vertices0 == 8 && n_vertices1 == 4)
{
Expand All @@ -800,7 +800,7 @@ namespace CGALWrappers
tol);
}
}
else if constexpr (dim0 == 3 && dim1 == 3 && spacedim == 3)
else if constexpr (structdim0 == 3 && structdim1 == 3 && spacedim == 3)
{
if (n_vertices0 == 8 && n_vertices1 == 8)
{
Expand All @@ -819,30 +819,29 @@ namespace CGALWrappers
}


template <int dim0, int dim1, int spacedim>
std::vector<std::array<Point<spacedim>, dim1 + 1>>
template <int structdim0, int structdim1, int spacedim>
std::vector<std::array<Point<spacedim>, structdim1 + 1>>
compute_intersection_of_cells(
const typename Triangulation<dim0, spacedim>::cell_iterator &cell0,
const typename Triangulation<dim1, spacedim>::cell_iterator &cell1,
const Mapping<dim0, spacedim> &mapping0,
const Mapping<dim1, spacedim> &mapping1,
const double tol)
const typename Triangulation<structdim0, spacedim>::cell_iterator &cell0,
const typename Triangulation<structdim1, spacedim>::cell_iterator &cell1,
const Mapping<structdim0, spacedim> &mapping0,
const Mapping<structdim1, spacedim> &mapping1,
const double tol)
{
Assert(mapping0.get_vertices(cell0).size() ==
ReferenceCells::get_hypercube<dim0>().n_vertices(),
ReferenceCells::get_hypercube<structdim0>().n_vertices(),
ExcNotImplemented());
Assert(mapping1.get_vertices(cell1).size() ==
ReferenceCells::get_hypercube<dim1>().n_vertices(),
ReferenceCells::get_hypercube<structdim1>().n_vertices(),
ExcNotImplemented());

const auto &vertices0 =
CGALWrappers::get_vertices_in_cgal_order(cell0, mapping0);
const auto &vertices1 =
CGALWrappers::get_vertices_in_cgal_order(cell1, mapping1);

return compute_intersection_of_cells<dim0, dim1, spacedim>(vertices0,
vertices1,
tol);
return compute_intersection_of_cells<structdim0, structdim1, spacedim>(
vertices0, vertices1, tol);
}

# include "intersections.inst"
Expand All @@ -855,12 +854,12 @@ DEAL_II_NAMESPACE_CLOSE

DEAL_II_NAMESPACE_OPEN

template <int dim0,
int dim1,
template <int structdim0,
int structdim1,
int spacedim,
int n_components0,
int n_components1>
std::vector<std::array<Point<spacedim>, dim1 + 1>>
std::vector<std::array<Point<spacedim>, structdim1 + 1>>
compute_intersection_of_cells(
const std::array<Point<spacedim>, n_components0> &vertices0,
const std::array<Point<spacedim>, n_components1> &vertices1,
Expand All @@ -872,14 +871,14 @@ compute_intersection_of_cells(
AssertThrow(false, ExcNeedsCGAL());
}

template <int dim0, int dim1, int spacedim>
std::vector<std::array<Point<spacedim>, dim1 + 1>>
template <int structdim0, int structdim1, int spacedim>
std::vector<std::array<Point<spacedim>, structdim1 + 1>>
compute_intersection_of_cells(
const typename Triangulation<dim0, spacedim>::cell_iterator &cell0,
const typename Triangulation<dim1, spacedim>::cell_iterator &cell1,
const Mapping<dim0, spacedim> &mapping0,
const Mapping<dim1, spacedim> &mapping1,
const double tol)
const typename Triangulation<structdim0, spacedim>::cell_iterator &cell0,
const typename Triangulation<structdim1, spacedim>::cell_iterator &cell1,
const Mapping<structdim0, spacedim> &mapping0,
const Mapping<structdim1, spacedim> &mapping1,
const double tol)
{
(void)cell0;
(void)cell1;
Expand Down
23 changes: 12 additions & 11 deletions source/cgal/intersections.inst.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,21 @@



for (dim0 : DIMENSIONS; dim1 : DIMENSIONS; spacedim : SPACE_DIMENSIONS)
for (structdim0 : DIMENSIONS; structdim1 : DIMENSIONS;
spacedim : SPACE_DIMENSIONS)
{
#if dim0 <= spacedim && dim0 >= dim1
#if structdim0 <= spacedim && structdim0 >= structdim1

template std::vector<std::array<Point<spacedim>, dim1 + 1>>
compute_intersection_of_cells<dim0, dim1, spacedim>(
const typename Triangulation<dim0, spacedim>::cell_iterator &cell0,
const typename Triangulation<dim1, spacedim>::cell_iterator &cell1,
const Mapping<dim0, spacedim> &mapping0,
const Mapping<dim1, spacedim> &mapping1,
const double tol);
template std::vector<std::array<Point<spacedim>, structdim1 + 1>>
compute_intersection_of_cells<structdim0, structdim1, spacedim>(
const typename Triangulation<structdim0, spacedim>::cell_iterator &cell0,
const typename Triangulation<structdim1, spacedim>::cell_iterator &cell1,
const Mapping<structdim0, spacedim> &mapping0,
const Mapping<structdim1, spacedim> &mapping1,
const double tol);

template std::vector<std::array<Point<spacedim>, dim1 + 1>>
compute_intersection_of_cells<dim0, dim1, spacedim>(
template std::vector<std::array<Point<spacedim>, structdim1 + 1>>
compute_intersection_of_cells<structdim0, structdim1, spacedim>(
const ArrayView<const Point<spacedim>> &vertices0,
const ArrayView<const Point<spacedim>> &vertices1,
const double tol);
Expand Down