FEniCS / dolfinx

Next generation FEniCS problem solving environment
https://fenicsproject.org
GNU Lesser General Public License v3.0
742 stars 178 forks source link

using shared_ptr comparison for entity_maps keys #3278

Closed jorgensd closed 2 months ago

jorgensd commented 3 months ago

Summarize the issue

The current code relies on the key of the entity_map being a shared ptr. This is not safe, as different shared_ptr instances to the same object will give an inequality, ref: https://cplusplus.com/reference/memory/shared_ptr/operators/ Already been mentioned in: https://github.com/FEniCS/dolfinx/pull/3262#issue-2340571507

Version

main branch

DOLFINx git commit

f6a86aac898c9bb68f6489cdd54c64e2b1317944

Installation

No response

Additional information

I think we need to use strings to identify the different meshes, as I do not see any scalable way of comparing whole mesh objects (would have to compare all underlying topology and geometry structures, which is very expensive.