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

extend distributed_compute_point_locations #15101

Merged
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
14 changes: 13 additions & 1 deletion include/deal.II/grid/grid_tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -1108,6 +1108,16 @@ namespace GridTools
* of the cells adjacent to a vertex or an edge/face this function returns.
* Consequently, algorithms that call this function need to take into
* account that the returned cell will only contain the point approximately.
* @param[in] enforce_unique_mapping Enforce a one to one mapping between
points
* in real and reference space.
* @param[in] marked_vertices An array of bools indicating which
* vertices of @p mesh will be considered within the search
* as the potentially closest vertex. On receiving a non-empty
* @p marked_vertices, the function will
* only search among @p marked_vertices for the closest vertex,
* otherwise on all vertices in the mesh.

* @return A tuple containing the quadrature information
*
* The elements of the output tuple are:
Expand Down Expand Up @@ -1164,7 +1174,9 @@ namespace GridTools
const GridTools::Cache<dim, spacedim> & cache,
const std::vector<Point<spacedim>> & local_points,
const std::vector<std::vector<BoundingBox<spacedim>>> &global_bboxes,
const double tolerance = 1e-10);
const double tolerance = 1e-10,
const std::vector<bool> & marked_vertices = {},
const bool enforce_unique_mapping = true);
Comment on lines +1177 to +1179
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the different ordering of the parameters in comparison to the one of the internal function is a bit annoying but we cannot change that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking about the same thing. I think even if we could change it without problems within deal.II (what I am not sure about), it might break user code. Thus, I refrained from this.


namespace internal
{
Expand Down
16 changes: 12 additions & 4 deletions source/grid/grid_tools.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5924,12 +5924,20 @@ namespace GridTools
const GridTools::Cache<dim, spacedim> & cache,
const std::vector<Point<spacedim>> & points,
const std::vector<std::vector<BoundingBox<spacedim>>> &global_bboxes,
const double tolerance)
const double tolerance,
const std::vector<bool> & marked_vertices,
const bool enforce_unique_mapping)
{
// run internal function ...
const auto all = internal::distributed_compute_point_locations(
cache, points, global_bboxes, {}, tolerance, false, true)
.send_components;
const auto all =
internal::distributed_compute_point_locations(cache,
points,
global_bboxes,
marked_vertices,
tolerance,
false,
enforce_unique_mapping)
.send_components;

// ... and reshuffle the data
std::tuple<
Expand Down
4 changes: 3 additions & 1 deletion source/grid/grid_tools.inst.in
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@ for (deal_II_dimension : DIMENSIONS; deal_II_space_dimension : SPACE_DIMENSIONS)
const Cache<deal_II_dimension, deal_II_space_dimension> &,
const std::vector<Point<deal_II_space_dimension>> &,
const std::vector<std::vector<BoundingBox<deal_II_space_dimension>>> &,
const double tolerance);
const double tolerance,
const std::vector<bool> &marked_vertices,
const bool enforce_unique_mapping);

template internal::DistributedComputePointLocationsInternal<
deal_II_dimension,
Expand Down