Implement the subIndex method for entities of all dimensions
Previously, it was available only for elements.
The following question appears: what does the codim-parameter in
template unsigned int subIndex (const Codim::Entity& e, int i, unsigned int codim) const
mean? Is it the codimension wrt to the grid, or wrt to the entity e? I did not find this documented anywhere, and therefore made my own choice. The 'codim' in this patch is the codimension with respect to the grid.
Merge request reports
Activity
Mentioned in merge request !93 (closed)
@carsten.graeser observe that I gave up on returning values from within a Hybrid::ifElse. I stepped into too many pitfalls... maybe we want to prohibit that altogether?
@oliver.sander: I don't understand why you use
Hybrid::ifElse
at all. It seems that you can use a classicif
as well here. Notice that, as long as you don't pipe objects through theid
function, the respective templates will be instanciated.I'd also like to mention that this MR does not do what it announces. For non-element enties it just throws an exception (despite for edges in 3d because there's a type in the check).
There may be shorter ways of writing this, but since there is a multitude of different cases I liked this wordy approach better. You need static ifs because some methods (in particular the sideVector stuff) only exist in 3d grids.
I'd also like to mention that this MR does not do what it announces.
Well, it implements the methods in a weak sense. The new test in !96 (merged) tests whether the new methods exist, but it deliberately allows NotImplemented. Without this merge request, test-ug together with !96 (merged) will not even build.
Edited by Oliver SanderSince we decided that any grid must implement the feature, the test should also check this and UG should in principle implement this to be conforming. If this cannot be implemented in UG we maybe have to revert our decision, reopen flyspray/FS#818 (closed), and find another solution for this.
There is no problem implementing this in UG, I just didn't find the time to do it yet.
Plus, my current main motivation is to get the strengthened test from !96 (merged) into master. The patch to UGGrid contains the minimum amount of work needed to pass the new test.
As a matter of fact, I will merge this and !96 (merged) now. This does not mean that I think they are perfect. But they are both steps in the right direction.
Mentioned in commit c3b6aed2
There is an obvious choice: It is the codimension with respect to the grid (as you guessed). This is what you get from
ReferenceElement::subEntity(i,c,ii,cc)
Please refer to the original implementor is this method for semantics.
I will update the documentation of index set and id set accordingly.
Edited by Martin NolteI updated the documentation for IndexSet in !97 (merged). For IdSets, the corresponding method seems to be missing, see #29.
Mentioned in issue #30 (closed)
Mentioned in merge request !101 (merged)
Mentioned in merge request !136 (merged)