MoorDyn
MoorDyn.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2022, Matt Hall
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions are met:
6  *
7  * 1. Redistributions of source code must retain the above copyright notice,
8  * this list of conditions and the following disclaimer.
9  *
10  * 2. Redistributions in binary form must reproduce the above copyright notice,
11  * this list of conditions and the following disclaimer in the documentation
12  * and/or other materials provided with the distribution.
13  *
14  * 3. Neither the name of the copyright holder nor the names of its
15  * contributors may be used to endorse or promote products derived from
16  * this software without specific prior written permission.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28  * POSSIBILITY OF SUCH DAMAGE.
29  */
30 
41 #ifndef __MOORDYN_H__
42 #define __MOORDYN_H__
43 
44 #include "MoorDynAPI.h"
45 
46 #ifdef __cplusplus
47 extern "C"
48 {
49 #endif
50 
75 int DECLDIR
76 MoorDynInit(const double x[], const double xd[], const char* infilename);
77 
91 int DECLDIR
92 MoorDynStep(const double x[],
93  const double xd[],
94  double f[],
95  double* t,
96  double* dt);
97 
103 int DECLDIR
104 MoorDynClose(void);
105 
113 int DECLDIR
115 
120 void DECLDIR
121 getWaveKinCoordinates(double r_out[]);
122 
132 void DECLDIR
133 setWaveKin(const double U_in[], const double Ud_in[], double t_in);
134 
135 double DECLDIR
136 GetFairTen(int);
137 
138 int DECLDIR
139 GetFASTtens(int* numLines,
140  float FairHTen[],
141  float FairVTen[],
142  float AnchHTen[],
143  float AnchVTen[]);
144 
145 int DECLDIR
146 GetPointPos(int l, double pos[3]);
147 int DECLDIR
148 GetPointForce(int l, double force[3]);
149 int DECLDIR
150 GetNodePos(int LineNum, int NodeNum, double pos[3]);
151 
152 void DECLDIR
153 AllOutput(double, double);
154 
160 void DECLDIR
161 SetDisableConsole(int disable);
162 
167 #ifdef __cplusplus
168 }
169 #endif
170 
171 #endif
#define DECLDIR
Prefix to export C functions on the compiled library.
Definition: MoorDynAPI.h:68
void DECLDIR getWaveKinCoordinates(double r_out[])
Get the points where the waves kinematics shall be provided.
Definition: MoorDyn.cpp:223
int DECLDIR MoorDynStep(const double x[], const double xd[], double f[], double *t, double *dt)
Runs a time step of the MoorDyn system.
Definition: MoorDyn.cpp:169
void DECLDIR setWaveKin(const double U_in[], const double Ud_in[], double t_in)
Set the kinematics of the waves.
Definition: MoorDyn.cpp:233
int DECLDIR externalWaveKinInit()
Initializes the external Wave kinetics.
Definition: MoorDyn.cpp:207
void DECLDIR SetDisableConsole(int disable)
Set the variable to disable the console window.
Definition: MoorDyn.cpp:303
int DECLDIR MoorDynInit(const double x[], const double xd[], const char *infilename)
initializes MoorDyn
Definition: MoorDyn.cpp:89
int DECLDIR MoorDynClose(void)
Releases MoorDyn allocated resources.
Definition: MoorDyn.cpp:182