Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
218 changes: 115 additions & 103 deletions MoorDyn.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,109 +48,121 @@ extern "C"
{
#endif

/** @defgroup old_c_api The old API
*
* The old API is based on a singleton, i.e. just one MoorDyn instance can
* be hold per process
* @{
*/

/** @brief initializes MoorDyn
*
* Including reading the input file, creating the mooring system data
* structures, and calculating the initial conditions
*
* @param x Position vector (6 components per coupled body or cantilevered
* rod and 3 components per pinned rod or coupled point)
* @param xd Velocity vector (6 components per coupled body or cantilevered
* rod and 3 components per pinned rod or coupled point)
* @param infilename The input file, if either NULL or "", then
* "Mooring/lines.txt" will be considered
* @return 0 If the mooring system is correctly initialized, an error code
* otherwise (see @ref moordyn_errors)
* @warning Just one instance of MoorDyn per process is allowed. Thus, if
* several mooring systems shall be handled, please spawn additional
* processes
*/
int DECLDIR MoorDynInit(const double x[],
const double xd[],
const char* infilename);

/** @brief Runs a time step of the MoorDyn system
* @param x Position vector (6 components per coupled body or cantilevered
* rod and 3 components per pinned rod or coupled point)
* @param xd Velocity vector (6 components per coupled body or cantilevered
* rod and 3 components per pinned rod or coupled point)
* @param f Output forces (6 components per coupled body or cantilevered rod
* and 3 components per pinned rod or coupled point)
* @param t Simulation time
* @param dt Time step
* @return 0 if the mooring system has correctly evolved, an error code
* otherwise (see @ref moordyn_errors)
* @see MoorDynInit
*/
int DECLDIR MoorDynStep(const double x[],
const double xd[],
double f[],
double* t,
double* dt);

/** @brief Releases MoorDyn allocated resources
* @return 0 If the mooring system is correctly destroyed, an error code
* otherwise (see @ref moordyn_errors)
* @note Call this function even if the initialization failed
*/
int DECLDIR MoorDynClose(void);

/** @brief 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()
* @return The number of points where the wave kinematics shall be provided.
* 0 if errors are detected
*/
int DECLDIR externalWaveKinInit();

/** @brief Get the points where the waves kinematics shall be provided
* @param r_out The output coordinates (3 components per point)
* @see externalWaveKinInit()
*/
void DECLDIR getWaveKinCoordinates(double r_out[]);

/** @brief Set the kinematics of the waves
*
* Use this function if WaveKin option is set in the input file
* @param U_in The velocities at the points (3 components per point)
* @param Ud_in The accelerations at the points (3 components per point)
* @param t_in Simulation time
* @see externalWaveKinInit()
* @see getWaveKinCoordinates()
*/
void DECLDIR setWaveKin(const double U_in[],
const double Ud_in[],
double t_in);

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]);

// AllOutput has been commented out to reduce warnings,
// it is now automatically called in V2 by MoorDynStep.
// NOTE: THIS IS NOT REMOVED IN MAIN THE MD-C V1 API WRAPPER.
// MD-C 2.8.3 will resolve this issue more properly.
// int AllOutput(double, double);

/**
* @}
*/
/** @defgroup old_c_api The old API
*
* The old API is based on a singleton, i.e. just one MoorDyn instance can
* be hold per process
* @{
*/

/** @brief initializes MoorDyn
*
* Including reading the input file, creating the mooring system data
* structures, and calculating the initial conditions
*
* @param x Position vector (6 components per coupled body or cantilevered
* rod and 3 components per pinned rod or coupled point)
* @param xd Velocity vector (6 components per coupled body or cantilevered
* rod and 3 components per pinned rod or coupled point)
* @param infilename The input file, if either NULL or "", then
* "Mooring/lines.txt" will be considered
* @return 0 If the mooring system is correctly initialized, an error code
* otherwise (see @ref moordyn_errors)
* @warning Just one instance of MoorDyn per process is allowed. Thus, if
* several mooring systems shall be handled, please spawn additional
* processes
*/
int DECLDIR
MoorDynInit(const double x[], const double xd[], const char* infilename);

/** @brief Runs a time step of the MoorDyn system
* @param x Position vector (6 components per coupled body or cantilevered
* rod and 3 components per pinned rod or coupled point)
* @param xd Velocity vector (6 components per coupled body or cantilevered
* rod and 3 components per pinned rod or coupled point)
* @param f Output forces (6 components per coupled body or cantilevered rod
* and 3 components per pinned rod or coupled point)
* @param t Simulation time
* @param dt Time step
* @return 0 if the mooring system has correctly evolved, an error code
* otherwise (see @ref moordyn_errors)
* @see MoorDynInit
*/
int DECLDIR
MoorDynStep(const double x[],
const double xd[],
double f[],
double* t,
double* dt);

/** @brief Releases MoorDyn allocated resources
* @return 0 If the mooring system is correctly destroyed, an error code
* otherwise (see @ref moordyn_errors)
* @note Call this function even if the initialization failed
*/
int DECLDIR
MoorDynClose(void);

/** @brief 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()
* @return The number of points where the wave kinematics shall be provided.
* 0 if errors are detected
*/
int DECLDIR
externalWaveKinInit();

/** @brief Get the points where the waves kinematics shall be provided
* @param r_out The output coordinates (3 components per point)
* @see externalWaveKinInit()
*/
void DECLDIR
getWaveKinCoordinates(double r_out[]);

/** @brief Set the kinematics of the waves
*
* Use this function if WaveKin option is set in the input file
* @param U_in The velocities at the points (3 components per point)
* @param Ud_in The accelerations at the points (3 components per point)
* @param t_in Simulation time
* @see externalWaveKinInit()
* @see getWaveKinCoordinates()
*/
void DECLDIR
setWaveKin(const double U_in[], const double Ud_in[], double t_in);

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

/** @brief Set the variable to disable the console window.
*
* Use this function to control display of the console window popup.
* @param disable Set disable to 1 to disable the console window.
*/
void DECLDIR
SetDisableConsole(int disable);

/**
* @}
*/

#ifdef __cplusplus
}
Expand Down
Binary file modified libmoordyn.dll
Binary file not shown.
Binary file modified linux_libraries/aarch64/libmoordyn.so
Binary file not shown.
Binary file modified linux_libraries/aarch64/libmoordyn.so.2
Binary file not shown.
Binary file removed linux_libraries/aarch64/libmoordyn.so.2.4
Binary file not shown.
Binary file added linux_libraries/aarch64/libmoordyn.so.2.5
Binary file not shown.
Binary file modified linux_libraries/i686/libmoordyn.so
Binary file not shown.
Binary file modified linux_libraries/i686/libmoordyn.so.2
Binary file not shown.
Binary file removed linux_libraries/i686/libmoordyn.so.2.4
Binary file not shown.
Binary file added linux_libraries/i686/libmoordyn.so.2.5
Binary file not shown.
Binary file modified linux_libraries/ppc64le/libmoordyn.so
Binary file not shown.
Binary file modified linux_libraries/ppc64le/libmoordyn.so.2
Binary file not shown.
Binary file removed linux_libraries/ppc64le/libmoordyn.so.2.4
Binary file not shown.
Binary file added linux_libraries/ppc64le/libmoordyn.so.2.5
Binary file not shown.
Binary file modified linux_libraries/s390x/libmoordyn.so
Binary file not shown.
Binary file modified linux_libraries/s390x/libmoordyn.so.2
Binary file not shown.
Binary file removed linux_libraries/s390x/libmoordyn.so.2.4
Binary file not shown.
Binary file added linux_libraries/s390x/libmoordyn.so.2.5
Binary file not shown.
Binary file modified linux_libraries/x86_64/libmoordyn.so
Binary file not shown.
Binary file modified linux_libraries/x86_64/libmoordyn.so.2
Binary file not shown.
Binary file removed linux_libraries/x86_64/libmoordyn.so.2.4
Binary file not shown.
Binary file added linux_libraries/x86_64/libmoordyn.so.2.5
Binary file not shown.
Binary file removed mac_libraries/arm64/libmoordyn.2.4.dylib
Binary file not shown.
Binary file added mac_libraries/arm64/libmoordyn.2.5.dylib
Binary file not shown.
Binary file modified mac_libraries/arm64/libmoordyn.2.dylib
Binary file not shown.
Binary file modified mac_libraries/arm64/libmoordyn.dylib
Binary file not shown.
Binary file removed mac_libraries/x86_64/libmoordyn.2.4.dylib
Binary file not shown.
Binary file added mac_libraries/x86_64/libmoordyn.2.5.dylib
Binary file not shown.
Binary file modified mac_libraries/x86_64/libmoordyn.2.dylib
Binary file not shown.
Binary file modified mac_libraries/x86_64/libmoordyn.dylib
Binary file not shown.