Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vis: Fix bug with vtk writing of non-square wave surface #2338

Merged
merged 1 commit into from
Jul 19, 2024

Conversation

andrew-platt
Copy link
Collaborator

Feature or improvement description

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

Related issue, if one exists
This should be backported to 3.5.4

Impacted areas of the software
Visualization of rectangular wave surfaces only.

Additional supporting information
Thanks to @luwang00 for finding this.

Test results, if applicable
This is not part of the regression tests (we don't output vtk in regression tests due to data size).

@andrew-platt andrew-platt added the Module: SeaState SeaState module for wave data generation label Jul 19, 2024
@andrew-platt andrew-platt added this to the v4.0.0 milestone Jul 19, 2024
@andrew-platt andrew-platt self-assigned this Jul 19, 2024
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>
@luwang00
Copy link
Contributor

@andrew-platt, thanks for putting this PR together.

@andrew-platt
Copy link
Collaborator Author

andrew-platt commented Jul 19, 2024

Thinking about this a bit more, there is no reason to fix it in 3.5.4 as only square wave grids are used there (hard coded). So we won't backport this.

@andrew-platt andrew-platt merged commit 6b4a4aa into OpenFAST:dev Jul 19, 2024
21 checks passed
@andrew-platt andrew-platt deleted the b/WaveSurf_nonSquare branch July 19, 2024 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Module: SeaState SeaState module for wave data generation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants