Skip to content

Commit

Permalink
Merge pull request #768 from wildmeshing/mtao/reducing_multimesh_usage
Browse files Browse the repository at this point in the history
short circuiting lub map if mapping teo teh mesh itself
  • Loading branch information
mtao authored May 11, 2024
2 parents 7b1d92b + a55dfc5 commit 532e3d0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/wmtk/multimesh/MultiMeshManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,9 @@ std::vector<simplex::Simplex> MultiMeshManager::lub_map(
const Mesh& other_mesh,
const simplex::Simplex& my_simplex) const
{
if(&my_mesh == &other_mesh) {
return {my_simplex};
}
const auto ret_tups = lub_map_tuples(my_mesh, other_mesh, my_simplex);
return simplex::utils::tuple_vector_to_homogeneous_simplex_vector(
other_mesh,
Expand Down Expand Up @@ -519,6 +522,9 @@ std::vector<Tuple> MultiMeshManager::lub_map_tuples(
const Mesh& other_mesh,
const simplex::Simplex& my_simplex) const
{
if(&my_mesh == &other_mesh) {
return {my_simplex.tuple()};
}
const auto my_id = absolute_id();
const auto other_id = other_mesh.absolute_multi_mesh_id();
const auto lub_id = least_upper_bound_id(my_id, other_id);
Expand Down

0 comments on commit 532e3d0

Please sign in to comment.