MoorDyn
Typedefs | Functions
The C API

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

The functions for setting 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...
 

Detailed Description

Function Documentation

◆ MoorDyn_Close()

int DECLDIR MoorDyn_Close ( MoorDyn  system)

Releases MoorDyn allocated resources.

Parameters
systemThe Moordyn system
Returns
MOORDYN_SUCESS If the mooring system is correctly destroyed, an error code otherwise (see Errors reported by MoorDyn)
Here is the caller graph for this function:

◆ MoorDyn_Create()

MoorDyn DECLDIR MoorDyn_Create ( const char *  infilename)

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

Parameters
infilenameThe input file, if either NULL or "", then "Mooring/lines.txt" will be considered
Returns
The mooring instance, NULL if errors happened

◆ MoorDyn_Deserialize()

int DECLDIR MoorDyn_Deserialize ( MoorDyn  system,
const uint64_t *  data 
)

Load the system from the serialized data before.

You can restore the system to a previous state retrieved calling MoorDyn_Serialize()

Parameters
systemThe Moordyn system
dataBytes array
Returns
MOORDYN_SUCESS If the data is correctly set, an error code otherwise (see Errors reported by MoorDyn)
See also
MoorDyn_Save
MoorDyn_Init_NoIC

◆ MoorDyn_ExternalWaveKinGetCoordinates()

int DECLDIR MoorDyn_ExternalWaveKinGetCoordinates ( MoorDyn  system,
double *  r 
)

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.

Parameters
systemThe Moordyn system
rThe output coordinates (3 components per point)
Returns
MOORDYN_SUCESS If the data is correctly set, an error code otherwise (see Errors reported by MoorDyn)
See also
MoorDyn_ExternalWaveKinInit()
Here is the caller graph for this function:

◆ MoorDyn_ExternalWaveKinGetN()

int DECLDIR MoorDyn_ExternalWaveKinGetN ( MoorDyn  system,
unsigned int *  n 
)

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

Parameters
systemThe Moordyn system
nThe output number of points where the wave kinematics shall be provided
Returns
MOORDYN_SUCESS
See also
MoorDyn_ExternalWaveKinInit()
Here is the caller graph for this function:

◆ MoorDyn_ExternalWaveKinInit()

int DECLDIR MoorDyn_ExternalWaveKinInit ( MoorDyn  system,
unsigned int *  n 
)

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()

Parameters
systemThe Moordyn system
nThe number of points where the wave kinematics shall be provided
Returns
MOORDYN_SUCESS If the external waves are correctly initialized, an error code otherwise (see Errors reported by MoorDyn)
Here is the caller graph for this function:

◆ MoorDyn_ExternalWaveKinSet()

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

Parameters
systemThe Moordyn system
UThe velocities at the points (3 components per point)
UdThe accelerations at the points (3 components per point)
tSimulation time
Returns
MOORDYN_SUCCESS If the data is correctly set, an error code otherwise (see Errors reported by MoorDyn)
See also
MoorDyn_ExternalWaveKinInit()
MoorDyn_ExternalWaveKinGetCoordinates()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ MoorDyn_GetBody()

MoorDynBody DECLDIR MoorDyn_GetBody ( MoorDyn  system,
unsigned int  b 
)

Get a rigid body.

Remember that the first body index is 1

Parameters
systemThe Moordyn system
bThe body index
Returns
The body instance, NULL if errors happened

◆ MoorDyn_GetBodyAngle()

int DECLDIR MoorDyn_GetBodyAngle ( MoorDynBody  b,
double  r[3] 
)

Get the body angle.

Parameters
bThe Moordyn body
rThe output angles (3dof)
Returns
MOORDYN_INVALID_VALUE if a NULL body is provided, MOORDYN_SUCCESS otherwise
Here is the call graph for this function:

◆ MoorDyn_GetBodyAngVel()

int DECLDIR MoorDyn_GetBodyAngVel ( MoorDynBody  b,
double  rd[3] 
)

Get the body angular velocity.

Parameters
bThe Moordyn body
rdThe output angular velocity (3dof)
Returns
MOORDYN_INVALID_VALUE if a NULL body is provided, MOORDYN_SUCCESS otherwise
Here is the call graph for this function:

◆ MoorDyn_GetBodyForce()

int DECLDIR MoorDyn_GetBodyForce ( MoorDynBody  b,
double  f[6] 
)

Get the body angular velocity.

Parameters
bThe Moordyn body
rdThe output angular velocity (3dof)
Returns
MOORDYN_INVALID_VALUE if a NULL body is provided, MOORDYN_SUCCESS otherwise
Here is the call graph for this function:

◆ MoorDyn_GetBodyID()

int DECLDIR MoorDyn_GetBodyID ( MoorDynBody  b,
int *  id 
)

Get the body identifier.

Parameters
bThe Moordyn body
idThe output id
Returns
MOORDYN_INVALID_VALUE if a NULL point is provided, MOORDYN_SUCCESS otherwise

◆ MoorDyn_GetBodyM()

int DECLDIR MoorDyn_GetBodyM ( MoorDynBody  b,
double  m[6][6] 
)

Get the body mass and intertia matrix.

Parameters
bThe Moordyn body
mThe output mass matrix
Returns
MOORDYN_INVALID_VALUE if a NULL body is provided, MOORDYN_SUCCESS otherwise
Here is the call graph for this function:

◆ MoorDyn_GetBodyPos()

int DECLDIR MoorDyn_GetBodyPos ( MoorDynBody  b,
double  r[3] 
)

Get the body position.

Parameters
bThe Moordyn body
rThe output position (3dof)
Returns
MOORDYN_INVALID_VALUE if a NULL body is provided, MOORDYN_SUCCESS otherwise
Here is the call graph for this function:

◆ MoorDyn_GetBodyState()

int DECLDIR MoorDyn_GetBodyState ( MoorDynBody  b,
double  r[6],
double  rd[6] 
)

Get the body state.

Parameters
bThe Moordyn body
rThe output position (6dof)
rdThe output velocity (6dof)
Returns
MOORDYN_INVALID_VALUE if a NULL body is provided, MOORDYN_SUCCESS otherwise
Here is the call graph for this function:

◆ MoorDyn_GetBodyType()

int DECLDIR MoorDyn_GetBodyType ( MoorDynBody  b,
int *  t 
)

Get the point type.

Parameters
bThe Moordyn body
tThe output type
Returns
MOORDYN_INVALID_VALUE if a NULL point is provided, MOORDYN_SUCCESS otherwise
See also
Point::types

◆ MoorDyn_GetBodyVel()

int DECLDIR MoorDyn_GetBodyVel ( MoorDynBody  b,
double  rd[3] 
)

Get the body velocity.

Parameters
bThe Moordyn body
rdThe output velocity (3dof)
Returns
MOORDYN_INVALID_VALUE if a NULL body is provided, MOORDYN_SUCCESS otherwise
Here is the call graph for this function:

◆ MoorDyn_GetCFL()

int DECLDIR MoorDyn_GetCFL ( MoorDyn  system,
double *  cfl 
)

Get the current model Courant–Friedrichs–Lewy factor.

Parameters
systemThe Moordyn system
cflThe output Courant–Friedrichs–Lewy factor
Returns
MOORDYN_SUCESS if the data is correctly got, an error code otherwise (see Errors reported by MoorDyn)

◆ MoorDyn_GetDt()

int DECLDIR MoorDyn_GetDt ( MoorDyn  system,
double *  dt 
)

Get the current model time step.

Parameters
systemThe Moordyn system
dtThe output time step
Returns
MOORDYN_SUCESS if the data is correctly got, an error code otherwise (see Errors reported by MoorDyn)

◆ MoorDyn_GetFASTtens()

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.

Parameters
systemThe Moordyn system
numLinesThe number of lines
FairHTenAllocated memory for the numLines horizontal forces at the fairlead
FairVTenAllocated memory for the numLines vertical forces at the fairlead
AnchHTenAllocated memory for the numLines horizontal forces at the anchor
AnchVTenAllocated memory for the numLines vertical forces at the anchor
Returns
MOORDYN_SUCESS If the data is correctly set, an error code otherwise (see Errors reported by MoorDyn)

◆ MoorDyn_GetLine()

MoorDynLine DECLDIR MoorDyn_GetLine ( MoorDyn  system,
unsigned int  l 
)

Get a line instance.

Parameters
systemThe Moordyn system
lThe line identifier (from 1 to the number of lines)
Returns
The line instance, NULL if errors happened

◆ MoorDyn_GetLineConstantEA()

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

Parameters
lThe Moordyn line
EAThe constant stiffness EA value
Returns
MOORDYN_INVALID_VALUE if a NULL line is provided, MOORDYN_SUCCESS otherwise
See also
MoorDyn_IsLineConstantEA()
MoorDyn_SetLineConstantEA()

◆ MoorDyn_GetLineFairTen()

int DECLDIR MoorDyn_GetLineFairTen ( MoorDynLine  l,
double *  t 
)

Get the tension module at the end point B (the fairlead)

Parameters
lThe Moordyn line
tThe output node tension module
Returns
MOORDYN_INVALID_VALUE if a NULL line is provided, MOORDYN_SUCCESS otherwise

◆ MoorDyn_GetLineID()

int DECLDIR MoorDyn_GetLineID ( MoorDynLine  l,
int *  id 
)

Get the line identifier.

Parameters
lThe Moordyn line
idThe output id
Returns
MOORDYN_INVALID_VALUE if a NULL point is provided, MOORDYN_SUCCESS otherwise

◆ MoorDyn_GetLineMaxTen()

int DECLDIR MoorDyn_GetLineMaxTen ( MoorDynLine  l,
double *  t 
)

Get the maximum tension module.

Parameters
lThe Moordyn line
tThe output maximum tension module
Returns
MOORDYN_INVALID_VALUE if a NULL line is provided, MOORDYN_SUCCESS otherwise

◆ MoorDyn_GetLineN()

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

Parameters
lThe Moordyn line
nThe output number of nodes
Returns
MOORDYN_INVALID_VALUE if a NULL line is provided, MOORDYN_SUCCESS otherwise
Here is the caller graph for this function:

◆ MoorDyn_GetLineNodeBendStiff()

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

\[ \bar{Bs}(i) = E I \frac{\bar{k}(i)}{l_0} \]

with $l_0$ the unstretched segment length, $E$ the Young's modulus, $I$ the segment normal axis inertia, and $\bar{k}$ the curvature vector.

To get the node bending stiffness forces the surrounding segments forces are accumulated

Parameters
lThe Moordyn line
iThe node index
tThe output node force
Returns
MOORDYN_INVALID_VALUE if a NULL line is provided or if the node index is bigger than the number of segments, MOORDYN_SUCCESS otherwise
Here is the call graph for this function:

◆ MoorDyn_GetLineNodeCurv()

int DECLDIR MoorDyn_GetLineNodeCurv ( MoorDynLine  l,
unsigned int  i,
double *  c 
)

Get a line curvature at a node.

Parameters
lThe Moordyn line
iThe node index
cThe output line curvature
Returns
MOORDYN_INVALID_VALUE if a NULL line is provided or if the node index is bigger than the number of segments, MOORDYN_SUCCESS otherwise
Note
The curvature is only computed if bending stiffness (moordyn::Line::EI) is not zero. Otherwise the curvature of every single node will be zero.

◆ MoorDyn_GetLineNodeDrag()

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

\[ \bar{D}(i) = \frac{1}{2} l_0 F(i) \rho_w \left( Cd_t \pi d \vert \bar{v}_t(i) \vert \bar{v}_t(i) + Cd_n d \vert \bar{v}_n(i) \vert \bar{v}_n(i) \right) \]

with $l_0$ the unstretched segment length, $F(i)$ the portion of the segment submerged, $\rho_w$ the water density, $d$ the line diameter, $Cd_t$ and $Cd_n$ the normal and tangential drag coefficients, and $\bar{v}_t$ and $\bar{v}_n$ the tangential and normal velocities:

\[ \bar{v}_t = (\bar{v} - \bar{U}) \cdot \bar{q} \]

\[ \bar{v}_n = (\bar{v} - \bar{U}) - \bar{v}_t \]

with $\bar{v}$ the velocity, $\bar{U}$ the flow velocity and $\bar{q}$ 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.

Parameters
lThe Moordyn line
iThe node index
fThe output node force
Returns
MOORDYN_INVALID_VALUE if a NULL line is provided or if the node index is bigger than the number of segments, MOORDYN_SUCCESS otherwise
Here is the call graph for this function:

◆ MoorDyn_GetLineNodeForce()

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()

Note
The net force is not the sum of all the components that you cat extract from the API. For instance, the tension contribution on the internal nodes is the difference between the tensions of the adjacent segments, while MoorDyn_GetLineNodeTen() is returning the averaged value.
Parameters
lThe Moordyn line
iThe node index
fThe output node net force
Returns
MOORDYN_INVALID_VALUE if a NULL line is provided or if the node index is bigger than the number of segments, MOORDYN_SUCCESS otherwise
Here is the call graph for this function:

◆ MoorDyn_GetLineNodeFroudeKrilov()

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

\[ \bar{Fk}(i) = V(i) F(i) \rho_w \left( (1 + Ca_t) \frac{\mathrm{d} \bar{v}_t}{\mathrm{d} t} + (1 + Ca_n) \frac{\mathrm{d} \bar{v}_n}{\mathrm{d} t} \right) \]

with $V(i)$ the segment volume, $F(i)$ the portion of the segment submerged, $\rho_w$ the water density, $Cd_t$ and $Cd_n$ the normal and tangential drag coefficients, and $\frac{\mathrm{d} \bar{v}_t}{\mathrm{d} t}$ and $\frac{\mathrm{d} \bar{v}_n}{\mathrm{d} t}$ the tangential and normal accelerations:

\[ \frac{\mathrm{d} \bar{v}_t}{\mathrm{d} t} = \frac{\mathrm{d} \bar{v}}{\mathrm{d} t} \cdot \bar{q}(i) \]

\[ \frac{\mathrm{d} \bar{v}_n}{\mathrm{d} t} = \frac{\mathrm{d} \bar{v}}{\mathrm{d} t} - \frac{\mathrm{d} \bar{v}_t}{\mathrm{d} t} \]

with $\bar{q}(i)$ 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.

Parameters
lThe Moordyn line
iThe node index
fThe output node force
Returns
MOORDYN_INVALID_VALUE if a NULL line is provided or if the node index is bigger than the number of segments, MOORDYN_SUCCESS otherwise
Here is the call graph for this function:

◆ MoorDyn_GetLineNodeM()

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

Parameters
lThe Moordyn line
iThe node index
mThe output mass matrix
Returns
MOORDYN_INVALID_VALUE if a NULL line is provided or if the node index is bigger than the number of segments, MOORDYN_SUCCESS otherwise
Here is the call graph for this function:

◆ MoorDyn_GetLineNodePos()

int DECLDIR MoorDyn_GetLineNodePos ( MoorDynLine  l,
unsigned int  i,
double  pos[3] 
)

Get a line node position.

Parameters
lThe Moordyn line
iThe node index
posThe output node position
Returns
MOORDYN_INVALID_VALUE if a NULL line is provided or if the node index is bigger than the number of segments, MOORDYN_SUCCESS otherwise
Here is the call graph for this function:

◆ MoorDyn_GetLineNodeSeabedForce()

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

\[ \bar{B}(i) = l_0 d \left( Kb (\bar{r}_b - \bar{r}(i)) \cdot \bar{k} Cb \bar{v} \cdot \bar{k} + \right) \bar{k} \]

with $l_0$ the unstretched segment length, $d$ the line diameter $Kb$ and $Cb$ the bottom stiff and drag coefficients, $\bar{r}_b$ the seabed position, $\bar{r}$ the position, $\bar{v}$ the velocity and $\bar{k}$ 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.

Parameters
lThe Moordyn line
iThe node index
fThe output node force
Returns
MOORDYN_INVALID_VALUE if a NULL line is provided or if the node index is bigger than the number of segments, MOORDYN_SUCCESS otherwise
Here is the call graph for this function:

◆ MoorDyn_GetLineNodeTen()

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

\[ \bar{T}(i) = E A \left( \frac{l(i) - l_0}{l_0} - \frac{\beta A}{l_0} \frac{\mathrm{d}l(i)}{\mathrm{d}t} \right) \bar{q}(i) \]

with $l(i)$ and $l_0$ the stretched and unstretched segment lengths respectively, $E$ the Young's modulus, $A$ the transversal area, $\beta$ the internal damping coefficient and $\bar{q}(i)$ 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)

Parameters
lThe Moordyn line
iThe node index
tThe output node tension
Returns
MOORDYN_INVALID_VALUE if a NULL line is provided or if the node index is bigger than the number of segments, MOORDYN_SUCCESS otherwise
Here is the call graph for this function:

◆ MoorDyn_GetLineNodeVel()

int DECLDIR MoorDyn_GetLineNodeVel ( MoorDynLine  l,
unsigned int  i,
double  vel[3] 
)

Get a line node velocity.

Parameters
lThe Moordyn line
iThe node index
velThe output node velocity
Returns
MOORDYN_INVALID_VALUE if a NULL line is provided or if the node index is bigger than the number of segments, MOORDYN_SUCCESS otherwise
Here is the call graph for this function:

◆ MoorDyn_GetLineNodeWeight()

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

\[ \bar{W}(i) = A l_0 \left(\rho - F(i) \rho_w \right) \bar{g} \]

with $l_0$ the unstretched segment length, $A$ the transversal area, $\rho$ the line material density, $\rho_w$ the water density, $F(i)$ the portion of the segment submerged and $\bar{g}$ 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.

Parameters
lThe Moordyn line
iThe node index
fThe output node force
Returns
MOORDYN_INVALID_VALUE if a NULL line is provided or if the node index is bigger than the number of segments, MOORDYN_SUCCESS otherwise
Here is the call graph for this function:

◆ MoorDyn_GetLineNumberNodes()

int DECLDIR MoorDyn_GetLineNumberNodes ( MoorDynLine  l,
unsigned int *  n 
)

Get the line number of nodes.

Parameters
lThe Moordyn line
nThe output number of nodes
Returns
MOORDYN_INVALID_VALUE if a NULL line is provided, MOORDYN_SUCCESS otherwise
See also
MoorDyn_GetLineN()
Here is the call graph for this function:

◆ MoorDyn_GetLineUnstretchedLength()

int DECLDIR MoorDyn_GetLineUnstretchedLength ( MoorDynLine  l,
double *  ul 
)

Get the line unstretched length.

Parameters
lThe Moordyn line
ulThe output length
Returns
MOORDYN_INVALID_VALUE if a NULL line is provided, MOORDYN_SUCCESS otherwise
See also
MoorDyn_SetLineUnstretchedLength()

◆ MoorDyn_GetNumberBodies()

int DECLDIR MoorDyn_GetNumberBodies ( MoorDyn  system,
unsigned int *  n 
)

Get the number of bodies.

Remember that the first body index is 1

Parameters
systemThe Moordyn system
nThe output number of bodies
Returns
MOORDYN_SUCESS If the number is successfully got, an error code otherwise (see Errors reported by MoorDyn)

◆ MoorDyn_GetNumberLines()

int DECLDIR MoorDyn_GetNumberLines ( MoorDyn  system,
unsigned int *  n 
)

Get the number of lines.

Remember that the first line index is 1

Parameters
systemThe Moordyn system
nThe output number of lines
Returns
MOORDYN_SUCESS If the number is successfully got, an error code otherwise (see Errors reported by MoorDyn)

◆ MoorDyn_GetNumberPoints()

int DECLDIR MoorDyn_GetNumberPoints ( MoorDyn  system,
unsigned int *  n 
)

Get the number of points.

Remember that the first point index is 1

Parameters
systemThe Moordyn system
nThe output number of points
Returns
MOORDYN_SUCESS If the number is successfully got, an error code otherwise (see Errors reported by MoorDyn)

◆ MoorDyn_GetNumberRods()

int DECLDIR MoorDyn_GetNumberRods ( MoorDyn  system,
unsigned int *  n 
)

Get the number of rods.

Remember that the first rod index is 1

Parameters
systemThe Moordyn system
nThe output number of rods
Returns
MOORDYN_SUCESS If the number is successfully got, an error code otherwise (see Errors reported by MoorDyn)

◆ MoorDyn_GetPoint()

MoorDynPoint DECLDIR MoorDyn_GetPoint ( MoorDyn  system,
unsigned int  c 
)

Get a point.

Parameters
systemThe Moordyn system
cThe point
Returns
The point instance, NULL if errors happened

◆ MoorDyn_GetPointAttached()

int DECLDIR MoorDyn_GetPointAttached ( MoorDynPoint  point,
unsigned int  i,
MoorDynLine l,
int *  e 
)

Get the number of connected lines.

Parameters
pointThe Moordyn point
iThe index of the attached line
lThe output attached line
eThe output endpoint, see moordyn::EndPoints
Returns
MOORDYN_SUCCESS If the data is correctly set, an error code otherwise (see Errors reported by MoorDyn)

◆ MoorDyn_GetPointForce()

int DECLDIR MoorDyn_GetPointForce ( MoorDynPoint  point,
double  f[3] 
)

Get the force at a point.

Parameters
pointThe Moordyn point
fThe output force
Returns
MOORDYN_SUCCESS If the data is correctly set, an error code otherwise (see Errors reported by MoorDyn)
Here is the call graph for this function:

◆ MoorDyn_GetPointID()

int DECLDIR MoorDyn_GetPointID ( MoorDynPoint  point,
int *  id 
)

Get the point identifier.

Parameters
pointThe Moordyn point
idThe output id
Returns
MOORDYN_INVALID_VALUE if a NULL point is provided, MOORDYN_SUCCESS otherwise

◆ MoorDyn_GetPointM()

int DECLDIR MoorDyn_GetPointM ( MoorDynPoint  point,
double  m[3][3] 
)

Get the point mass matrix.

Parameters
pointThe Moordyn point
fThe output force
Returns
MOORDYN_SUCCESS If the data is correctly set, an error code otherwise (see Errors reported by MoorDyn)
Here is the call graph for this function:

◆ MoorDyn_GetPointNAttached()

int DECLDIR MoorDyn_GetPointNAttached ( MoorDynPoint  point,
unsigned int *  n 
)

Get the number of connected lines.

Parameters
pointThe Moordyn point
nThe output number of connected lines
Returns
MOORDYN_SUCCESS If the data is correctly set, an error code otherwise (see Errors reported by MoorDyn)

◆ MoorDyn_GetPointPos()

int DECLDIR MoorDyn_GetPointPos ( MoorDynPoint  point,
double  pos[3] 
)

Get the position of a point.

Parameters
pointThe Moordyn point
posThe output position
Returns
MOORDYN_SUCCESS If the data is correctly set, an error code otherwise (see Errors reported by MoorDyn)
Here is the call graph for this function:

◆ MoorDyn_GetPointType()

int DECLDIR MoorDyn_GetPointType ( MoorDynPoint  point,
int *  t 
)

Get the point type.

Parameters
pointThe Moordyn point
tThe output type
Returns
MOORDYN_INVALID_VALUE if a NULL point is provided, MOORDYN_SUCCESS otherwise
See also
Point::types

◆ MoorDyn_GetPointVel()

int DECLDIR MoorDyn_GetPointVel ( MoorDynPoint  point,
double  v[3] 
)

Get the velocity of a point.

Parameters
pointThe Moordyn point
vThe output velocity
Returns
MOORDYN_SUCCESS If the data is correctly set, an error code otherwise (see Errors reported by MoorDyn)
Here is the call graph for this function:

◆ MoorDyn_GetRod()

MoorDynRod DECLDIR MoorDyn_GetRod ( MoorDyn  system,
unsigned int  r 
)

Get a rod.

Parameters
systemThe Moordyn system
rThe rod
Returns
The rod instance, NULL if errors happened

◆ MoorDyn_GetRodForce()

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.

Parameters
lThe Moordyn rod
fThe output force
Returns
MOORDYN_INVALID_VALUE if a NULL point is provided, MOORDYN_SUCCESS otherwise
Here is the call graph for this function:

◆ MoorDyn_GetRodID()

int DECLDIR MoorDyn_GetRodID ( MoorDynRod  l,
int *  id 
)

Get the line identifier.

Parameters
lThe Moordyn rod
idThe output id
Returns
MOORDYN_INVALID_VALUE if a NULL point is provided, MOORDYN_SUCCESS otherwise

◆ MoorDyn_GetRodM()

int DECLDIR MoorDyn_GetRodM ( MoorDynRod  l,
double  m[6][6] 
)

Get the total rod mass matrix.

Parameters
lThe Moordyn rod
mThe output mass matrix
Returns
MOORDYN_INVALID_VALUE if a NULL point is provided, MOORDYN_SUCCESS otherwise
Here is the call graph for this function:

◆ MoorDyn_GetRodN()

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

Parameters
lThe Moordyn rod
nThe output number of nodes
Returns
MOORDYN_INVALID_VALUE if a NULL line is provided, MOORDYN_SUCCESS otherwise
Here is the caller graph for this function:

◆ MoorDyn_GetRodNodePos()

int DECLDIR MoorDyn_GetRodNodePos ( MoorDynRod  l,
unsigned int  i,
double  pos[3] 
)

Get a rod node position.

Parameters
lThe Moordyn rod
iThe node index
posThe output node position
Returns
MOORDYN_INVALID_VALUE if a NULL line is provided or if the node index is bigger than the number of segments, MOORDYN_SUCCESS otherwise
Here is the call graph for this function:

◆ MoorDyn_GetRodNodeVel()

int DECLDIR MoorDyn_GetRodNodeVel ( MoorDynRod  l,
unsigned int  i,
double  vel[3] 
)

Get a rod node velocity.

Parameters
lThe Moordyn rod
iThe node index
velThe output node velocity
Returns
MOORDYN_INVALID_VALUE if a NULL line is provided or if the node index is bigger than the number of segments, MOORDYN_SUCCESS otherwise
Here is the call graph for this function:

◆ MoorDyn_GetRodNumberNodes()

int DECLDIR MoorDyn_GetRodNumberNodes ( MoorDynRod  l,
unsigned int *  n 
)

Get the line number of nodes.

Parameters
lThe Moordyn rod
nThe output number of nodes
Returns
MOORDYN_INVALID_VALUE if a NULL line is provided, MOORDYN_SUCCESS otherwise
See also
MoorDyn_GetRodN()
Here is the call graph for this function:

◆ MoorDyn_GetRodType()

int DECLDIR MoorDyn_GetRodType ( MoorDynRod  l,
int *  t 
)

Get the line type.

Parameters
lThe Moordyn rod
tThe output type
Returns
MOORDYN_INVALID_VALUE if a NULL point is provided, MOORDYN_SUCCESS otherwise

◆ MoorDyn_GetSeafloor()

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.

Parameters
systemThe Moordyn system
Returns
The Seafloor instance, NULL if errors happened or there is no 3D seafloor

◆ MoorDyn_GetTimeScheme()

int DECLDIR MoorDyn_GetTimeScheme ( MoorDyn  system,
char *  name,
size_t *  name_len 
)

Get the current time scheme name.

Parameters
systemThe Moordyn system
nameThe output name. Can be NULL.
name_lenThe output number of bytes written. Can be NULL.
Returns
MOORDYN_SUCESS if the data is correctly got, an error code otherwise (see Errors reported by MoorDyn)

◆ MoorDyn_GetWaveKinCoordinates()

int DECLDIR DEPRECATED MoorDyn_GetWaveKinCoordinates ( MoorDyn  system,
double *  r 
)
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

Parameters
systemThe Moordyn system
rThe output coordinates (3 components per point)
Returns
MOORDYN_SUCESS If the data is correctly set, an error code otherwise (see Errors reported by MoorDyn)
Deprecated:
This function has been renamed as MoorDyn_ExternalWaveKinGetCoordinates()
See also
MoorDyn_ExternalWaveKinInit()
Here is the call graph for this function:

◆ MoorDyn_GetWaves()

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.

Parameters
systemThe Moordyn system
Returns
The waves instance, NULL if errors happened

◆ MoorDyn_GetWavesKin()

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.

Parameters
wavesThe Waves instance
xThe point x coordinate
yThe point y coordinate
zThe point z coordinate
UThe output velocity
UdThe output acceleration
zetaThe output wave height
PDynThe output dynamic pressure
seafloorThe seafloor instance, see MoorDyn_GetSeafloor()
Returns
0 If the data is correctly set, an error code otherwise (see Errors reported by MoorDyn)
Here is the call graph for this function:

◆ MoorDyn_Init()

int DECLDIR MoorDyn_Init ( MoorDyn  system,
const double *  x,
const double *  xd 
)

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

Parameters
systemThe Moordyn system
xPosition vector (6 components per coupled body or cantilevered rod and 3 components per pinned rod or coupled point)
xdVelocity vector (6 components per coupled body or cantilevered rod and 3 components per pinned rod or coupled point)
Returns
MOORDYN_SUCESS If the mooring system is correctly initialized, an error code otherwise (see Errors reported by MoorDyn)
Note
MoorDyn_NCoupledDOF() can be used to know the number of components required for x and xd

◆ MoorDyn_Init_NoIC()

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.

This is of use when you are loading a state file afterwards with Moordyn_Load()

Parameters
systemThe Moordyn system
xPosition vector (6 components per coupled body or cantilevered rod and 3 components per pinned rod or coupled point)
xdVelocity vector (6 components per coupled body or cantilevered rod and 3 components per pinned rod or coupled point)
Returns
MOORDYN_SUCESS If the mooring system is correctly initialized, an error code otherwise (see Errors reported by MoorDyn)
Note
MoorDyn_NCoupledDOF() can be used to know the number of components required for x and xd

◆ MoorDyn_IsLineConstantEA()

int DECLDIR MoorDyn_IsLineConstantEA ( MoorDynLine  l,
int *  b 
)

Get whether the line is governed by a non-linear stiffness or a constant one.

Parameters
lThe Moordyn line
b1 if the stiffness of the line is constant, 0 if a non-linear stiffness has been set
Returns
MOORDYN_INVALID_VALUE if a NULL line is provided, MOORDYN_SUCCESS otherwise
See also
MoorDyn_GetLineConstantEA()
MoorDyn_SetLineConstantEA()

◆ MoorDyn_IsLinePressBend()

int DECLDIR MoorDyn_IsLinePressBend ( MoorDynLine  l,
int *  b 
)

Get whether the line pressure bending is considered or not.

Parameters
lThe Moordyn line
b1 if the pressure bending of the line is enabled, 0 otherwise
Returns
MOORDYN_INVALID_VALUE if a NULL line is provided, MOORDYN_SUCCESS otherwise
See also
MoorDyn_SetLinePressBend()
MoorDyn_SetLinePressInt()

◆ MoorDyn_Load()

int DECLDIR MoorDyn_Load ( MoorDyn  system,
const char *  filepath 
)

Load the system saved before.

You must still call MoorDyn_Create() and MoorDyn_Init_NoIC() before calling this function

Parameters
systemThe Moordyn system
filepathThe path of the MoorDyn saved system
Returns
MOORDYN_SUCESS If the data is correctly set, an error code otherwise (see Errors reported by MoorDyn)
See also
MoorDyn_Save
MoorDyn_Init_NoIC

◆ MoorDyn_LoadState()

int DECLDIR MoorDyn_LoadState ( MoorDyn  system,
const char *  filepath 
)

Load and set a system state.

The system state contains the system position and velocity.

Parameters
systemThe Moordyn system
filepathThe path of the MoorDyn saved system
Returns
MOORDYN_SUCESS If the data is correctly set, an error code otherwise (see Errors reported by MoorDyn)
See also
MoorDyn_SaveState
MoorDyn_Init_NoIC
Note
This function can be used to load the state exported by MoorPy

◆ MoorDyn_Log()

int DECLDIR MoorDyn_Log ( MoorDyn  system,
int  level,
const char *  msg 
)

Log a message.

Parameters
systemThe Moordyn system
levelThe message level. It can take the following values
  • MOORDYN_DBG_LEVEL for debugging messages
  • MOORDYN_MSG_LEVEL for regular information messages
  • MOORDYN_WRN_LEVEL for warnings
  • MOORDYN_ERR_LEVEL for errors
msgThe message to log
Returns
MOORDYN_SUCESS If the printing level is correctly set, an error code otherwise (see Errors reported by MoorDyn)
Note
This messages are subjected to the same rules than the inner messages, i.e. if 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
This function will not log the file, line and function where it is called from, not even in case of warnings or errors

◆ MoorDyn_NCoupledDOF()

int DECLDIR MoorDyn_NCoupledDOF ( MoorDyn  system,
unsigned int *  n 
)

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

Returns
MOORDYN_INVALID_VALUE if system is NULL, MOORDYN_SUCESS otherwise

◆ MoorDyn_Save()

int DECLDIR MoorDyn_Save ( MoorDyn  system,
const char *  filepath 
)

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()

Parameters
systemThe Moordyn system
filepathThe path of the file to write
Returns
MOORDYN_SUCESS If the data is correctly set, an error code otherwise (see Errors reported by MoorDyn)
See also
MoorDyn_Load
MoorDyn_Init_NoIC

◆ MoorDyn_SaveBodyVTK()

int DECLDIR MoorDyn_SaveBodyVTK ( MoorDynBody  b,
const char *  filename 
)

Save the point to a VTK (.vtu) file.

Parameters
bThe Moordyn body
filenameThe output maximum tension module
Returns
MOORDYN_SUCCESS if the file is correctly written, an error code otherwise
Note
If MoorDyn has been built without VTK support, this function will return a MOORDYN_NON_IMPLEMENTED error, but it will be still available anyway

◆ MoorDyn_SaveLineVTK()

int DECLDIR MoorDyn_SaveLineVTK ( MoorDynLine  l,
const char *  filename 
)

Save the line to a VTK (.vtu) file.

Parameters
lThe Moordyn line
filenameThe output maximum tension module
Returns
MOORDYN_SUCCESS if the file is correctly written, an error code otherwise
Note
If MoorDyn has been built without VTK support, this function will return a MOORDYN_NON_IMPLEMENTED error, but it will be still available anyway

◆ MoorDyn_SavePointVTK()

int DECLDIR MoorDyn_SavePointVTK ( MoorDynPoint  point,
const char *  filename 
)

Save the point to a VTK (.vtu) file.

Parameters
pointThe Moordyn point
filenameThe output maximum tension module
Returns
MOORDYN_SUCCESS if the file is correctly written, an error code otherwise
Note
If MoorDyn has been built without VTK support, this function will return a MOORDYN_NON_IMPLEMENTED error, but it will be still available anyway

◆ MoorDyn_SaveRodVTK()

int DECLDIR MoorDyn_SaveRodVTK ( MoorDynRod  l,
const char *  filename 
)

Save the line to a VTK (.vtu) file.

Parameters
lThe Moordyn rod
filenameThe output maximum tension module
Returns
MOORDYN_SUCCESS if the file is correctly written, an error code otherwise
Note
If MoorDyn has been built without VTK support, this function will return a MOORDYN_NON_IMPLEMENTED error, but it will be still available anyway

◆ MoorDyn_SaveState()

int DECLDIR MoorDyn_SaveState ( MoorDyn  system,
const char *  filepath 
)

Save the system state, so it can be loaded afterwards.

The system state contains the system position and velocity.

Parameters
systemThe Moordyn system
filepathThe path of the file to write
Returns
MOORDYN_SUCESS If the data is correctly set, an error code otherwise (see Errors reported by MoorDyn)
See also
MoorDyn_LoadState
MoorDyn_Init_NoIC
Note
This function can be used to load the state exported by MoorPy

◆ MoorDyn_SaveVTK()

int DECLDIR MoorDyn_SaveVTK ( MoorDyn  system,
const char *  filename 
)

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

Parameters
systemThe Moordyn system
filenameThe output maximum tension module
Returns
MOORDYN_SUCCESS if the file is correctly written, an error code otherwise
Note
If MoorDyn has been built without VTK support, this function will return a MOORDYN_NON_IMPLEMENTED error, but it will be still available anyway

◆ MoorDyn_Serialize()

int DECLDIR MoorDyn_Serialize ( MoorDyn  system,
size_t *  size,
uint64_t *  data 
)

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()

Parameters
systemThe Moordyn system
sizeOutput size of the bytes array. It can be null
dataAllocated memory for the output bytes array. It can be null
Returns
MOORDYN_SUCESS If the data is correctly set, an error code otherwise (see Errors reported by MoorDyn)

◆ MoorDyn_SetCFL()

int DECLDIR MoorDyn_SetCFL ( MoorDyn  system,
double  cfl 
)

Set the model Courant–Friedrichs–Lewy factor.

Parameters
systemThe Moordyn system
cflThe new Courant–Friedrichs–Lewy factor
Returns
MOORDYN_SUCESS if the data is correctly set, an error code otherwise (see Errors reported by MoorDyn)

◆ MoorDyn_SetDt()

int DECLDIR MoorDyn_SetDt ( MoorDyn  system,
double  dt 
)

Set the model time step.

Parameters
systemThe Moordyn system
dtThe new time step
Returns
MOORDYN_SUCESS if the data is correctly set, an error code otherwise (see Errors reported by MoorDyn)

◆ MoorDyn_SetLineConstantEA()

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

Parameters
lThe Moordyn line
EAThe constant axial stiffness EA value [N]
Returns
MOORDYN_INVALID_VALUE if a NULL line is provided, MOORDYN_SUCCESS otherwise
See also
MoorDyn_IsLineConstantEA()
MoorDyn_GetLineConstantEA()

◆ MoorDyn_SetLinePressBend()

int DECLDIR MoorDyn_SetLinePressBend ( MoorDynLine  l,
int  b 
)

Set whether the line pressure bending is considered or not.

Parameters
lThe Moordyn line
b1 if the pressure bending of the line shall be considered, 0 otherwise
Returns
MOORDYN_INVALID_VALUE if a NULL line is provided, MOORDYN_SUCCESS otherwise
See also
MoorDyn_IsLinePressBend()
MoorDyn_SetLinePressInt()

◆ MoorDyn_SetLinePressInt()

int DECLDIR MoorDyn_SetLinePressInt ( MoorDynLine  l,
const double *  p 
)

Set the line internal pressure values at the nodes.

Parameters
lThe Moordyn line
pPressure values, and array with MoorDyn_GetLineN() + 1 values
Returns
MOORDYN_INVALID_VALUE if a NULL line is provided, MOORDYN_SUCCESS otherwise
See also
MoorDyn_IsLinePressBend()
MoorDyn_SetLinePressBend()

◆ MoorDyn_SetLineUnstretchedLength()

int DECLDIR MoorDyn_SetLineUnstretchedLength ( MoorDynLine  l,
double  ul 
)

Set the line unstretched length.

Parameters
lThe Moordyn line
ulThe new length
Returns
MOORDYN_INVALID_VALUE if a NULL line is provided, MOORDYN_SUCCESS otherwise
See also
MoorDyn_GetLineUnstretchedLength()

◆ MoorDyn_SetLineUnstretchedLengthVel()

int DECLDIR MoorDyn_SetLineUnstretchedLengthVel ( MoorDynLine  l,
double  v 
)

Set the line unstretched length rate of change.

Parameters
lThe Moordyn line
vThe rate of change
Returns
MOORDYN_INVALID_VALUE if a NULL line is provided, MOORDYN_SUCCESS otherwise
See also
MoorDyn_GetLineUnstretchedLength()
MoorDyn_SetLineUnstretchedLength()

◆ MoorDyn_SetLogFile()

int DECLDIR MoorDyn_SetLogFile ( MoorDyn  system,
const char *  log_path 
)

Set the instance log file.

Parameters
systemThe Moordyn system
log_pathThe file path to print the log file
Returns
MOORDYN_SUCESS If the log file is correctly set, an error code otherwise (see Errors reported by MoorDyn)

◆ MoorDyn_SetLogLevel()

int DECLDIR MoorDyn_SetLogLevel ( MoorDyn  system,
int  verbosity 
)

Set the instance log file printing level.

Parameters
systemThe Moordyn system
verbosityThe log file print level. It can take the following values
  • MOORDYN_DBG_LEVEL Every single message will be printed
  • MOORDYN_MSG_LEVEL Messages specially designed to help debugging the code will be omitted
  • MOORDYN_WRN_LEVEL Just errors and warnings will be reported
  • MOORDYN_ERR_LEVEL Just errors will be reported
  • MOORDYN_NO_OUTPUT No info will be reported
Returns
MOORDYN_SUCESS If the printing level is correctly set, an error code otherwise (see Errors reported by MoorDyn)

◆ MoorDyn_SetTimeScheme()

int DECLDIR MoorDyn_SetTimeScheme ( MoorDyn  system,
const char *  name 
)

Set the time scheme by its name.

Parameters
systemThe Moordyn system
nameThe new time scheme name.
Returns
MOORDYN_SUCESS if the data is correctly got, an error code otherwise (see Errors reported by MoorDyn)
Here is the call graph for this function:

◆ MoorDyn_SetVerbosity()

int DECLDIR MoorDyn_SetVerbosity ( MoorDyn  system,
int  verbosity 
)

Set the instance verbosity level.

Parameters
systemThe Moordyn system
verbosityThe verbosity level. It can take the following values
  • MOORDYN_DBG_LEVEL Every single message will be printed
  • MOORDYN_MSG_LEVEL Messages specially designed to help debugging the code will be omitted
  • MOORDYN_WRN_LEVEL Just errors and warnings will be reported
  • MOORDYN_ERR_LEVEL Just errors will be reported
  • MOORDYN_NO_OUTPUT No info will be reported
Returns
MOORDYN_SUCESS If the verbosity level is correctly set, an error code otherwise (see Errors reported by MoorDyn)

◆ MoorDyn_SetWaveKin()

int DECLDIR DEPRECATED MoorDyn_SetWaveKin ( MoorDyn  system,
const double *  U,
const double *  Ud,
double  t 
)
inline

Set the kinematics of the waves.

Use this function if WaveKin option is set to 1 in the input file

Parameters
systemThe Moordyn system
UThe velocities at the points (3 components per point)
UdThe accelerations at the points (3 components per point)
tSimulation time
Returns
MOORDYN_SUCESS If the data is correctly set, an error code otherwise (see Errors reported by MoorDyn)
Deprecated:
This function has been renamed as MoorDyn_ExternalWaveKinSet()
See also
MoorDyn_ExternalWaveKinInit()
MoorDyn_ExternalWaveKinGetCoordinates()
Here is the call graph for this function:

◆ MoorDyn_Step()

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.

Parameters
systemThe Moordyn system
xPosition vector
xdVelocity vector
fOutput forces
tSimulation time
dtTime step
Returns
MOORDYN_SUCESS if the mooring system has correctly evolved, an error code otherwise (see Errors reported by MoorDyn)
Note
MoorDyn_NCoupledDOF() can be used to know the number of components required for x, xd and f
Here is the caller graph for this function:

◆ WaveNumber()

double DECLDIR WaveNumber ( double  Omega,
double  g,
double  h 
)

Compute the wave number.

Parameters
OmegaThe wave angular frequency
gThe gravity acceleration
hThe water depth
Returns
The wave number
Note
credit: FAST source