MoorDyn
Functions
The old API

Functions

int DECLDIR MoorDynInit (const double x[], const double xd[], const char *infilename)
 initializes MoorDyn More...
 
int DECLDIR MoorDynStep (const double x[], const double xd[], double f[], double *t, double *dt)
 Runs a time step of the MoorDyn system. More...
 
int DECLDIR MoorDynClose (void)
 Releases MoorDyn allocated resources. More...
 
int DECLDIR externalWaveKinInit ()
 Initializes the external Wave kinetics. More...
 
void DECLDIR getWaveKinCoordinates (double r_out[])
 Get the points where the waves kinematics shall be provided. More...
 
void DECLDIR setWaveKin (const double U_in[], const double Ud_in[], double t_in)
 Set the kinematics of the waves. More...
 
double DECLDIR GetFairTen (int)
 
int DECLDIR GetFASTtens (int *numLines, float FairHTen[], float FairVTen[], float AnchHTen[], float AnchVTen[])
 
int DECLDIR GetPointPos (int l, double pos[3])
 
int DECLDIR GetPointForce (int l, double force[3])
 
int DECLDIR GetNodePos (int LineNum, int NodeNum, double pos[3])
 
void DECLDIR AllOutput (double, double)
 
void DECLDIR SetDisableConsole (int disable)
 Set the variable to disable the console window. More...
 

Detailed Description

The old API is based on a singleton, i.e. just one MoorDyn instance can be hold per process

Function Documentation

◆ externalWaveKinInit()

int DECLDIR externalWaveKinInit ( )

Initializes the external Wave kinetics.

This is useless unless WaveKin option is set in the input file. If that is the case, remember calling this function after MoorDyn_Init()

Returns
The number of points where the wave kinematics shall be provided. 0 if errors are detected
Here is the call graph for this function:

◆ getWaveKinCoordinates()

void DECLDIR getWaveKinCoordinates ( double  r_out[])

Get the points where the waves kinematics shall be provided.

Parameters
r_outThe output coordinates (3 components per point)
See also
externalWaveKinInit()
Here is the call graph for this function:

◆ MoorDynClose()

int DECLDIR MoorDynClose ( void  )

Releases MoorDyn allocated resources.

Returns
0 If the mooring system is correctly destroyed, an error code otherwise (see Errors reported by MoorDyn)
Note
Call this function even if the initialization failed
Here is the call graph for this function:

◆ MoorDynInit()

int DECLDIR MoorDynInit ( const double  x[],
const double  xd[],
const char *  infilename 
)

initializes MoorDyn

Including reading the input file, creating the mooring system data structures, and calculating the initial conditions

Parameters
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)
infilenameThe input file, if either NULL or "", then "Mooring/lines.txt" will be considered
Returns
0 If the mooring system is correctly initialized, an error code otherwise (see Errors reported by MoorDyn)
Warning
Just one instance of MoorDyn per process is allowed. Thus, if several mooring systems shall be handled, please spawn additional processes

◆ MoorDynStep()

int DECLDIR MoorDynStep ( const double  x[],
const double  xd[],
double  f[],
double *  t,
double *  dt 
)

Runs a time step of the MoorDyn system.

Parameters
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)
fOutput forces (6 components per coupled body or cantilevered rod and 3 components per pinned rod or coupled point)
tSimulation time
dtTime step
Returns
0 if the mooring system has correctly evolved, an error code otherwise (see Errors reported by MoorDyn)
See also
MoorDynInit
Here is the call graph for this function:

◆ SetDisableConsole()

void DECLDIR SetDisableConsole ( int  disable)

Set the variable to disable the console window.

Use this function to control display of the console window popup.

Parameters
disableSet disable to 1 to disable the console window.

◆ setWaveKin()

void DECLDIR setWaveKin ( const double  U_in[],
const double  Ud_in[],
double  t_in 
)

Set the kinematics of the waves.

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

Parameters
U_inThe velocities at the points (3 components per point)
Ud_inThe accelerations at the points (3 components per point)
t_inSimulation time
See also
externalWaveKinInit()
getWaveKinCoordinates()
Here is the call graph for this function: