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

Add Grid getter to FunctionSpace #264

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

tom-j-h
Copy link
Contributor

@tom-j-h tom-j-h commented Mar 13, 2025

See #260 for motivation.

I've used the name get_grid_copy(), since BlockStructuredColumns and StructuredColumns already have a grid() method and this would cause a conflict.

As suggested in the Issue, PointCloud stores a Grid if constructed with one. It returns this if it has it, otherwise it generates one using its own iterator. I've added a test case that checks both paths. Although the test is apparently run with MPI=2, the (nb_partitions_ == 1) branch in the added function is being used to generate the Grid because the PointCloud constructor that takes a vector of points does not set nb_partitions_. I've been using the code externally and the parallel branch is giving me correct results, but I think ideally this should be tested. Not sure how to resolve. Should that constructor have a nb_partitions_ = comm.size() statement?

…ightly more complicated. Can't use name grid() since that conflicts with existing API for Structured and BlockStructuredColumns
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant