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

Allow sparsity pattern to be built from integration entities #2244

Merged
merged 11 commits into from
Jun 25, 2022

Conversation

jpdean
Copy link
Member

@jpdean jpdean commented Jun 16, 2022

This PR makes it possible to build a sparsity pattern from a list of integration entities i.e. cell indices for cell integrals, (cell, local_facet) pairs for exterior facet integrals etc. It also modifies create_sparsity_pattern so that it only adds entries for entities in the form's integration domains, rather than for all entities of a particular integration type.

This PR is a step towards allowing the user to specify integration domains by passing a list of integration entities to Form, which would allow, for example, one-sided integrals on the interior facets of the mesh. I plan to put in another PR soon to add this functionality.

Comment on lines +38 to +42
for (std::int32_t c : cells)
{
pattern.insert(dofmaps[0].get().cell_dofs(c),
dofmaps[1].get().cell_dofs(c));
}
Copy link
Sponsor Member

@jorgensd jorgensd Jun 16, 2022

Choose a reason for hiding this comment

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

Is it better with

  std::for_each(cells.cbegin(), cells.cend(),  auto [&dofmaps](auto c){
                       pattern.insert(dofmaps[0].get().cell_dofs(c), dofmaps[1].get().cell_dofs(c));
                       );

? (Prone to github typing errors)

@garth-wells garth-wells added the enhancement New feature or request label Jun 18, 2022
@garth-wells garth-wells merged commit 3d72026 into main Jun 25, 2022
@garth-wells garth-wells deleted the jpdean/sparsity_pattern branch June 25, 2022 05:01
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.

None yet

3 participants