You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
That might work. Looking at the allocation on line 2588, the allocation would be 0 by 1 -- we might need to double check that this works with the logic using the dXdu array in the glue code. Explicitly allocating it as 0 by 0 might be safer.
ebranlard
added a commit
to ebranlard/openfast
that referenced
this issue
Mar 15, 2022
Bug description
Setting
LinOutJac=True
andLinOutMod=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 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.
The text was updated successfully, but these errors were encountered: