optimad / bitpit

Open source library for scientific HPC
http://optimad.github.io/bitpit/
GNU Lesser General Public License v3.0
116 stars 34 forks source link

levelset: rework overall design #422

Closed andrea-iob closed 5 months ago

andrea-iob commented 9 months ago

The main purpose of the rework is to reduce the memory footprint of the levelset. To achieve this goal, the values computed by the levelset are stored in separate caches. Each cache can be enabled separately form the other and can operate in one of the following modes:

When no caches are enabled, the only memory used by the levelset is the memory that each object uses to store its own information (for example the object that evaluates the levelset of a segmentation stored information about the normals of the segmentation).

When no cached are enabled, the evaluation of the levelset is thread safe and this allows to use the levelset object inside parallel OpenMP regions.

This new levelset aims to be 100% compatible with the existing levelset. Some functions are now deprecated, but thay should still work as before.

The pull request is a draft, because more tests should be performed.

andrea-iob commented 8 months ago

The final implementation is not 100% compatible with the current version. The names of a couple of classes have changed, but, overall, I think that adapting an existing code to the new implementation should be easy.

andrea-iob commented 5 months ago

I fixed a problem with the update of empty objects. Hopefully, this should address the last problems we had with this branch.