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

More work towards supporting mixed-topology meshes #3590

Open
wants to merge 105 commits into
base: main
Choose a base branch
from

Conversation

jpdean
Copy link
Member

@jpdean jpdean commented Jan 8, 2025

This PR builds on @chrisrichardson's work in this branch to support mixed-topology meshes.

The idea is to allow fem::FunctionSpace to have multiple elements/dofmaps for each cell type. Similarly, fem::Form now can have more than one integral_data for a given subdomain ID, one for each kernel type. In the assembler, we simply loop over each kernel type. There are no changes to the lowest level assemblers. Currently, it only works for cell integrals and matrix assembly, but this design should easily generalise to assembling vectors/scalars and exterior facet integrals. The design should also generalise to interior facet integrals, but this will need more work because we need to generate kernels and access the DOF maps for each compatible combination of cell types etc.

It's just a draft for now; any comments on the general design would be much appreciated. If we think this is the right approach, I can modify the other assemblers and add support for exterior facet integrals.

@jpdean jpdean marked this pull request as draft January 8, 2025 15:31
@chrisrichardson
Copy link
Contributor

Seems to be crashing in sparsity pattern builder at the moment.

@jpdean jpdean marked this pull request as ready for review January 10, 2025 14:10

# Solve
A_scipy = A.to_scipy()
b_scipy = np.ones(A_scipy.shape[1])
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we also assemble RHS? Maybe add an issue and next PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

This PR only adds matrix assembly, but adding vector / scalar assembly should be straightforward. It would be a small extra PR.

@garth-wells garth-wells added the enhancement New feature or request label Jan 11, 2025
/// @brief Create function space for given mesh, elements and
/// degree-of-freedom maps.
/// @param[in] mesh Mesh that the space is defined on.
/// @param[in] elements Finite element for the space.
Copy link
Member

Choose a reason for hiding this comment

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

How do we know which element belongs to which cell type?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants