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

Unify and fix BoundingBoxtree constructor (C++) #3545

Merged
merged 4 commits into from
Dec 2, 2024

Conversation

jorgensd
Copy link
Member

@jorgensd jorgensd commented Dec 2, 2024

Reported by @adeebkor.

The constructor:

 /// Constructor
  /// @param[in] mesh The mesh for building the bounding box tree
  /// @param[in] tdim The topological dimension of the mesh entities to
  /// build the bounding box tree for
  /// @param[in] padding Value to pad (extend) the the bounding box of
  /// each entity by.
  BoundingBoxTree(const mesh::Mesh<T>& mesh, int tdim, T padding = 0)
      : BoundingBoxTree::BoundingBoxTree(
            mesh, tdim, range(mesh.topology_mutable(), tdim), padding)
  {

does not work at the moment (and is never tested), as range takes in a reference, not a shared pointer.

To fix this, and follow the rest of DOLFINx, I've unified the constructors using std::optional.

This also removes the None-conversion in the Python layer.

@jorgensd jorgensd added this pull request to the merge queue Dec 2, 2024
Merged via the queue into main with commit fa8ba41 Dec 2, 2024
34 checks passed
@jorgensd jorgensd deleted the dokken/unify_and_fix_bb branch December 2, 2024 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants