Skip to content

Conversation

@andrew-platt
Copy link
Collaborator

@andrew-platt andrew-platt commented Sep 17, 2025

Ready to merge

Feature or improvement description
This PR modifies the SeaState c-bindings library interface with several improvements, updates the corresponding python library, and adds a test case.

C-bindings library interface changes include:

  • VTK outputs from the c-bindings library
  • splitting out a PreInit routine from Init - for setting environment variables
  • ClearMem routine
  • New public routines:
    • SeaSt_C_GetWaveFieldPointer
    • SeaSt_C_SetWaveFieldPointer
    • SeaSt_C_GetFluidVelAcc
    • SeaSt_C_GetSurfElev
    • SeaSt_C_GetSurfNorm
  • revised error handling (changed ErrStat_F to just ErrStat, and others - it was hard to read)
  • Add ShowPassedData routines for interface debugging
  • change what values are passed into Init (i.e. WrWvKinMod is set to 0 now)

Python interface changes:

  • changes to match new routines
  • reading of array of points from file
  • writing of output file

Regression test:

  • exercises the Python interface
  • uses set of points from file to get vel/acc/elev/norm values for at each timestep, and writes the results to a file. this file is used for comparison in the test.
  • retrieve and set pointer to the WaveField data. This verifies passing a pointer from Fortran to another language, then setting the pointer correctly in Fortran

HydroDyn and SeaState change:

  • changed WaveField_GetNodeWaveVel to include accelerations and renamed as WaveField_GetNodeWaveVelAcc (very similar to what is in dev-tc right now)

Additional things:

  • Minor fixes to the HydroDyn_C_binding.f90 file: notes and missing public declaration.

Related issue, if one exists
None

Impacted areas of the software
SeaState library interface, and matching test case

Additional supporting information
This is needed for some ongoing development work.

Test results, if applicable
A new test case py_seastate_1 exercises the library interface using the Python library.

- remove extra `IMPLICIT NONE` statements
- change name SeaSt_GetWaveFieldPointer_C to SeaSt_C_GetWaveFieldPointer (matches convention elsewehre)
- SeaSt_C_GetFluidVelAccDens
- SeaSt_C_GetSurfElev
…eVelAcc

- add acceleration output (similar to `dev-tc` usage)
- I don't see anything that directly uses this.
- SeaSt_C_GetWaveFieldPointer - convert to subroutine, add error handling, add DebugLevel
- SeaSt_C_SetWaveFieldPointer - new routine
- python lib: revisions to support above, and also to support a new regression test (in progress)
the flag for node in or out of water is sufficient.  The density is constant throughout the water column.
- removed outdated SeaState.py example since it is no longer compatible
- remove WrVTK_inDxy from the interface
- fix some broken error handling
- clears out memory that is allocated within the c-bindings library that the _End routine doesn't catch
@andrew-platt andrew-platt added this to the v4.2.0 milestone Sep 17, 2025
@andrew-platt andrew-platt self-assigned this Sep 17, 2025
@andrew-platt
Copy link
Collaborator Author

andrew-platt commented Sep 17, 2025

  • r-test merge required

@deslaughter
Copy link
Collaborator

The r-test merge required might be a good line item in the standard PR template. I know that I always forget to do that.

@andrew-platt andrew-platt merged commit ffe6283 into OpenFAST:dev Sep 17, 2025
23 of 24 checks passed
@andrew-platt andrew-platt deleted the f/c-bind_updates_SH branch September 17, 2025 23:36
@andrew-platt andrew-platt mentioned this pull request Jan 23, 2026
36 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants