###################################################################################################################################
# Registry for WAMIT in the FAST Modularization Framework
# This Registry file is used to create MODULE WAMIT  which contains all of the user-defined types needed in WAMIT.
# It also contains copy, destroy, pack,  and unpack routines associated with each defined data types.
# See NWTC Programmer's Handbook for further information on the format/contents of this file.
#
# Entries are of the form
# <keyword>         <ModuleName/ModName>          <TypeName>          <FieldType>         <FieldName>         <Dims>    <IO>      <DNAME>   <DESCRIP> <UNITS>
#
# Use ^ as a shortcut for the value in the same column from the previous line.
###################################################################################################################################

# ...... Include files (definitions from NWTC Library) ............................................................................
# make sure that the file name does not have any trailing white spaces!
include   Registry_NWTC_Library.txt
usefrom   Conv_Radiation.txt
usefrom   SS_Radiation.txt
usefrom   SS_Excitation.txt
usefrom   SeaSt_WaveField.txt

typedef   WAMIT/WAMIT                  InitInputType                 INTEGER                  NBody                           -          -        -         "[>=1; only used when PotMod=1. If NBodyMod=1, the WAMIT data contains a vector of size 6*NBody x 1 and matrices of size 6*NBody x 6*NBody; if NBodyMod>1, there are NBody sets of WAMIT data each with a vector of size 6 x 1 and matrices of size 6 x 6]" -
typedef   ^                            ^                             INTEGER                  NBodyMod                        -          -        -         "Body coupling model {1: include coupling terms between each body and NBody in HydroDyn equals NBODY in WAMIT, 2: neglect coupling terms between each body and NBODY=1 with XBODY=0 in WAMIT, 3: Neglect coupling terms between each body and NBODY=1 with XBODY=/0 in WAMIT} (switch) [only used when PotMod=1]" -
typedef   ^                            ^                             ReKi                     Gravity                         -          -        -         "Supplied by Driver:  Gravitational acceleration"  "(m/s^2)"
typedef   ^                            ^                             ReKi                     PtfmVol0                        {:}        -        -         ""    -
typedef   ^                            ^                             LOGICAL                  HasWAMIT                        -          -        -         ".TRUE. if using WAMIT model, .FALSE. otherwise"    -
typedef   ^                            ^                             ReKi                     WAMITULEN                       -          -        -         ""    -
typedef   ^                            ^                             ReKi                     PtfmRefxt                       {:}        -        -         "The xt offset of the body reference point(s) from (0,0,0)  [1 to NBody; only used when PotMod=1 ]"  (m)
typedef   ^                            ^                             ReKi                     PtfmRefyt                       {:}        -        -         "The yt offset of the body reference point(s) from (0,0,0)  [1 to NBody; only used when PotMod=1 ]"  (m)
typedef   ^                            ^                             ReKi                     PtfmRefzt                       {:}        -        -         "The zt offset of the body reference point(s) from (0,0,0)  [1 to NBody; only used when PotMod=1; must be 0.0 if NBodyMod=2 ]"  (m)
typedef   ^                            ^                             R8Ki                     PtfmRefztRot                    {:}        -        -         "The rotation about zt of the body reference frame(s) from xt/yt" radians 
typedef   ^                            ^                             ReKi                     PtfmCOBxt                       {:}        -        -         ""    -
typedef   ^                            ^                             ReKi                     PtfmCOByt                       {:}        -        -         ""    -
typedef   ^                            ^                             INTEGER                  RdtnMod                         -          -        -         ""    -
typedef   ^                            ^                             INTEGER                  ExctnMod                        -          -        -         ""    -
typedef   ^                            ^                             INTEGER                  ExctnDisp                       -          -        -          "0: use undisplaced position, 1: use displaced position, 2: use low-pass filtered displaced position) [only used when PotMod=1 and ExctnMod>0]" -
typedef   ^                            ^                             ReKi                     ExctnCutOff                     -          -        -          "Cutoff (corner) frequency of the low-pass time-filtered displaced position (Hz) [>0.0] " Hz
typedef   ^                            ^                             IntKi                    NExctnHdg                       -          -        -         "Number of PRP headings/yaw offset evenly distributed over the region [-180, 180) deg to be used when precomputing the wave excitation [only used when PtfmYMod=1]"
typedef   ^                            ^                             DbKi                     RdtnTMax                        -          -        -         ""    -
typedef   ^                            ^                             CHARACTER(1024)          WAMITFile                       -          -        -         ""    -
typedef   ^                            ^                             Conv_Rdtn_InitInputType  Conv_Rdtn                       -          -        -         ""    -
typedef   ^                            ^                             SeaSt_WaveFieldType     *WaveField                       -          -        -         "Pointer to wave field"
typedef   ^                            ^                             INTEGER                  PtfmYMod                        -          -        -         "Large yaw model" -
typedef   ^                            ^                             ReKi                     PtfmRefY                        -          -        -         "Initial reference yaw offset" (rad)
typedef   ^                            ^                             ReKi                     PlatformPos                     {6}        -        -         "Initial platform position (6 DOFs)"
#
#
# Define outputs from the initialization routine here:
#typedef   ^                            InitOutputType                IntKi                      NULLVAL                        -          -        -         ""  -
#
#
# ..... States ....................................................................................................................
# Define continuous (differentiable) states here:
#
typedef   ^                            ContinuousStateType           SS_Rad_ContinuousStateType            SS_Rdtn           -          -        -        "continuous states from the State Space radiation module"        -
typedef   ^                            ContinuousStateType           SS_Exc_ContinuousStateType            SS_Exctn           -          -        -        "continuous states from the State Space radiation module"        -
typedef   ^                            ^                             Conv_Rdtn_ContinuousStateType         Conv_Rdtn         -          -        -        "placeholder"   -
#
#
# Define discrete (nondifferentiable) states here:
#
typedef   ^                            DiscreteStateType             Conv_Rdtn_DiscreteStateType           Conv_Rdtn         -          -         -       "discrete states from the convolution radiation module"        -
typedef   ^                            DiscreteStateType             SS_Rad_DiscreteStateType              SS_Rdtn           -          -         -       "placeholder"        -
typedef   ^                            DiscreteStateType             SS_Exc_DiscreteStateType              SS_Exctn          -          -         -       "placeholder"        -
typedef   ^                            DiscreteStateType             ReKi                                  BdyPosFilt        {:}{:}{:}  -         -       "Low-pass filtered WAMIT body position at the current and previous steps used when ExctnDisp=2"
#
#
# Define constraint states here:
#
typedef   ^                            ConstraintStateType           Conv_Rdtn_ConstraintStateType           Conv_Rdtn       -         -         -         "placeholder"        -
typedef   ^                            ConstraintStateType           SS_Rad_ConstraintStateType              SS_Rdtn         -         -         -         "placeholder"        -
typedef   ^                            ConstraintStateType           SS_Exc_ConstraintStateType              SS_Exctn         -         -         -         "placeholder"        -
#
#

# Define any data that are integer or logical states here:
typedef   ^                            OtherStateType                SS_Rad_OtherStateType    SS_Rdtn                         -              -         -         ""   -
typedef   ^                            OtherStateType                SS_Exc_OtherStateType    SS_Exctn                        -              -         -         ""   -
typedef   ^                            ^                             Conv_Rdtn_OtherStateType Conv_Rdtn                       -              -         -         ""   -


# ..... Misc/Optimization variables.................................................................................................
# Define any data that are used only for efficiency purposes (these variables are not associated with time):
#   e.g. indices for searching in an array, large arrays that are local variables in any routine called multiple times, etc.
typedef   ^                            MiscVarType                   INTEGER                  LastIndWave                     -              -         -         ""   -
typedef   ^                            ^                             ReKi                     F_HS                            {:}            -         -         "local variable in CalcOutput:Total load contribution from hydrostatics, including the effects of waterplane area and the center of buoyancy"   "(N, N-m)"
typedef   ^                            ^                             ReKi                     F_Waves1                        {:}            -         -         "local variable in CalcOutput:Total load contribution from incident waves (i.e., the diffraction problem)"   "(N, N-m)"
typedef   ^                            ^                             ReKi                     F_Rdtn                          {:}            -         -         "local variable in CalcOutput:Total load contribution from wave radiation damping (i.e., the diffraction problem)"   "(N, N-m)"
typedef   ^                            ^                             ReKi                     F_PtfmAM                        {:}            -         -         "local variable in CalcOutput:"   -
typedef   ^                            ^                             SS_Rad_MiscVarType       SS_Rdtn                         -              -         -         ""   -
typedef   ^                            ^                             SS_Rad_InputType         SS_Rdtn_u                       -              -         -         ""   -
typedef   ^                            ^                             SS_Rad_OutputType        SS_Rdtn_y                       -              -         -         ""   -
typedef   ^                            ^                             SS_Exc_MiscVarType       SS_Exctn                        -              -         -         ""   -
typedef   ^                            ^                             SS_Exc_InputType         SS_Exctn_u                      -              -         -         ""   -
typedef   ^                            ^                             SS_Exc_OutputType        SS_Exctn_y                      -              -         -         ""   -
typedef   ^                            ^                             Conv_Rdtn_MiscVarType    Conv_Rdtn                       -              -         -         ""   -
typedef   ^                            ^                             Conv_Rdtn_InputType      Conv_Rdtn_u                     -              -         -         ""   -
typedef   ^                            ^                             Conv_Rdtn_OutputType     Conv_Rdtn_y                     -              -         -         ""   -
typedef   ^                            ^                          SeaSt_WaveField_MiscVarType WaveField_m                     -              -         -         "misc var information from the SeaState Interpolation module"   -

