diff --git a/MoorDyn.h b/MoorDyn.h index ab00484..d40a10c 100644 --- a/MoorDyn.h +++ b/MoorDyn.h @@ -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 } diff --git a/libmoordyn.dll b/libmoordyn.dll index c4ce5b9..c7c20c8 100644 Binary files a/libmoordyn.dll and b/libmoordyn.dll differ diff --git a/linux_libraries/aarch64/libmoordyn.so b/linux_libraries/aarch64/libmoordyn.so index 502d859..7170767 100644 Binary files a/linux_libraries/aarch64/libmoordyn.so and b/linux_libraries/aarch64/libmoordyn.so differ diff --git a/linux_libraries/aarch64/libmoordyn.so.2 b/linux_libraries/aarch64/libmoordyn.so.2 index 502d859..7170767 100644 Binary files a/linux_libraries/aarch64/libmoordyn.so.2 and b/linux_libraries/aarch64/libmoordyn.so.2 differ diff --git a/linux_libraries/aarch64/libmoordyn.so.2.4 b/linux_libraries/aarch64/libmoordyn.so.2.4 deleted file mode 100644 index 502d859..0000000 Binary files a/linux_libraries/aarch64/libmoordyn.so.2.4 and /dev/null differ diff --git a/linux_libraries/aarch64/libmoordyn.so.2.5 b/linux_libraries/aarch64/libmoordyn.so.2.5 new file mode 100644 index 0000000..7170767 Binary files /dev/null and b/linux_libraries/aarch64/libmoordyn.so.2.5 differ diff --git a/linux_libraries/i686/libmoordyn.so b/linux_libraries/i686/libmoordyn.so index 502d859..7170767 100644 Binary files a/linux_libraries/i686/libmoordyn.so and b/linux_libraries/i686/libmoordyn.so differ diff --git a/linux_libraries/i686/libmoordyn.so.2 b/linux_libraries/i686/libmoordyn.so.2 index 502d859..7170767 100644 Binary files a/linux_libraries/i686/libmoordyn.so.2 and b/linux_libraries/i686/libmoordyn.so.2 differ diff --git a/linux_libraries/i686/libmoordyn.so.2.4 b/linux_libraries/i686/libmoordyn.so.2.4 deleted file mode 100644 index 502d859..0000000 Binary files a/linux_libraries/i686/libmoordyn.so.2.4 and /dev/null differ diff --git a/linux_libraries/i686/libmoordyn.so.2.5 b/linux_libraries/i686/libmoordyn.so.2.5 new file mode 100644 index 0000000..7170767 Binary files /dev/null and b/linux_libraries/i686/libmoordyn.so.2.5 differ diff --git a/linux_libraries/ppc64le/libmoordyn.so b/linux_libraries/ppc64le/libmoordyn.so index 502d859..7170767 100644 Binary files a/linux_libraries/ppc64le/libmoordyn.so and b/linux_libraries/ppc64le/libmoordyn.so differ diff --git a/linux_libraries/ppc64le/libmoordyn.so.2 b/linux_libraries/ppc64le/libmoordyn.so.2 index 502d859..7170767 100644 Binary files a/linux_libraries/ppc64le/libmoordyn.so.2 and b/linux_libraries/ppc64le/libmoordyn.so.2 differ diff --git a/linux_libraries/ppc64le/libmoordyn.so.2.4 b/linux_libraries/ppc64le/libmoordyn.so.2.4 deleted file mode 100644 index 502d859..0000000 Binary files a/linux_libraries/ppc64le/libmoordyn.so.2.4 and /dev/null differ diff --git a/linux_libraries/ppc64le/libmoordyn.so.2.5 b/linux_libraries/ppc64le/libmoordyn.so.2.5 new file mode 100644 index 0000000..7170767 Binary files /dev/null and b/linux_libraries/ppc64le/libmoordyn.so.2.5 differ diff --git a/linux_libraries/s390x/libmoordyn.so b/linux_libraries/s390x/libmoordyn.so index 502d859..7170767 100644 Binary files a/linux_libraries/s390x/libmoordyn.so and b/linux_libraries/s390x/libmoordyn.so differ diff --git a/linux_libraries/s390x/libmoordyn.so.2 b/linux_libraries/s390x/libmoordyn.so.2 index 502d859..7170767 100644 Binary files a/linux_libraries/s390x/libmoordyn.so.2 and b/linux_libraries/s390x/libmoordyn.so.2 differ diff --git a/linux_libraries/s390x/libmoordyn.so.2.4 b/linux_libraries/s390x/libmoordyn.so.2.4 deleted file mode 100644 index 502d859..0000000 Binary files a/linux_libraries/s390x/libmoordyn.so.2.4 and /dev/null differ diff --git a/linux_libraries/s390x/libmoordyn.so.2.5 b/linux_libraries/s390x/libmoordyn.so.2.5 new file mode 100644 index 0000000..7170767 Binary files /dev/null and b/linux_libraries/s390x/libmoordyn.so.2.5 differ diff --git a/linux_libraries/x86_64/libmoordyn.so b/linux_libraries/x86_64/libmoordyn.so index 502d859..7170767 100644 Binary files a/linux_libraries/x86_64/libmoordyn.so and b/linux_libraries/x86_64/libmoordyn.so differ diff --git a/linux_libraries/x86_64/libmoordyn.so.2 b/linux_libraries/x86_64/libmoordyn.so.2 index 502d859..7170767 100644 Binary files a/linux_libraries/x86_64/libmoordyn.so.2 and b/linux_libraries/x86_64/libmoordyn.so.2 differ diff --git a/linux_libraries/x86_64/libmoordyn.so.2.4 b/linux_libraries/x86_64/libmoordyn.so.2.4 deleted file mode 100644 index 502d859..0000000 Binary files a/linux_libraries/x86_64/libmoordyn.so.2.4 and /dev/null differ diff --git a/linux_libraries/x86_64/libmoordyn.so.2.5 b/linux_libraries/x86_64/libmoordyn.so.2.5 new file mode 100644 index 0000000..7170767 Binary files /dev/null and b/linux_libraries/x86_64/libmoordyn.so.2.5 differ diff --git a/mac_libraries/arm64/libmoordyn.2.4.dylib b/mac_libraries/arm64/libmoordyn.2.4.dylib deleted file mode 100644 index bdc1aed..0000000 Binary files a/mac_libraries/arm64/libmoordyn.2.4.dylib and /dev/null differ diff --git a/mac_libraries/arm64/libmoordyn.2.5.dylib b/mac_libraries/arm64/libmoordyn.2.5.dylib new file mode 100644 index 0000000..c4eab7c Binary files /dev/null and b/mac_libraries/arm64/libmoordyn.2.5.dylib differ diff --git a/mac_libraries/arm64/libmoordyn.2.dylib b/mac_libraries/arm64/libmoordyn.2.dylib index bdc1aed..c4eab7c 100644 Binary files a/mac_libraries/arm64/libmoordyn.2.dylib and b/mac_libraries/arm64/libmoordyn.2.dylib differ diff --git a/mac_libraries/arm64/libmoordyn.dylib b/mac_libraries/arm64/libmoordyn.dylib index bdc1aed..c4eab7c 100644 Binary files a/mac_libraries/arm64/libmoordyn.dylib and b/mac_libraries/arm64/libmoordyn.dylib differ diff --git a/mac_libraries/x86_64/libmoordyn.2.4.dylib b/mac_libraries/x86_64/libmoordyn.2.4.dylib deleted file mode 100644 index bdc1aed..0000000 Binary files a/mac_libraries/x86_64/libmoordyn.2.4.dylib and /dev/null differ diff --git a/mac_libraries/x86_64/libmoordyn.2.5.dylib b/mac_libraries/x86_64/libmoordyn.2.5.dylib new file mode 100644 index 0000000..c4eab7c Binary files /dev/null and b/mac_libraries/x86_64/libmoordyn.2.5.dylib differ diff --git a/mac_libraries/x86_64/libmoordyn.2.dylib b/mac_libraries/x86_64/libmoordyn.2.dylib index bdc1aed..c4eab7c 100644 Binary files a/mac_libraries/x86_64/libmoordyn.2.dylib and b/mac_libraries/x86_64/libmoordyn.2.dylib differ diff --git a/mac_libraries/x86_64/libmoordyn.dylib b/mac_libraries/x86_64/libmoordyn.dylib index bdc1aed..c4eab7c 100644 Binary files a/mac_libraries/x86_64/libmoordyn.dylib and b/mac_libraries/x86_64/libmoordyn.dylib differ