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
Can one keep manifolds when merging triangulations? #8914
Comments
That's not quite true. The documentation also says
The manifolds assigned to objects stay the same if the position in space is altered. |
As long as the |
The history for this is as follows: |
Same issue as #8920. What if we replace the manifolds in the triangulation with ones where we "wrap" the original manifold with one level of transformation, using the same transformation as use in |
I like that idea. @bangerth What do you mean with "one level of transformation"? It should also work when applying an arbitrary sequence of shift/rotate operations. For a general Nevertheless, I could make sense to now explicitly deactivate manifolds when applying grid manipulations and adapt the documentation in a first step (to have a basis where the code is stable and the documentation clear regarding the limitations), and to extend/improve functionality in a second step? |
@masterleinad Regarding the original question related to I think I did not completely get your point. What are the current capabilities and limitations of |
Ah, I see, I misread your question. Manifolds are indeed not copied since it was not obvious what to do if multiple triangulations to be merged use the same manifold id, but have different |
If I understand you correctly it would be possible and it is a question of how to update the data structures. For example, can one increment the manifold_ids of one triangulation by the maximum manifold_id of the other one, and then merge the two triangulations? |
From a user perspective, you can just loop over the manifold indicators of the input triangulations, obtain the correct object via For me, it would be confusing if |
The concerns that I have regarding the user perspective or the documentation is that some GridGenerator functions implicitly attach manifolds, so the user does not get into contact with the manifolds, i.e., we consider manifolds as part of a triangulation. This is why I would vote for a solution where |
Changing the manifold ids (in case they should be copied from the input triangulations) would not be backwards-compatible. Furthermore, the manifold ids would then depend on the order in which triangulations are merged. This makes it also pretty hard to argue about the manifold ids and which manifold object should be attached to which id afterwards. In any way, I am happy to change the function signature (to allow copying manifolds) in a way that preserves the current function's behavior by default. For the other reasons above, I still like preserving the manifold ids better than incrementing, though. Let's see what other people think. |
I like the idea of re-attaching manifolds (by default, or by option). We've made an effort to move attaching the correct manifold to triangulations from user space into the library, and it's a bit of a shame that we don't do it here. It might be nice if we could do it here as well. That's particularly true because the function internally knows the mapping from old to new cells and can set manifold ids without too much trouble -- that's more complicated in user space. As for shifting IDs: How about the function getting a |
I am against changing default behavior when we can't deprecate. Hence, we likely need two additional parameters with your suggestion and the number of options seems to be getting a little bit out of hand. If you really want this functionality, I would rather propose to have a separate function that always shifts manifold ids and always re-attaches manifolds. |
From my perspective, the current implementation is a bug somehow (since properties that belong to the triangulation get lost), or at least an inconsistent behavior. In this sense, I think one can accept that the default behavior changes. I would be more happy with the additional parameter variant (with a default value to not change the interface), since a new function @kronbichler Didn't we have changes in the past from surface manifolds to volume manifolds in order to obtain truly high-order geometry representations? In these cases the default behavior also changed? |
I tend to agree with @nfehn here. @dealii/dealii -- anyone else want to join in? |
I agree with @nfehn. I think we should change the default behavior. |
I think @nfehn has a point. The current implementation is not functional, and it is confusing to users = it is a bug. We should fix bugs, not maintain backward compatibility with them. I would be in favor of simply documenting what the behavior is, and fixing it according to what we expect it to do. Merge triangulation should shift the manifold ids of the second triangulation by the maximum id of the first triangulation, just as it does with cell ids, and attach the manifolds accordingly. Any other behavior is in my opinion user dependent, and should be left to users. As far as transformations are concerned, I'd be in favor of removing manifolds before any transformation. In a subsequent PR we could make sure that we can actually attach a transformation to a manifold, and manipulate it afterwards, but this is going to be very expensive, and case dependent, so I'm not sure we'll be able to it effectively (i.e.: transfinite manifold needs not be transformed: only the boundaries of the manifolds need to be transformed. How would we make this work?). |
This is more-or-less (the discussion is different but the problem is the same) the same issue as that in #7052. I'll take a stab at finishing this for the release. |
I haven't had time to work on this and its not critical so lets move this off 9.2. |
Anything new here? |
It seems you have this higher on the priority list than most other developers, so I would invite you to start looking into it. I would be more than happy to assist on the way, but I do not have the resources to do it alone. Thus, we need to work towards this goal as a community. Keep in mind that deal.II is a voluntary project with no developer getting paid for these tasks (at least not more than you or me). |
I don't understand why I get so many accusations when asking after approximately one year? I just wanted to know whether there are already plans, or if someone else already did something in this direction or that this issue is just left for some reasons (because I do not follow everything in deal.II), etc., ... |
I plan on getting this done in time for 9.3: I tagged myself and added it to the milestone for this reason. If you need it as soon as possible I can help you implement it! |
@drwells Thanks for offering your help here. However, I think any changes made in the context of this issue made in the next days will be too close to the release. I am adjusting the milestone. |
GridGenerator::merge_triangulations()
forgets about the manifolds, seehttps://www.dealii.org/current/doxygen/deal.II/namespaceGridGenerator.html#a7cd88e7eacd46697dee80ad2b8438d54
Is there a way to keep manifolds or simplify usability as it can become very complicated to reset manifolds after
merge_triangulation()
?What happens with manifolds when applying functions like
GridTools::shift()
,GridTools::rotate()
?The text was updated successfully, but these errors were encountered: