Skip to content

HydroDyn does not allocate A, B, C matrices, leading to segfault in Jacobian linearization outputs #1046

Description

@ebranlard

Bug description
Setting LinOutJac=True and LinOutMod=True in the main fst file will result in a segfault because the A, B ,C matrices of hydrodyn are not allocated when the number of states are 0.
This issue comes from the statements if ( p%totalStates == 0 ) return present in HydroDyn.

Potential options

  1. Make sure the Jacobian functions of HydroDyn always allocate the A, B, C, D matrices. We can simply remove the "if" statements, or for some small performance gains, replace the if ( p%totalStates == 0 ) return , with some if ( p%totalStates > 0 ) then ... . This will require a reindentation of the code.

  2. Surround the calls of WrPartialMatrix (in FAST_Lin) with if statement if the matrices are not allocated

  3. Change WrPartialMatrix so that it supports unallocated matrices.

I'd vote for option 1 since I believe other modules like SubDyn always allocate the matrices even if they have a 0 dimension. Let me know your thoughts.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions