Skip to content

Construction of CoordFunction in Backup-Restore for GeometryGrid

Summary

This MR extends the interface of BackupRestoreFacilities for GeometryGrid to allow the construction of the CoordinateFunction.

Details

Not all CoordinateFunctions passed to a GeometryGrid are detault-constructible. This complicates the implementation of backup-restore facilities, since one has to pass the CoordinateFunction in the constructor of GeometryGrid. This MR extends the interface of the restore() method in BackupRestoreFacilities to pass a second parameter, a functor that accepts a grid reference and returns an object of CoordinateFunction that can be passed to the constructor of GeometryGrid. With this creator the CoordinateFunction can then be constructed.

Discussion

In the comments of BackupRestoreFacilities<GeometryGrid> it is noted that one should backup (and restore) the coordinate function as well. This is not implemented and might need a generalization of the BackupRestore class to be specialized also for non-grid types. Then, the user has to provide a specialization for the CoordinateFunction in order to backup and restore it from file or stream. But, often the CoordinateFunction depends on the restored grid or its gridView (see also the examples in GeometryGrid) and thus restoring it from file alone could be complicated. The creator approach is one way to solve this problem, but there might be others.

Merge request reports