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
Triangulation::get_manifold(): assert that manifold has been attached #11566
Conversation
This is actually a pretty big breaking change. In particular, if someone is misusing manifold ids to stand in for some intermediate value, their code is now going to break. We might want to consider this for 10.0 (there really should be a manifold for each manifold id) but I'd be surprised if this passes the test suite. |
I agree that this is a change in behavior, but I also agree with @peterrum that this will usually point to a bug. The current behavior dates back to a time when we had geometry information only attached to boundaries, and used the We no longer have this kind of ambiguity, and I would support a change in behavior (even in 9.3) because I agree that the current behavior could be considered a bug. It's also easy to fix in backward compatible ways for everyone who now runs into the new assertion. Let's see what the test suite has to say about this: |
People abusing manifold ids may just explicitly attach a flat manifold, so it makes perfect sense for me to have this change. |
b534a6f
to
ff02be1
Compare
Quite many tests have failed. I went through all of them. Let me share some insight here what the reasons for the failing tests was:
Overall, I think the implicit assumption is really error prone: we had one instance at the workshop (when the |
I think this is the right approach.
That's a mistake, if the manifolds are not set.
Is there a reason not to have manifolds on the coarse mesh? I'd copy the manifolds over.
This should be fixed by creating a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with the comments by @luca-heltai and only have a couple additional comments.
@@ -10228,15 +10228,21 @@ Triangulation<dim, spacedim>::reset_manifold(const types::manifold_id m_number) | |||
AssertIndexRange(m_number, numbers::flat_manifold_id); | |||
|
|||
// delete the entry located at number. | |||
manifold.erase(m_number); | |||
manifold[m_number] = | |||
internal::TriangulationImplementation::get_default_flat_manifold<dim, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you document this change of behavior, and same for the reset_all_manifolds()
function below? I think it would be useful to state that the function doesn't actually remove the entry from the array, but just overwrite them with a flat manifold.
Of course, an even better solution would be to only allow this function to be called if no entity in the triangulation still uses this manifold id. I think that was the intent of the function: To un-register the manifold_id
.
@peterrum Ping? |
I'll try to work on this PR in the next week(s). |
c6ff523
to
6883644
Compare
Copying manifolds from one triangulation to another one is an ongoing issue. For example,
Done.
Done.
Let's postpone this to a follow-up PR. |
6883644
to
be2e9c4
Compare
Any opinions here: before or after the release? @bangerth @luca-heltai |
This has the potential to be quite disruptive. Let's do this right after the release. |
Well, we didn't do it right after the previous release. What to do? |
I think we are too far into the release cycle to make a large change like this one. Lets do it in the near future but not in time for 9.4. |
I also think we should postpone this to after the release. Let me adjust the milestone. |
be2e9c4
to
c78638a
Compare
I have updated the PR. We are still long before release so that we could attempt to merge this now. |
d472c4b
to
3abcdb8
Compare
Bummer, we missed our window. I've tagged it for the developer workshop. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am in favor of this change because the present situation is not good.
Let us get this breaking change in now so that we don't keep postponing it.
Can you rebase to see whether the failing test disappears if run again? |
3abcdb8
to
210b132
Compare
210b132
to
0f33c6e
Compare
Currently the function
Triangulation::get_manifold()
returns for a manifold id for which no manifold has been attached a flat manifold. In most cases this is not what you want is rather a sign of a mistake. Possible case: when you create a copy of a triangulation.This is an incompatible change but would simplify life (debugging!) of users much!