# ..... Parameters ................................................................................................................
# Define parameters here:
# Time step for integration of continuous states (if a fixed-step integrator is used) and update of discrete states:
#
typedef   ^                            ParameterType                 INTEGER                  NBody                    -          -         -         "[>=1; only used when PotMod=1. If NBodyMod=1, the WAMIT data contains a vector of size 6*NBody x 1 and matrices of size 6*NBody x 6*NBody; if NBodyMod>1, there are NBody sets of WAMIT data each with a vector of size 6 x 1 and matrices of size 6 x 6]" -
typedef   ^                            ^                             INTEGER                  NBodyMod                 -          -         -         "Body coupling model {1: include coupling terms between each body and NBody in HydroDyn equals NBODY in WAMIT, 2: neglect coupling terms between each body and NBODY=1 with XBODY=0 in WAMIT, 3: Neglect coupling terms between each body and NBODY=1 with XBODY=/0 in WAMIT} (switch) [only used when PotMod=1]" -
typedef   ^                            ^                             ReKi                     F_HS_Moment_Offset       {:}{:}     -         -         "The offset moment due to the COB being offset from the WAMIT body's local location {matrix 3xNBody}" N-m
typedef   ^                            ^                             SiKi                     HdroAdMsI                {:}{:}     -         -         ""  (sec)
typedef   ^                            ^                             SiKi                     HdroSttc                 {:}{:}     -         -         ""        -
typedef   ^                            ^                             INTEGER                  RdtnMod                  -          -         -         ""        -
typedef   ^                            ^                             INTEGER                  ExctnMod                 -          -         -         ""        -
typedef   ^                            ^                             INTEGER                  ExctnDisp                -          -         -         "0: use undisplaced position, 1: use displaced position, 2: use low-pass filtered displaced position) [only used when PotMod=1 and ExctnMod>0]" -
typedef   ^                            ^                             ReKi                     ExctnCutOff              -          -         -         "Cutoff (corner) frequency of the low-pass time-filtered displaced position (Hz) [>0.0] " Hz
typedef   ^                            ^                             IntKi                    NExctnHdg                -          -         -         "Number of PRP headings/yaw offset evenly distributed over the region [-180, 180) deg to be used when precomputing the wave excitation [only used when PtfmYMod=1]"
typedef   ^                            ^                             ReKi                     ExctnFiltConst           -          -         -         "Low-pass time filter constant computed from ExctnCutOff"
typedef   ^                            ^                             SiKi                     WaveExctn                {:}{:}{:}  -         -         ""        -
typedef   ^                            ^                             SiKi                     WaveExctnGrid      {:}{:}{:}{:}{:}  -         -         "WaveExctnGrid dimensions are: 1st: wavetime, 2nd: X, 3rd: Y, 4th: PRP Yaw, 5th: Force component for eac WAMIT Body"        -
typedef   ^                            ^                             Conv_Rdtn_ParameterType  Conv_Rdtn                -          -         -         ""        -
typedef   ^                            ^                             SS_Rad_ParameterType     SS_Rdtn                  -          -         -         ""        -
typedef   ^                            ^                             SS_Exc_ParameterType     SS_Exctn                 -          -         -         ""        -
typedef   ^                            ^                             DbKi                     DT                       -          -         -         ""        -
typedef   ^                            ^                             SeaSt_WaveFieldType     *WaveField                -          -         -         "Pointer to wave field"
typedef   ^                            ^                             INTEGER                  PtfmYMod                 -          -         -         "Large yaw model" -
typedef   ^                            ^                       SeaSt_WaveField_ParameterType  ExctnGridParams          -          -         -         "Parameters of WaveExctnGrid" -
#
#
# ..... Inputs ....................................................................................................................
# Define inputs that are contained on the mesh here:
#
typedef   ^                            InputType                     MeshType                 Mesh                    -          -         -         "Displacements at the WAMIT reference point in the inertial frame" -
typedef   ^                            ^                             ReKi                     PtfmRefY                -          -         -         "Reference yaw offset" (rad)
#
#
# ..... Outputs ...................................................................................................................
# Define outputs that are contained on the mesh here:
typedef   ^                            OutputType                   MeshType                 Mesh                     -           -         -         "Loads at the WAMIT reference point in the inertial frame" -
