Use C++ to read VTK inflow in AWAE#3074
Merged
andrew-platt merged 13 commits intoOpenFAST:dev-tcfrom Nov 20, 2025
Merged
Conversation
…File and LowResWindFile
…ed on README instructions. Add fast_float.md to capture library source, version, and use case.
…handle whitespace
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a C++ function for reading VTK inflow files in the AWAE module to improve FAST.Farm performance. The key changes include adding the fast_float library for efficient floating-point parsing, implementing a KdTree data structure for spatial queries, and refactoring AWAE data structures to use more compact array representations.
- Adds C++ VTK reader using fast_float library for performance
- Implements KdTree for efficient nearest-neighbor searches
- Refactors AWAE grid data structures from individual X/Y/Z components to combined XYZ arrays
- Updates build system to compile C++ code and link new libraries
Reviewed Changes
Copilot reviewed 15 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| modules/nwtc-library/include/fast_float.h | Adds fast_float v8.1.0 header library for fast floating-point parsing |
| modules/nwtc-library/include/fast_float.md | Documentation for fast_float library usage and licensing |
| modules/nwtc-library/src/KdTree.f90 | New KdTree implementation for spatial searches |
| modules/nwtc-library/src/Registry_NWTC_Library*.txt | Registry definitions for KdTreeType |
| modules/nwtc-library/src/NWTC_Library_Types.f90 | Generated type definitions for KdTree |
| modules/awae/src/vtk.cpp | New C++ function for reading VTK inflow files |
| modules/awae/src/AWAE_Registry.txt | Refactored data structures to use XYZ arrays instead of separate components |
| modules/awae/CMakeLists.txt | Builds new C++ library and links it to awaelib |
| modules/nwtc-library/CMakeLists.txt | Adds KdTree source and include directory |
| modules/elastodyn/src/ElastoDyn.f90 | Updates SmllRotTrans calls to use keyword arguments |
| glue-codes/fast-farm/src/FAST_Farm_Subs.f90 | Updates to use refactored array structures |
| glue-codes/fast-farm/src/FAST_Farm_IO_Params.f90 | Refactors PointInAABB function signature |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
andrew-platt
approved these changes
Nov 20, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is ready to be merged after PR #3066.
Feature or improvement description
This PR adds a new function for reading the VTK based inflow used by the AWAE module. While benchmarking FAST.Farm, it was found that the program spent 60%-80% of it's time in reading these files and parsing the floating point grid data when used in a multi-threaded OpenMP context. Part of this was in waiting to get a lock to find a unique unit number via
GetNewUnitand a large part of it was in parsing the floating point values from strings into SiKi numbers.Using a C++ based function removes the need to get unique unit numbers and using the https://github.com/fastfloat/fast_float library to read the grid values significantly improved the parsing speed. This change can reduce the FAST.Farm run time up to 75% depending on the contents of the VTK files and grid sizes.
The
fast_floatlibrary is a single header file which has been added tomodules/nwtc-library/include/fast_float.h. An accompanyingfast_float.mdwas also added containing a brief description, version information, and use case. This library is licensed under APACHE 2.0 and MIT, both of which are listed within the header file itself.Impacted areas of the software
NWTC Library and AWAE