cmlibs / zinc

Source code repository for OpenCMISS-Zinc
Mozilla Public License 2.0
15 stars 18 forks source link

Improve find mesh location performance #234

Closed rchristie closed 2 years ago

rchristie commented 2 years ago

The find mesh location algorithm becomes very slow when meshes are large, particularly for points outside elements with find nearest, since all elements in the mesh must be searched.

Need to implement spatial sorting to be able to search through a smaller selection of elements, e.g. dividing space into an octree representation which lists all the elements which may be in each cell. As a nearest distance is found, can reduce the range of cells searched accordingly.

Requires getting accurate ranges of fields in elements, which will assist in more rapidly eliminating elements as candidates. This has other uses including visualising maximum/minimum field value point which can be added as a new element point sampling mode.

Due to the cost of creating them, find mesh location caches (ranges and octree) need to be maintained centrally to support efficient incremental graphics generation. The design must anticipate future multi-threading.

At same time should also address #130.