-
Notifications
You must be signed in to change notification settings - Fork 471
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
Fix of loading boundary elements of ParMesh from files #4128
Conversation
This PR is now under review (see the table in the PR description). To help with the review process, please do not force push to the branch. |
This is a good bug fix and resolves the issue in #4083. I would suggest also including the following change to
|
I am not sure about |
Because
So, I think in either of these cases adding the explicit |
To move things forward a little bit, @jandrej , @sohailreddy , what are your opinions on |
Yes, that is where we have started 😄 . I edited the header of #4240 to mention it avoids this as well 😉 . Please keep this PR minimal, so it can get finally merged. The overhead is only in the loader, so practically negligible, and it is not caused by this PR. |
Just need to reemphasize that my suggestion to remove the boundary element generation in the first part of this comment would be one way of remove that limitation and make the fixes in this PR even more minimal. I don't think there was clear consensus that this was a necessary feature to add though maybe I am missing something. Another option would be to use the approach suggested in this comment and avoid accessing |
This bugfix is not adding a feature, but recovers the intended behavior, which is consistent with the behavior of serial meshes. I believe majority is on the side of keeping things consistent, or at least for a bugfix. We may return to this discussion in another PR if you want to open it for this.
If we do not want to go beyond the bugfix and touch calls of |
OK, I've voiced my concerns but can only defer to editors/other reviewers at this point. |
@najlkin, I think the decision at the meeting was to NOT include the parallel boundary generation but just make the checks This way we postpone the controversial changes for further discussion but get the important bugfix in. |
@v-dobrev , I thought the decision was to split this PR, as I did, moving the potentially controversial change of the initialization of some structures to #4240 . The implementation of
Both are API changes and should be discussed in #4240 , but not here (!). Please someone just confirm this is working, so it can go to v4.7 asap 🙏 . |
I'll let @tzanio handle this -- he's the editor. |
As a compromise: is it just possible to just @sebastiangrimberg, @v-dobrev and @najlkin -- what do you think? |
I like this idea but am not sure you can do that in C++ if I understand correctly:
Leaving it defined as |
@sebastiangrimberg , it must be without |
Oh I see, but doesn't that mean you could get this behavior for a valid
|
I think that behavior is correct in the sense that when you explicitly use the local sub-mesh, you can do many harmful things to the distributed mesh for sure, but that is responsibility of the user and might be desired for some master hacker 🤓 |
I think it means that when |
OK, then I vote to implement it as |
Hmm, well, it is not critical, because that happens only when you do not have any boundary elements globally, which was not the case for the user and most other users. Anyway, I think a working implementation would be a better option, but to follow this compromise we may make |
...or abort, if |
Merged in |
This PR fixes the problem recognized in #4083 . When
ParMesh
is loaded from files/streams through its constructor orLoad()
method withrefine
orfix_orientation
parameters set true (as by default), boundary elements are generated for every boundary face including the shared ones if the local mesh does not have by chance at least one boundary element already loaded from the file, in which case the global boundary is preserved and no boundary elements are generated. This is a completely inconsistent behavior causing spurious appearance of internal boundaries depending on partitioning of theParMesh
.The problem is/was in method
Mesh::GenerateBoundaryElements()
, which does not check anyhow if the boundary is shared or not. Here, it is overridden inParMesh
and no boundary elements are generated on shared faces.PR Checklist
make style
.CHANGELOG
:CHANGELOG
to group with other related features?INSTALL
:make
orcmake
have a new target?.github
.appveyor.yml
.gitignore
:make distclean; git status
shows any files that were generated from the source by the project (not an IDE) but we don't want to track in the repository.examples/makefile
:SEQ_EXAMPLES
andPAR_EXAMPLES
variables.clean
target..gitignore
file.examples/CMakeLists.txt
:ALL_EXE_SRCS
variable.THIS_TEST_OPTIONS
is set correctly for the new example.doc/CodeDocumentation.dox
.examples/pumi
), list it indoc/CodeDocumentation.conf.in
src/examples.md
.src/examples.md
andsrc/img
.examples.md
, list the example under the appropriate categories, add new categories if necessary.features.md
.makefile
andmakefile
in corresponding miniapp directory..gitignore
file.CMakeLists.txt
file in theminiapps
directory, if the new miniapp is in a new directory.CMakeLists.txt
file in the new miniapp directory.doc/CodeDocumentation.dox
miniapps/nurbs
), add it toMINIAPP_SUBDIRS
in themakefile
.miniapps/nurbs
), list it indoc/CodeDocumentation.conf.in
src/meshing.md
andsrc/electromagnetics.md
files.src/examples.md
andsrc/img
.features.md
.mfem/web
repo.README
(rare).doc/CodeDocumentation.dox
(rare).make unittest
to make sure all unit tests pass.tests/scripts
.