Inconsistent and unintended behavior of different ordering tags
After creating a grid function space, I usually print out the number of degrees of freedom associated with the space. If the space is a non-leaf space, e.g. a composite grid function space, I also print out the number of degrees of freedom of its children since I consider this an interesting information; in particular for multi domain simulations.
While adapting my code to PDELab 2.0 and its new ordering mechanism, I stumbled upon two problems:
- The size of child spaces does not seem to be available when using a composite grid
function space together with the
EntityBlockedOrderingTag
(callingchild_gfs.size()
results in a GridFunctionSpaceHierarchyError: "Size cannot be calculated at this point in the GFS tree), while it is available for theLexicographicOrderingTag
. - When using a composite grid function space together with the
EntityBlockedOrderingTag
,composite_gfs.ordering()
yields an instance ofGridViewOrdering
which inherits from OrderingBase. Since OrderingBase provides methods liketypename Traits::SizeType size(const typename Traits::SizeType child_index) const
GridViewOrdering
provides those methods as well. ButOrderingBase
implements its ownupdate()
method which overrides the update method fromOrderingBase
. Some inherited class members which are required by inherited methods (like the size method mentioned above) are thus left in an uninitialized state, yielding undefined behavior. For example, callingcomposite_gfs.ordering().size(child_index)
OrderingBase::_child_size_offsets
which is an emptystd::vector
.
I would try to deal with the issue myself, but I would have to understand the code of the new ordering mechanism first. Trying to do so unfortunately turned out to be a little hard without having a reasonably detailed description of the mechanism and the ideas of its implementation at hand.