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 function to update ghosts using a list of destinations #1903

Closed
wants to merge 14 commits into from

Conversation

IgorBaratta
Copy link
Member

This is part 1 of a series of PR (2 or 3)

In this PR we add a function update the ghosts given the destination of owned cells.
User can remove or add new ghosts by updating the destination of the owned cells.

Also we have added a function to compute the interface facets between adjacent processes.
This function can be used to apply interface conditions in additive schwarz methods, or to compute a new layer of ghosts (will be used in the next PR).

cpp/dolfinx/mesh/Topology.cpp Outdated Show resolved Hide resolved
cpp/dolfinx/mesh/Topology.cpp Outdated Show resolved Hide resolved
cpp/dolfinx/mesh/Topology.cpp Outdated Show resolved Hide resolved
cpp/dolfinx/mesh/Topology.cpp Outdated Show resolved Hide resolved
cpp/dolfinx/mesh/Topology.cpp Outdated Show resolved Hide resolved
{ return f0 ? false : f1; });

// Remove remote exterior domain facets from candidates
// Note: std::vector<bool> cannot be converted to span<bool>, using
Copy link
Member

Choose a reason for hiding this comment

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

Feel free to change functions that return std::vector<bool> to std::vector<std::int8_t> if it makes code simpler. It will probably be faster too.

cpp/dolfinx/mesh/Topology.h Outdated Show resolved Hide resolved
cpp/dolfinx/mesh/Topology.h Outdated Show resolved Hide resolved
cpp/dolfinx/mesh/utils.cpp Outdated Show resolved Hide resolved
/// @param[in] mesh The mesh
/// @param[in] dest Destination rank for mesh cells owned by this rank
/// @return Mesh with new ghosts
mesh::Mesh update_ghosts(const mesh::Mesh& mesh,
Copy link
Member

Choose a reason for hiding this comment

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

This function name doesn't see right to me. It's not updating a mesh, but creating a new one.

I'm also not sure why one would use the function. Should it really work on a Topology object and return a new Topology object that can then me used to build a Mesh?

Copy link
Member Author

Choose a reason for hiding this comment

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

At first I thought about modifying the mesh object, but the topology has some states (connectivities, entities) that could be invalidated.
I'll modify (simplify) the function to return a new topology, which could be used later for constructing a new mesh.

@IgorBaratta IgorBaratta marked this pull request as draft February 1, 2022 17:46
@IgorBaratta IgorBaratta closed this Apr 4, 2022
@IgorBaratta IgorBaratta deleted the igor/update-ghosts branch January 31, 2024 13:53
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.

None yet

3 participants