|
MoorDyn
|
Typedefs | |
| typedef struct __MoorDynBody * | MoorDynBody |
| A mooring line instance. | |
| typedef struct __MoorDynLine * | MoorDynLine |
| A mooring line instance. | |
| typedef struct __MoorDyn * | MoorDyn |
| A mooring system instance. | |
| typedef struct __MoorDynPoint * | MoorDynPoint |
| A mooring point instance. | |
| typedef struct __MoorDynRod * | MoorDynRod |
| A mooring line instance. | |
| typedef struct __MoorDynSeafloor * | MoorDynSeafloor |
| A seafloor descriptor. | |
| typedef struct __MoorDynWaves * | MoorDynWaves |
| A mooring point instance. | |
Functions | |
| int DECLDIR | MoorDyn_GetBodyID (MoorDynBody b, int *id) |
| Get the body identifier. More... | |
| int DECLDIR | MoorDyn_GetBodyType (MoorDynBody b, int *t) |
| Get the point type. More... | |
| int DECLDIR | MoorDyn_GetBodyState (MoorDynBody b, double r[6], double rd[6]) |
| Get the body state. More... | |
| int DECLDIR | MoorDyn_GetBodyPos (MoorDynBody b, double r[3]) |
| Get the body position. More... | |
| int DECLDIR | MoorDyn_GetBodyAngle (MoorDynBody b, double r[3]) |
| Get the body angle. More... | |
| int DECLDIR | MoorDyn_GetBodyVel (MoorDynBody b, double rd[3]) |
| Get the body velocity. More... | |
| int DECLDIR | MoorDyn_GetBodyAngVel (MoorDynBody b, double rd[3]) |
| Get the body angular velocity. More... | |
| int DECLDIR | MoorDyn_GetBodyForce (MoorDynBody b, double f[6]) |
| Get the body angular velocity. More... | |
| int DECLDIR | MoorDyn_GetBodyM (MoorDynBody b, double m[6][6]) |
| Get the body mass and intertia matrix. More... | |
| int DECLDIR | MoorDyn_SaveBodyVTK (MoorDynBody b, const char *filename) |
| Save the point to a VTK (.vtu) file. More... | |
| int DECLDIR | MoorDyn_GetLineID (MoorDynLine l, int *id) |
| Get the line identifier. More... | |
| int DECLDIR | MoorDyn_GetLineN (MoorDynLine l, unsigned int *n) |
| Get the line number of segments. More... | |
| int DECLDIR | MoorDyn_GetLineNumberNodes (MoorDynLine l, unsigned int *n) |
| Get the line number of nodes. More... | |
| int DECLDIR | MoorDyn_GetLineUnstretchedLength (MoorDynLine l, double *ul) |
| Get the line unstretched length. More... | |
| int DECLDIR | MoorDyn_SetLineUnstretchedLength (MoorDynLine l, double ul) |
| Set the line unstretched length. More... | |
| int DECLDIR | MoorDyn_SetLineUnstretchedLengthVel (MoorDynLine l, double v) |
| Set the line unstretched length rate of change. More... | |
| int DECLDIR | MoorDyn_IsLineConstantEA (MoorDynLine l, int *b) |
| Get whether the line is governed by a non-linear stiffness or a constant one. More... | |
| int DECLDIR | MoorDyn_GetLineConstantEA (MoorDynLine l, double *EA) |
| Get the constant stiffness of the line. More... | |
| int DECLDIR | MoorDyn_SetLineConstantEA (MoorDynLine l, double EA) |
| Set the constant stiffness of the line. More... | |
| int DECLDIR | MoorDyn_IsLinePressBend (MoorDynLine l, int *b) |
| Get whether the line pressure bending is considered or not. More... | |
| int DECLDIR | MoorDyn_SetLinePressBend (MoorDynLine l, int b) |
| Set whether the line pressure bending is considered or not. More... | |
| int DECLDIR | MoorDyn_SetLinePressInt (MoorDynLine l, const double *p) |
| Set the line internal pressure values at the nodes. More... | |
| int DECLDIR | MoorDyn_GetLineNodePos (MoorDynLine l, unsigned int i, double pos[3]) |
| Get a line node position. More... | |
| int DECLDIR | MoorDyn_GetLineNodeVel (MoorDynLine l, unsigned int i, double vel[3]) |
| Get a line node velocity. More... | |
| int DECLDIR | MoorDyn_GetLineNodeForce (MoorDynLine l, unsigned int i, double f[3]) |
| Get a line node force. More... | |
| int DECLDIR | MoorDyn_GetLineNodeTen (MoorDynLine l, unsigned int i, double t[3]) |
| Get a line node tension. More... | |
| int DECLDIR | MoorDyn_GetLineNodeBendStiff (MoorDynLine l, unsigned int i, double t[3]) |
| Get a line node bending stiffness force. More... | |
| int DECLDIR | MoorDyn_GetLineNodeWeight (MoorDynLine l, unsigned int i, double f[3]) |
| Get a line node weight and bouyancy. More... | |
| int DECLDIR | MoorDyn_GetLineNodeDrag (MoorDynLine l, unsigned int i, double f[3]) |
| Get a line node drag force. More... | |
| int DECLDIR | MoorDyn_GetLineNodeFroudeKrilov (MoorDynLine l, unsigned int i, double f[3]) |
| Get a line node Froude Krilov force. More... | |
| int DECLDIR | MoorDyn_GetLineNodeSeabedForce (MoorDynLine l, unsigned int i, double f[3]) |
| Get a line node seabed reaction. More... | |
| int DECLDIR | MoorDyn_GetLineNodeCurv (MoorDynLine l, unsigned int i, double *c) |
| Get a line curvature at a node. More... | |
| int DECLDIR | MoorDyn_GetLineNodeM (MoorDynLine l, unsigned int i, double m[3][3]) |
| Get a line node mass matrix. More... | |
| int DECLDIR | MoorDyn_GetLineFairTen (MoorDynLine l, double *t) |
| Get the tension module at the end point B (the fairlead) More... | |
| int DECLDIR | MoorDyn_GetLineMaxTen (MoorDynLine l, double *t) |
| Get the maximum tension module. More... | |
| int DECLDIR | MoorDyn_SaveLineVTK (MoorDynLine l, const char *filename) |
| Save the line to a VTK (.vtu) file. More... | |
| MoorDyn DECLDIR | MoorDyn_Create (const char *infilename) |
| Creates a MoorDyn instance. More... | |
| int DECLDIR | MoorDyn_NCoupledDOF (MoorDyn system, unsigned int *n) |
| Get the number of coupled Degrees Of Freedom (DOFs) More... | |
| int DECLDIR | MoorDyn_SetVerbosity (MoorDyn system, int verbosity) |
| Set the instance verbosity level. More... | |
| int DECLDIR | MoorDyn_SetLogFile (MoorDyn system, const char *log_path) |
| Set the instance log file. More... | |
| int DECLDIR | MoorDyn_SetLogLevel (MoorDyn system, int verbosity) |
| Set the instance log file printing level. More... | |
| int DECLDIR | MoorDyn_Log (MoorDyn system, int level, const char *msg) |
| Log a message. More... | |
| int DECLDIR | MoorDyn_Init (MoorDyn system, const double *x, const double *xd) |
| Compute the initial condition of a MoorDyn system. More... | |
| int DECLDIR | MoorDyn_Init_NoIC (MoorDyn system, const double *x, const double *xd) |
| The same than MoorDyn_Init(), but the initial condition is not computed at all. More... | |
| int DECLDIR | MoorDyn_Step (MoorDyn system, const double *x, const double *xd, double *f, double *t, double *dt) |
| Runs a time step of the MoorDyn system. More... | |
| int DECLDIR | MoorDyn_Close (MoorDyn system) |
| Releases MoorDyn allocated resources. More... | |
| MoorDynWaves DECLDIR | MoorDyn_GetWaves (MoorDyn system) |
| Get the wave kinematics instance. More... | |
| MoorDynSeafloor DECLDIR | MoorDyn_GetSeafloor (MoorDyn system) |
| Get the 3D seafloor instance. More... | |
| int DECLDIR | MoorDyn_GetNumberBodies (MoorDyn system, unsigned int *n) |
| Get the number of bodies. More... | |
| MoorDynBody DECLDIR | MoorDyn_GetBody (MoorDyn system, unsigned int b) |
| Get a rigid body. More... | |
| int DECLDIR | MoorDyn_GetNumberRods (MoorDyn system, unsigned int *n) |
| Get the number of rods. More... | |
| MoorDynRod DECLDIR | MoorDyn_GetRod (MoorDyn system, unsigned int r) |
| Get a rod. More... | |
| int DECLDIR | MoorDyn_GetNumberPoints (MoorDyn system, unsigned int *n) |
| Get the number of points. More... | |
| MoorDynPoint DECLDIR | MoorDyn_GetPoint (MoorDyn system, unsigned int c) |
| Get a point. More... | |
| int DECLDIR | MoorDyn_GetNumberLines (MoorDyn system, unsigned int *n) |
| Get the number of lines. More... | |
| MoorDynLine DECLDIR | MoorDyn_GetLine (MoorDyn system, unsigned int l) |
| Get a line instance. More... | |
| int DECLDIR | MoorDyn_GetFASTtens (MoorDyn system, const int *numLines, float FairHTen[], float FairVTen[], float AnchHTen[], float AnchVTen[]) |
| Function for providing FASTv7 customary line tension quantities. More... | |
| int DECLDIR | MoorDyn_GetDt (MoorDyn system, double *dt) |
| Get the current model time step. More... | |
| int DECLDIR | MoorDyn_SetDt (MoorDyn system, double dt) |
| Set the model time step. More... | |
| int DECLDIR | MoorDyn_GetCFL (MoorDyn system, double *cfl) |
| Get the current model Courant–Friedrichs–Lewy factor. More... | |
| int DECLDIR | MoorDyn_SetCFL (MoorDyn system, double cfl) |
| Set the model Courant–Friedrichs–Lewy factor. More... | |
| int DECLDIR | MoorDyn_GetTimeScheme (MoorDyn system, char *name, size_t *name_len) |
| Get the current time scheme name. More... | |
| int DECLDIR | MoorDyn_SetTimeScheme (MoorDyn system, const char *name) |
| Set the time scheme by its name. More... | |
| int DECLDIR | MoorDyn_SaveState (MoorDyn system, const char *filepath) |
| Save the system state, so it can be loaded afterwards. More... | |
| int DECLDIR | MoorDyn_LoadState (MoorDyn system, const char *filepath) |
| Load and set a system state. More... | |
| int DECLDIR | MoorDyn_Serialize (MoorDyn system, size_t *size, uint64_t *data) |
| Serialize the system to bytes. More... | |
| int DECLDIR | MoorDyn_Deserialize (MoorDyn system, const uint64_t *data) |
| Load the system from the serialized data before. More... | |
| int DECLDIR | MoorDyn_Save (MoorDyn system, const char *filepath) |
| Save the system so it can be loaded afterwards. More... | |
| int DECLDIR | MoorDyn_Load (MoorDyn system, const char *filepath) |
| Load the system saved before. More... | |
| int DECLDIR | MoorDyn_SaveVTK (MoorDyn system, const char *filename) |
| Save the whole system to a VTK (.vtm) file. More... | |
| int DECLDIR | MoorDyn_GetPointID (MoorDynPoint point, int *id) |
| Get the point identifier. More... | |
| int DECLDIR | MoorDyn_GetPointType (MoorDynPoint point, int *t) |
| Get the point type. More... | |
| int DECLDIR | MoorDyn_GetPointPos (MoorDynPoint point, double pos[3]) |
| Get the position of a point. More... | |
| int DECLDIR | MoorDyn_GetPointVel (MoorDynPoint point, double v[3]) |
| Get the velocity of a point. More... | |
| int DECLDIR | MoorDyn_GetPointForce (MoorDynPoint point, double f[3]) |
| Get the force at a point. More... | |
| int DECLDIR | MoorDyn_GetPointM (MoorDynPoint point, double m[3][3]) |
| Get the point mass matrix. More... | |
| int DECLDIR | MoorDyn_GetPointNAttached (MoorDynPoint point, unsigned int *n) |
| Get the number of connected lines. More... | |
| int DECLDIR | MoorDyn_GetPointAttached (MoorDynPoint point, unsigned int i, MoorDynLine *l, int *e) |
| Get the number of connected lines. More... | |
| int DECLDIR | MoorDyn_SavePointVTK (MoorDynPoint point, const char *filename) |
| Save the point to a VTK (.vtu) file. More... | |
| int DECLDIR | MoorDyn_GetRodID (MoorDynRod l, int *id) |
| Get the line identifier. More... | |
| int DECLDIR | MoorDyn_GetRodType (MoorDynRod l, int *t) |
| Get the line type. More... | |
| int DECLDIR | MoorDyn_GetRodForce (MoorDynRod l, double f[6]) |
| Get the net force acting on the rod, as well as the moment at end point A if the node is not pinned. More... | |
| int DECLDIR | MoorDyn_GetRodM (MoorDynRod l, double m[6][6]) |
| Get the total rod mass matrix. More... | |
| int DECLDIR | MoorDyn_GetRodN (MoorDynRod l, unsigned int *n) |
| Get the line number of segments. More... | |
| int DECLDIR | MoorDyn_GetRodNumberNodes (MoorDynRod l, unsigned int *n) |
| Get the line number of nodes. More... | |
| int DECLDIR | MoorDyn_GetRodNodePos (MoorDynRod l, unsigned int i, double pos[3]) |
| Get a rod node position. More... | |
| int DECLDIR | MoorDyn_GetRodNodeVel (MoorDynRod l, unsigned int i, double vel[3]) |
| Get a rod node velocity. More... | |
| int DECLDIR | MoorDyn_SaveRodVTK (MoorDynRod l, const char *filename) |
| Save the line to a VTK (.vtu) file. More... | |
| int DECLDIR | MoorDyn_GetWavesKin (MoorDynWaves waves, double x, double y, double z, double U[3], double Ud[3], double *zeta, double *PDyn, MoorDynSeafloor seafloor) |
| Get the velocity, acceleration, wave height and dynamic pressure at a specific position and time. More... | |
| double DECLDIR | WaveNumber (double Omega, double g, double h) |
| Compute the wave number. More... | |
External Wave Kinematics | |
| int DECLDIR | MoorDyn_ExternalWaveKinInit (MoorDyn system, unsigned int *n) |
| Initializes the external Wave kinematics. More... | |
| int DECLDIR | MoorDyn_ExternalWaveKinGetN (MoorDyn system, unsigned int *n) |
| Get the number of points where the waves kinematics shall be provided. More... | |
| int DECLDIR | MoorDyn_ExternalWaveKinGetCoordinates (MoorDyn system, double *r) |
| Get the points where the waves kinematics shall be provided. More... | |
| int DECLDIR DEPRECATED | MoorDyn_GetWaveKinCoordinates (MoorDyn system, double *r) |
| Get the points where the waves kinematics shall be provided. More... | |
| int DECLDIR | MoorDyn_ExternalWaveKinSet (MoorDyn system, const double *U, const double *Ud, double t) |
| Set the kinematics of the waves. More... | |
| int DECLDIR DEPRECATED | MoorDyn_SetWaveKin (MoorDyn system, const double *U, const double *Ud, double t) |
| Set the kinematics of the waves. More... | |
Releases MoorDyn allocated resources.
| system | The Moordyn system |

Creates a MoorDyn instance.
At the time of creating a new MoorDyn instance, the input file is read and all the objects and structures are created. You must call afterwards MoorDyn_Init() to compute the initial conditions
| infilename | The input file, if either NULL or "", then "Mooring/lines.txt" will be considered |
Load the system from the serialized data before.
You can restore the system to a previous state retrieved calling MoorDyn_Serialize()
| system | The Moordyn system |
| data | Bytes array |
Get the points where the waves kinematics shall be provided.
The kinematics on those points shall be provided just if WaveKin is set to 1 in the input file. The pointer r should be to an array with enough space for 3 * N doubles, where N is the value from MoorDyn_ExternalWaveKinGetN or MoorDyn_ExternalWaveKinInit.
| system | The Moordyn system |
| r | The output coordinates (3 components per point) |

Get the number of points where the waves kinematics shall be provided.
This is useless unless WaveKin option is set to 1 in the input file
| system | The Moordyn system |
| n | The output number of points where the wave kinematics shall be provided |

Initializes the external Wave kinematics.
This is useless unless the WaveKin option is set to 1 in the input file. If that is the case, remember to call this function after MoorDyn_Init()
| system | The Moordyn system |
| n | The number of points where the wave kinematics shall be provided |

| int DECLDIR MoorDyn_ExternalWaveKinSet | ( | MoorDyn | system, |
| const double * | U, | ||
| const double * | Ud, | ||
| double | t | ||
| ) |
Set the kinematics of the waves.
Use this function if the WaveKin option is set to 1 in the input file
| system | The Moordyn system |
| U | The velocities at the points (3 components per point) |
| Ud | The accelerations at the points (3 components per point) |
| t | Simulation time |


| MoorDynBody DECLDIR MoorDyn_GetBody | ( | MoorDyn | system, |
| unsigned int | b | ||
| ) |
Get a rigid body.
Remember that the first body index is 1
| system | The Moordyn system |
| b | The body index |
| int DECLDIR MoorDyn_GetBodyAngle | ( | MoorDynBody | b, |
| double | r[3] | ||
| ) |
Get the body angle.
| b | The Moordyn body |
| r | The output angles (3dof) |

| int DECLDIR MoorDyn_GetBodyAngVel | ( | MoorDynBody | b, |
| double | rd[3] | ||
| ) |
Get the body angular velocity.
| b | The Moordyn body |
| rd | The output angular velocity (3dof) |

| int DECLDIR MoorDyn_GetBodyForce | ( | MoorDynBody | b, |
| double | f[6] | ||
| ) |
Get the body angular velocity.
| b | The Moordyn body |
| rd | The output angular velocity (3dof) |

| int DECLDIR MoorDyn_GetBodyID | ( | MoorDynBody | b, |
| int * | id | ||
| ) |
Get the body identifier.
| b | The Moordyn body |
| id | The output id |
| int DECLDIR MoorDyn_GetBodyM | ( | MoorDynBody | b, |
| double | m[6][6] | ||
| ) |
Get the body mass and intertia matrix.
| b | The Moordyn body |
| m | The output mass matrix |

| int DECLDIR MoorDyn_GetBodyPos | ( | MoorDynBody | b, |
| double | r[3] | ||
| ) |
Get the body position.
| b | The Moordyn body |
| r | The output position (3dof) |

| int DECLDIR MoorDyn_GetBodyState | ( | MoorDynBody | b, |
| double | r[6], | ||
| double | rd[6] | ||
| ) |
Get the body state.
| b | The Moordyn body |
| r | The output position (6dof) |
| rd | The output velocity (6dof) |

| int DECLDIR MoorDyn_GetBodyType | ( | MoorDynBody | b, |
| int * | t | ||
| ) |
Get the point type.
| b | The Moordyn body |
| t | The output type |
| int DECLDIR MoorDyn_GetBodyVel | ( | MoorDynBody | b, |
| double | rd[3] | ||
| ) |
Get the body velocity.
| b | The Moordyn body |
| rd | The output velocity (3dof) |

Get the current model Courant–Friedrichs–Lewy factor.
| system | The Moordyn system |
| cfl | The output Courant–Friedrichs–Lewy factor |
Get the current model time step.
| system | The Moordyn system |
| dt | The output time step |
| int DECLDIR MoorDyn_GetFASTtens | ( | MoorDyn | system, |
| const int * | numLines, | ||
| float | FairHTen[], | ||
| float | FairVTen[], | ||
| float | AnchHTen[], | ||
| float | AnchVTen[] | ||
| ) |
Function for providing FASTv7 customary line tension quantities.
| system | The Moordyn system |
| numLines | The number of lines |
| FairHTen | Allocated memory for the numLines horizontal forces at the fairlead |
| FairVTen | Allocated memory for the numLines vertical forces at the fairlead |
| AnchHTen | Allocated memory for the numLines horizontal forces at the anchor |
| AnchVTen | Allocated memory for the numLines vertical forces at the anchor |
| MoorDynLine DECLDIR MoorDyn_GetLine | ( | MoorDyn | system, |
| unsigned int | l | ||
| ) |
Get a line instance.
| system | The Moordyn system |
| l | The line identifier (from 1 to the number of lines) |
| int DECLDIR MoorDyn_GetLineConstantEA | ( | MoorDynLine | l, |
| double * | EA | ||
| ) |
Get the constant stiffness of the line.
This value is useless if non-linear stiffness is considered
| l | The Moordyn line |
| EA | The constant stiffness EA value |
| int DECLDIR MoorDyn_GetLineFairTen | ( | MoorDynLine | l, |
| double * | t | ||
| ) |
Get the tension module at the end point B (the fairlead)
| l | The Moordyn line |
| t | The output node tension module |
| int DECLDIR MoorDyn_GetLineID | ( | MoorDynLine | l, |
| int * | id | ||
| ) |
Get the line identifier.
| l | The Moordyn line |
| id | The output id |
| int DECLDIR MoorDyn_GetLineMaxTen | ( | MoorDynLine | l, |
| double * | t | ||
| ) |
Get the maximum tension module.
| l | The Moordyn line |
| t | The output maximum tension module |
| int DECLDIR MoorDyn_GetLineN | ( | MoorDynLine | l, |
| unsigned int * | n | ||
| ) |
Get the line number of segments.
The number of nodes is equal to this value plus 1
| l | The Moordyn line |
| n | The output number of nodes |

| int DECLDIR MoorDyn_GetLineNodeBendStiff | ( | MoorDynLine | l, |
| unsigned int | i, | ||
| double | t[3] | ||
| ) |
Get a line node bending stiffness force.
The bending stiffness is computed at each segment as
with
the unstretched segment length,
the Young's modulus,
the segment normal axis inertia, and
the curvature vector.
To get the node bending stiffness forces the surrounding segments forces are accumulated
| l | The Moordyn line |
| i | The node index |
| t | The output node force |

| int DECLDIR MoorDyn_GetLineNodeCurv | ( | MoorDynLine | l, |
| unsigned int | i, | ||
| double * | c | ||
| ) |
Get a line curvature at a node.
| l | The Moordyn line |
| i | The node index |
| c | The output line curvature |
| int DECLDIR MoorDyn_GetLineNodeDrag | ( | MoorDynLine | l, |
| unsigned int | i, | ||
| double | f[3] | ||
| ) |
Get a line node drag force.
This is computed at each segment as
with
the unstretched segment length,
the portion of the segment submerged,
the water density,
the line diameter,
and
the normal and tangential drag coefficients, and
and
the tangential and normal velocities:
with
the velocity,
the flow velocity and
the direction verctor of the segment
The drag at any internal node is computed as the average of the surrounding segments, while on the line-ends half of the associated ending segment drag force is returned.
| l | The Moordyn line |
| i | The node index |
| f | The output node force |

| int DECLDIR MoorDyn_GetLineNodeForce | ( | MoorDynLine | l, |
| unsigned int | i, | ||
| double | f[3] | ||
| ) |
Get a line node force.
To get the components of the force use MoorDyn_GetLineNodeTen() , MoorDyn_GetLineNodeBendStiff(), MoorDyn_GetLineNodeWeight() , MoorDyn_GetLineNodeDrag() , MoorDyn_GetLineNodeFroudeKrilov() and MoorDyn_GetLineNodeSeaBedForce()
| l | The Moordyn line |
| i | The node index |
| f | The output node net force |

| int DECLDIR MoorDyn_GetLineNodeFroudeKrilov | ( | MoorDynLine | l, |
| unsigned int | i, | ||
| double | f[3] | ||
| ) |
Get a line node Froude Krilov force.
This is computed at each segment as
with
the segment volume,
the portion of the segment submerged,
the water density,
and
the normal and tangential drag coefficients, and
and
the tangential and normal accelerations:
with
the direction verctor of the segment
The force at any internal node is computed as the average of the surrounding segments, while on the line-ends half of the associated ending segment Froude-Krylov force is returned.
| l | The Moordyn line |
| i | The node index |
| f | The output node force |

| int DECLDIR MoorDyn_GetLineNodeM | ( | MoorDynLine | l, |
| unsigned int | i, | ||
| double | m[3][3] | ||
| ) |
Get a line node mass matrix.
The mass matrix includes the node mass as well as the added mass
| l | The Moordyn line |
| i | The node index |
| m | The output mass matrix |

| int DECLDIR MoorDyn_GetLineNodePos | ( | MoorDynLine | l, |
| unsigned int | i, | ||
| double | pos[3] | ||
| ) |
Get a line node position.
| l | The Moordyn line |
| i | The node index |
| pos | The output node position |

| int DECLDIR MoorDyn_GetLineNodeSeabedForce | ( | MoorDynLine | l, |
| unsigned int | i, | ||
| double | f[3] | ||
| ) |
Get a line node seabed reaction.
This is computed at each segment as
with
the unstretched segment length,
the line diameter
and
the bottom stiff and drag coefficients,
the seabed position,
the position,
the velocity and
the upward direction vector.
If bottom friction is configured, the force is added to this magnitude as well.
The reaction force at any internal node is computed as the average of the surrounding segments, while on the line-ends half of the associated ending segment weight force is returned.
| l | The Moordyn line |
| i | The node index |
| f | The output node force |

| int DECLDIR MoorDyn_GetLineNodeTen | ( | MoorDynLine | l, |
| unsigned int | i, | ||
| double | t[3] | ||
| ) |
Get a line node tension.
The node tension is the sum of the axial stiffness plus the internal damping
with
and
the stretched and unstretched segment lengths respectively,
the Young's modulus,
the transversal area,
the internal damping coefficient and
the direction verctor of the segment.
As can be appreciated, the node tension is computed at each segment. So to get the node one the surrounding segments are averaged (in case of line-ends the associated ending segment tension is returned)
| l | The Moordyn line |
| i | The node index |
| t | The output node tension |

| int DECLDIR MoorDyn_GetLineNodeVel | ( | MoorDynLine | l, |
| unsigned int | i, | ||
| double | vel[3] | ||
| ) |
Get a line node velocity.
| l | The Moordyn line |
| i | The node index |
| vel | The output node velocity |

| int DECLDIR MoorDyn_GetLineNodeWeight | ( | MoorDynLine | l, |
| unsigned int | i, | ||
| double | f[3] | ||
| ) |
Get a line node weight and bouyancy.
This is computed at each segment as
with
the unstretched segment length,
the transversal area,
the line material density,
the water density,
the portion of the segment submerged and
the gravity acceleration.
The weight and buoyancy force at any internal node is computed as the average of the surrounding segments, while on the line-ends half of the associated ending segment weight force is returned.
| l | The Moordyn line |
| i | The node index |
| f | The output node force |

| int DECLDIR MoorDyn_GetLineNumberNodes | ( | MoorDynLine | l, |
| unsigned int * | n | ||
| ) |
Get the line number of nodes.
| l | The Moordyn line |
| n | The output number of nodes |

| int DECLDIR MoorDyn_GetLineUnstretchedLength | ( | MoorDynLine | l, |
| double * | ul | ||
| ) |
Get the line unstretched length.
| l | The Moordyn line |
| ul | The output length |
Get the number of bodies.
Remember that the first body index is 1
| system | The Moordyn system |
| n | The output number of bodies |
Get the number of lines.
Remember that the first line index is 1
| system | The Moordyn system |
| n | The output number of lines |
Get the number of points.
Remember that the first point index is 1
| system | The Moordyn system |
| n | The output number of points |
Get the number of rods.
Remember that the first rod index is 1
| system | The Moordyn system |
| n | The output number of rods |
| MoorDynPoint DECLDIR MoorDyn_GetPoint | ( | MoorDyn | system, |
| unsigned int | c | ||
| ) |
Get a point.
| system | The Moordyn system |
| c | The point |
| int DECLDIR MoorDyn_GetPointAttached | ( | MoorDynPoint | point, |
| unsigned int | i, | ||
| MoorDynLine * | l, | ||
| int * | e | ||
| ) |
Get the number of connected lines.
| point | The Moordyn point |
| i | The index of the attached line |
| l | The output attached line |
| e | The output endpoint, see moordyn::EndPoints |
| int DECLDIR MoorDyn_GetPointForce | ( | MoorDynPoint | point, |
| double | f[3] | ||
| ) |
Get the force at a point.
| point | The Moordyn point |
| f | The output force |

| int DECLDIR MoorDyn_GetPointID | ( | MoorDynPoint | point, |
| int * | id | ||
| ) |
Get the point identifier.
| point | The Moordyn point |
| id | The output id |
| int DECLDIR MoorDyn_GetPointM | ( | MoorDynPoint | point, |
| double | m[3][3] | ||
| ) |
Get the point mass matrix.
| point | The Moordyn point |
| f | The output force |

| int DECLDIR MoorDyn_GetPointNAttached | ( | MoorDynPoint | point, |
| unsigned int * | n | ||
| ) |
Get the number of connected lines.
| point | The Moordyn point |
| n | The output number of connected lines |
| int DECLDIR MoorDyn_GetPointPos | ( | MoorDynPoint | point, |
| double | pos[3] | ||
| ) |
Get the position of a point.
| point | The Moordyn point |
| pos | The output position |

| int DECLDIR MoorDyn_GetPointType | ( | MoorDynPoint | point, |
| int * | t | ||
| ) |
Get the point type.
| point | The Moordyn point |
| t | The output type |
| int DECLDIR MoorDyn_GetPointVel | ( | MoorDynPoint | point, |
| double | v[3] | ||
| ) |
Get the velocity of a point.
| point | The Moordyn point |
| v | The output velocity |

| MoorDynRod DECLDIR MoorDyn_GetRod | ( | MoorDyn | system, |
| unsigned int | r | ||
| ) |
Get a rod.
| system | The Moordyn system |
| r | The rod |
| int DECLDIR MoorDyn_GetRodForce | ( | MoorDynRod | l, |
| double | f[6] | ||
| ) |
Get the net force acting on the rod, as well as the moment at end point A if the node is not pinned.
| l | The Moordyn rod |
| f | The output force |

| int DECLDIR MoorDyn_GetRodID | ( | MoorDynRod | l, |
| int * | id | ||
| ) |
Get the line identifier.
| l | The Moordyn rod |
| id | The output id |
| int DECLDIR MoorDyn_GetRodM | ( | MoorDynRod | l, |
| double | m[6][6] | ||
| ) |
Get the total rod mass matrix.
| l | The Moordyn rod |
| m | The output mass matrix |

| int DECLDIR MoorDyn_GetRodN | ( | MoorDynRod | l, |
| unsigned int * | n | ||
| ) |
Get the line number of segments.
The number of nodes is equal to this value plus 1
| l | The Moordyn rod |
| n | The output number of nodes |

| int DECLDIR MoorDyn_GetRodNodePos | ( | MoorDynRod | l, |
| unsigned int | i, | ||
| double | pos[3] | ||
| ) |
Get a rod node position.
| l | The Moordyn rod |
| i | The node index |
| pos | The output node position |

| int DECLDIR MoorDyn_GetRodNodeVel | ( | MoorDynRod | l, |
| unsigned int | i, | ||
| double | vel[3] | ||
| ) |
Get a rod node velocity.
| l | The Moordyn rod |
| i | The node index |
| vel | The output node velocity |

| int DECLDIR MoorDyn_GetRodNumberNodes | ( | MoorDynRod | l, |
| unsigned int * | n | ||
| ) |
Get the line number of nodes.
| l | The Moordyn rod |
| n | The output number of nodes |

| int DECLDIR MoorDyn_GetRodType | ( | MoorDynRod | l, |
| int * | t | ||
| ) |
Get the line type.
| l | The Moordyn rod |
| t | The output type |
| MoorDynSeafloor DECLDIR MoorDyn_GetSeafloor | ( | MoorDyn | system | ) |
Get the 3D seafloor instance.
The seafloor instance is only not null if a SeafloorPath was given as an option.
| system | The Moordyn system |
Get the current time scheme name.
| system | The Moordyn system |
| name | The output name. Can be NULL. |
| name_len | The output number of bytes written. Can be NULL. |
|
inline |
Get the points where the waves kinematics shall be provided.
The kinematics on those points shall be provided just if WaveKin is set to 1 in the input file
| system | The Moordyn system |
| r | The output coordinates (3 components per point) |

| MoorDynWaves DECLDIR MoorDyn_GetWaves | ( | MoorDyn | system | ) |
Get the wave kinematics instance.
The wave kinematics instance is only useful if WaveKin option is set to 2 in the input file.
| system | The Moordyn system |
| int DECLDIR MoorDyn_GetWavesKin | ( | MoorDynWaves | waves, |
| double | x, | ||
| double | y, | ||
| double | z, | ||
| double | U[3], | ||
| double | Ud[3], | ||
| double * | zeta, | ||
| double * | PDyn, | ||
| MoorDynSeafloor | seafloor | ||
| ) |
Get the velocity, acceleration, wave height and dynamic pressure at a specific position and time.
| waves | The Waves instance |
| x | The point x coordinate |
| y | The point y coordinate |
| z | The point z coordinate |
| U | The output velocity |
| Ud | The output acceleration |
| zeta | The output wave height |
| PDyn | The output dynamic pressure |
| seafloor | The seafloor instance, see MoorDyn_GetSeafloor() |

Compute the initial condition of a MoorDyn system.
At the time of creating a new MoorDyn instance, the input file is read and all the objects and structures are created. You must call afterwards MoorDyn_Init() to compute the initial conditions
| system | The Moordyn system |
| x | Position vector (6 components per coupled body or cantilevered rod and 3 components per pinned rod or coupled point) |
| xd | Velocity vector (6 components per coupled body or cantilevered rod and 3 components per pinned rod or coupled point) |
x and xd The same than MoorDyn_Init(), but the initial condition is not computed at all.
This is of use when you are loading a state file afterwards with Moordyn_Load()
| system | The Moordyn system |
| x | Position vector (6 components per coupled body or cantilevered rod and 3 components per pinned rod or coupled point) |
| xd | Velocity vector (6 components per coupled body or cantilevered rod and 3 components per pinned rod or coupled point) |
x and xd | int DECLDIR MoorDyn_IsLineConstantEA | ( | MoorDynLine | l, |
| int * | b | ||
| ) |
Get whether the line is governed by a non-linear stiffness or a constant one.
| l | The Moordyn line |
| b | 1 if the stiffness of the line is constant, 0 if a non-linear stiffness has been set |
| int DECLDIR MoorDyn_IsLinePressBend | ( | MoorDynLine | l, |
| int * | b | ||
| ) |
Get whether the line pressure bending is considered or not.
| l | The Moordyn line |
| b | 1 if the pressure bending of the line is enabled, 0 otherwise |
Load the system saved before.
You must still call MoorDyn_Create() and MoorDyn_Init_NoIC() before calling this function
| system | The Moordyn system |
| filepath | The path of the MoorDyn saved system |
Load and set a system state.
The system state contains the system position and velocity.
| system | The Moordyn system |
| filepath | The path of the MoorDyn saved system |
Log a message.
| system | The Moordyn system |
| level | The message level. It can take the following values
|
| msg | The message to log |
level is lower than the threshold levels set with MoorDyn_SetVerbosity() and MoorDyn_SetLogLevel(), the message will not be logged in the terminal and the log file respectively Get the number of coupled Degrees Of Freedom (DOFs)
The number of components for some parameters in MoorDyn_Init() and MoorDyn_Step() can be known using this function
system is NULL, MOORDYN_SUCESS otherwise Save the system so it can be loaded afterwards.
At the time of loading the system, it is still required to create the system reading the same definition file and calling MoorDyn_Init_NoIC()
| system | The Moordyn system |
| filepath | The path of the file to write |
| int DECLDIR MoorDyn_SaveBodyVTK | ( | MoorDynBody | b, |
| const char * | filename | ||
| ) |
Save the point to a VTK (.vtu) file.
| b | The Moordyn body |
| filename | The output maximum tension module |
| int DECLDIR MoorDyn_SaveLineVTK | ( | MoorDynLine | l, |
| const char * | filename | ||
| ) |
Save the line to a VTK (.vtu) file.
| l | The Moordyn line |
| filename | The output maximum tension module |
| int DECLDIR MoorDyn_SavePointVTK | ( | MoorDynPoint | point, |
| const char * | filename | ||
| ) |
Save the point to a VTK (.vtu) file.
| point | The Moordyn point |
| filename | The output maximum tension module |
| int DECLDIR MoorDyn_SaveRodVTK | ( | MoorDynRod | l, |
| const char * | filename | ||
| ) |
Save the line to a VTK (.vtu) file.
| l | The Moordyn rod |
| filename | The output maximum tension module |
Save the system state, so it can be loaded afterwards.
The system state contains the system position and velocity.
| system | The Moordyn system |
| filepath | The path of the file to write |
Save the whole system to a VTK (.vtm) file.
In general it is more convenient to handle each object independently, using MoorDyn_SaveLineVTK() and MoorDyn_SaveRodVTK() functions. However, if the number of subinstances is large, that would not be an option anymore. In that case you can use this function to pack everything together in a single file
| system | The Moordyn system |
| filename | The output maximum tension module |
Serialize the system to bytes.
Typically you want to call this function twice. A first call to know the amount of memory to be allocated for the bytes array and a second one to actually get the bytes array
The returned bytes can be used afterwards to restore the model calling to MoorDyn_Deserialize()
| system | The Moordyn system |
| size | Output size of the bytes array. It can be null |
| data | Allocated memory for the output bytes array. It can be null |
Set the model Courant–Friedrichs–Lewy factor.
| system | The Moordyn system |
| cfl | The new Courant–Friedrichs–Lewy factor |
Set the model time step.
| system | The Moordyn system |
| dt | The new time step |
| int DECLDIR MoorDyn_SetLineConstantEA | ( | MoorDynLine | l, |
| double | EA | ||
| ) |
Set the constant stiffness of the line.
This value is useless if non-linear stiffness is considered
| l | The Moordyn line |
| EA | The constant axial stiffness EA value [N] |
| int DECLDIR MoorDyn_SetLinePressBend | ( | MoorDynLine | l, |
| int | b | ||
| ) |
Set whether the line pressure bending is considered or not.
| l | The Moordyn line |
| b | 1 if the pressure bending of the line shall be considered, 0 otherwise |
| int DECLDIR MoorDyn_SetLinePressInt | ( | MoorDynLine | l, |
| const double * | p | ||
| ) |
Set the line internal pressure values at the nodes.
| l | The Moordyn line |
| p | Pressure values, and array with MoorDyn_GetLineN() + 1 values |
| int DECLDIR MoorDyn_SetLineUnstretchedLength | ( | MoorDynLine | l, |
| double | ul | ||
| ) |
Set the line unstretched length.
| l | The Moordyn line |
| ul | The new length |
| int DECLDIR MoorDyn_SetLineUnstretchedLengthVel | ( | MoorDynLine | l, |
| double | v | ||
| ) |
Set the line unstretched length rate of change.
| l | The Moordyn line |
| v | The rate of change |
Set the instance log file.
| system | The Moordyn system |
| log_path | The file path to print the log file |
Set the instance log file printing level.
| system | The Moordyn system |
| verbosity | The log file print level. It can take the following values
|
Set the time scheme by its name.
| system | The Moordyn system |
| name | The new time scheme name. |

Set the instance verbosity level.
| system | The Moordyn system |
| verbosity | The verbosity level. It can take the following values
|
|
inline |
Set the kinematics of the waves.
Use this function if WaveKin option is set to 1 in the input file
| system | The Moordyn system |
| U | The velocities at the points (3 components per point) |
| Ud | The accelerations at the points (3 components per point) |
| t | Simulation time |

| int DECLDIR MoorDyn_Step | ( | MoorDyn | system, |
| const double * | x, | ||
| const double * | xd, | ||
| double * | f, | ||
| double * | t, | ||
| double * | dt | ||
| ) |
Runs a time step of the MoorDyn system.
| system | The Moordyn system |
| x | Position vector |
| xd | Velocity vector |
| f | Output forces |
| t | Simulation time |
| dt | Time step |
x, xd and f 
| double DECLDIR WaveNumber | ( | double | Omega, |
| double | g, | ||
| double | h | ||
| ) |
Compute the wave number.
| Omega | The wave angular frequency |
| g | The gravity acceleration |
| h | The water depth |