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
* Refactor: add MACOSX_BUNDLE option to qt_add_executable in multiple CMakeLists.txt files
* #14045 macOS: Guard std::stacktrace usage and skip ucontext on Apple platforms
* #14045 macOS: Guard std::ispanstream with std::istringstream fallback
* #14045 macOS: Add vcpkg overlay triplets for osx and exclude grpc on osx
* #14045 macOS: CMake macOS build support and openzgy OpenMP-disable patch
* #14045 CI: Add macOS build workflow
* #14045 macOS: Use feature-test macros to detect <stacktrace> and <spanstream>
* #14045 macOS: Make MAX_STIMPLAN_LAYERS constexpr to fix arm64 link error
* #14045 CI: Ship README-macOS.txt with artifact to document Gatekeeper workaround
* #14045 CI: Pin macOS runner to macos-14 and set deployment target to 14.0
* #14045 CI: Move macOS runner to macos-15 and fix README step on configure failure
Replaces the deprecated Clipper library with the actively maintained Clipper2 library.
Removes the local copy of the Clipper library and uses vcpkg to manage the dependency.
Fixes#11807
Co-authored-by: Magne Sjaastad <magne.sjaastad@ceetronsolutions.com>
* Update opm-common submodule and use branch development https://github.com/CeetronSolutions/opm-common/tree/development
* Add cmake-format of ThirdParty/custom-opm-common/CMakeLists.txt
* Add boost-test
* Update generated files and simplify CMake configuration
Add -D_USE_MATH_DEFINES to CMake to avoid multiple local defines
Introduce flag CREATE_OPM_COMMON_KEYWORDS used to generate C++ files JSON files. This enables use also in MSVC. Remove obsolete direct include of source files.
* Update generated ESMRY test file
There was a invalid extra : postfix for some keywords like NEWTON and other N* keywords. When creating ESRMY using updated opm-common fix this issue.
* Update URL for custom-opm-common
* Update vcpkg to 2024.02.14 Release
A blank install of vcpkg did not work anymore due to changes in upstream repos. Had to update vcpkg.exe to latest to ensure download of libraries works as expected.
Had to update baseline to 2024.02.14 to be able to compile on VS 17.12. A bug related to naming of boost was fixed in boost 1.84
https://github.com/microsoft/vcpkg/issues/38980
* Bump to a more recent vcpkg due to a build error in arrow
https://github.com/apache/arrow/issues/42027
* Avoid fmt 11 due to a bug for MSVC
https://github.com/gabime/spdlog/issues/3251#issue-2648376977
* Remove obsolete GRPC config in top-level CMake
* Avoid pinning of Protobuf