mirror of
https://github.com/OPM/ResInsight.git
synced 2026-08-19 01:24:53 -05:00
computeFaultDistances faked a nearest-point query with cvf::BoundingBoxTree, which only supports box overlap: it grew a cell-sized box until it overlapped a fault face. For cells far from any fault this did many full tree traversals and then brute-forced the distance to a large, over-collected candidate set, and the answer was only approximate. This was slow on grids with ~10 million cells. The metric is the distance from each cell center to the nearest fault face center, which is exactly a nearest-point search. Replace the bounding-box tree and the grow-the-box loop with a nanoflann KD-tree built over the fault face centers and a single nearest-neighbor query per active cell. A zero-copy adaptor reads the existing std::vector<cvf::Vec3d> directly. The OpenMP loop is retained since nanoflann queries are read-only. The result is O(F log F) build plus O(N log F) queries, the full grid-node array copy is gone, and distances are now exact rather than approximate. Add nanoflann as a vcpkg dependency, wired in like Clipper2 as an imported target. Refs: https://github.com/OPM/ResInsight/issues/14128
26 lines
446 B
JSON
26 lines
446 B
JSON
{
|
|
"dependencies": [
|
|
"arrow",
|
|
"boost-filesystem",
|
|
"boost-spirit",
|
|
"boost-test",
|
|
"clipper2",
|
|
"eigen3",
|
|
{
|
|
"name": "grpc",
|
|
"platform": "!osx"
|
|
},
|
|
"type-lite",
|
|
"fast-float",
|
|
"spdlog",
|
|
"pugixml",
|
|
"nanoflann"
|
|
],
|
|
"overrides": [
|
|
{
|
|
"name": "fmt",
|
|
"version": "10.1.1"
|
|
}
|
|
]
|
|
}
|