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

dolfinx.fem.assemble_scalar is not parallel safe #896

Open
RemDelaporteMathurin opened this issue Oct 24, 2024 · 1 comment
Open

dolfinx.fem.assemble_scalar is not parallel safe #896

RemDelaporteMathurin opened this issue Oct 24, 2024 · 1 comment
Labels
bug Something isn't working fenicsx Issue that is related to the fenicsx support good first issue Good for newcomers

Comments

@RemDelaporteMathurin
Copy link
Collaborator

RemDelaporteMathurin commented Oct 24, 2024

@jorgensd realised that this is not parallel safe and would return the wrong result in parallel.

self.value = fem.assemble_scalar(
fem.form(self.field.solution * ds(self.surface.id))
) / fem.assemble_scalar(fem.form(1 * ds(self.surface.id)))
self.data.append(self.value)

Would be nice to have a demonstration of this.

Instead we should have something like this:

https://github.com/scientificcomputing/scifem/blob/02f1d9b6ae0b3c394667524e65571729260e9859/src/scifem/assembly.py#L9-L22

@RemDelaporteMathurin RemDelaporteMathurin added bug Something isn't working fenicsx Issue that is related to the fenicsx support good first issue Good for newcomers labels Oct 24, 2024
@RemDelaporteMathurin
Copy link
Collaborator Author

We should just use scifem.assemble_scalar instead of fem.assemble_scalar

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fenicsx Issue that is related to the fenicsx support good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant