Skip to content

Clearer warning that BlockForest::addBlockData(boost::function, ...) cannot be used with refinement

Michael Kuron requested to merge addBlockData-refinement into master

Previously, this only gave a generic error message like the one below, forced me to wade through BlockForest for several hours to find the cause. In the end, it boiled down to whether the boundary handling was a shared_ptr<BoundaryHandling_T>, which works with refinement, or a boost::function<BoundaryHandling_T(IBlock *)>, which does not. Both variants are used throughout the tutorials, tests and sample apps, so when one pieces together an application from multiple places, one can end up trying to use the functor-style one with dynamic refinement.

[0][ERROR   ]------(1.373 sec)[   0] Dynamic data structure refresh failed!
[0]                                  For the dynamic refresh to work, all registered block data items must implement the blockforest::BlockDataHandling interface
[0]                                  _AND_ this block data handling object must be registered at an instance of class BlockForest or StructuredBlockForest!
[0]                                  Registering the block data handling object through a base class [BlockStorage/StructuredBlockStorage] (shared) pointer will not work!
[0]                                  For block data item 'boundary handling' a fitting block data handling object is missing or was registered
[0]                                  through a base class pointer and not directly at an instance of class BlockForest or StructuredBlockForest.

@schornbaum, would it be possible through changes to BlockForest to make the functor-style work with dynamic refinement too?

Edited by Michael Kuron

Merge request reports