Skip to content

Commit

Permalink
Vis: Fix bug with vtk writing of non-square wave surface
Browse files Browse the repository at this point in the history
When a rectangular SeaState grid was used, the connection list in the vtk file was incorrectly generated due to an indexing error.  The list would contain points beyond the total number of points in the point list.

For a 5x3 SeaState grid (Nx=3, Ny=2) there are a total of 15 points (0 to 14).
The connection list was being incorrectly generated as
```
        <DataArray type="Int32" Name="connectivity" format="ascii">
      0      1      3
      1      4      3
      1      2      4
      2      5      4
      5      6      8
      6      9      8
      6      7      9
      7     10      9
     10     11     13
     11     14     13
     11     12     14
     12     15     14
     15     16     18
     16     19     18
     16     17     19
     17     20     19
```

The connection list should be
```
        <DataArray type="Int32" Name="connectivity" format="ascii">
      0      1      3
      1      4      3
      1      2      4
      2      5      4
      3      4      6
      4      7      6
      4      5      7
      5      8      7
      6      7      9
      7     10      9
      7      8     10
      8     11     10
      9     10     12
     10     13     12
     10     11     13
     11     14     13
```

Co-authored-by: luwang00 <lu.wang@nrel.gov>
  • Loading branch information
andrew-platt and luwang00 committed Jul 19, 2024
1 parent 06240ba commit 8c56211
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion modules/openfast-library/src/FAST_Subs.f90
Original file line number Diff line number Diff line change
Expand Up @@ -8686,7 +8686,7 @@ SUBROUTINE WrVTK_WaveElevVisGrid(t_global, p_FAST, y_FAST, SeaSt)

do ix=1,p_FAST%VTK_surface%NWaveElevPts(1)-1
do iy=1,p_FAST%VTK_surface%NWaveElevPts(2)-1
n = p_FAST%VTK_surface%NWaveElevPts(1)*(ix-1)+iy - 1 ! points start at 0
n = p_FAST%VTK_surface%NWaveElevPts(2)*(ix-1)+iy - 1 ! points start at 0

WRITE(Un,'(3(i7))') n, n+1, n+p_FAST%VTK_surface%NWaveElevPts(2)
WRITE(Un,'(3(i7))') n+1, n+1+p_FAST%VTK_surface%NWaveElevPts(2), n+p_FAST%VTK_surface%NWaveElevPts(2)
Expand Down

0 comments on commit 8c56211

Please sign in to comment.