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
-
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.
-
Surround the calls of WrPartialMatrix (in FAST_Lin) with if statement if the matrices are not allocated
-
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.
Bug description
Setting
LinOutJac=TrueandLinOutMod=Truein 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 ) returnpresent in HydroDyn.Potential options
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 someif ( p%totalStates > 0 ) then .... This will require a reindentation of the code.Surround the calls of WrPartialMatrix (in FAST_Lin) with if statement if the matrices are not allocated
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.