MoorDyn
Line.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 
35 #ifndef MOORDYN_LINE_H
36 #define MOORDYN_LINE_H
37 
38 #ifdef __cplusplus
39 extern "C"
40 {
41 #endif
42 
48 typedef struct __MoorDynLine* MoorDynLine;
49 
56 int DECLDIR
57 MoorDyn_GetLineID(MoorDynLine l, int* id);
58 
67 int DECLDIR
68 MoorDyn_GetLineN(MoorDynLine l, unsigned int* n);
69 
77 int DECLDIR
78 MoorDyn_GetLineNumberNodes(MoorDynLine l, unsigned int* n);
79 
87 int DECLDIR
89 
97 int DECLDIR
99 
108 int DECLDIR
110 
121 int DECLDIR
123 
134 int DECLDIR
136 
147 int DECLDIR
149 
158 int DECLDIR
160 
170 int DECLDIR
172 
182 int DECLDIR
183 MoorDyn_SetLinePressInt(MoorDynLine l, const double* p);
184 
192 int DECLDIR
193 MoorDyn_GetLineNodePos(MoorDynLine l, unsigned int i, double pos[3]);
194 
202 int DECLDIR
203 MoorDyn_GetLineNodeVel(MoorDynLine l, unsigned int i, double vel[3]);
204 
222 int DECLDIR
223 MoorDyn_GetLineNodeForce(MoorDynLine l, unsigned int i, double f[3]);
224 
251 int DECLDIR
252 MoorDyn_GetLineNodeTen(MoorDynLine l, unsigned int i, double t[3]);
253 
274 int DECLDIR
275 MoorDyn_GetLineNodeBendStiff(MoorDynLine l, unsigned int i, double t[3]);
276 
300 int DECLDIR
301 MoorDyn_GetLineNodeWeight(MoorDynLine l, unsigned int i, double f[3]);
302 
340 int DECLDIR
341 MoorDyn_GetLineNodeDrag(MoorDynLine l, unsigned int i, double f[3]);
342 
383 int DECLDIR
384 MoorDyn_GetLineNodeFroudeKrilov(MoorDynLine l, unsigned int i, double f[3]);
385 
416 int DECLDIR
417 MoorDyn_GetLineNodeSeabedForce(MoorDynLine l, unsigned int i, double f[3]);
418 
429 int DECLDIR
430 MoorDyn_GetLineNodeCurv(MoorDynLine l, unsigned int i, double* c);
431 
441 int DECLDIR
442 MoorDyn_GetLineNodeM(MoorDynLine l, unsigned int i, double m[3][3]);
443 
450 int DECLDIR
451 MoorDyn_GetLineFairTen(MoorDynLine l, double* t);
452 
459 int DECLDIR
460 MoorDyn_GetLineMaxTen(MoorDynLine l, double* t);
461 
471 int DECLDIR
472 MoorDyn_SaveLineVTK(MoorDynLine l, const char* filename);
473 
478 #ifdef __cplusplus
479 }
480 #endif
481 
482 #endif
#define DECLDIR
Prefix to export C functions on the compiled library.
Definition: MoorDynAPI.h:68
int DECLDIR MoorDyn_SetLineUnstretchedLengthVel(MoorDynLine l, double v)
Set the line unstretched length rate of change.
Definition: Line.cpp:1994
int DECLDIR MoorDyn_GetLineNodeWeight(MoorDynLine l, unsigned int i, double f[3])
Get a line node weight and bouyancy.
Definition: Line.cpp:2127
int DECLDIR MoorDyn_SetLinePressInt(MoorDynLine l, const double *p)
Set the line internal pressure values at the nodes.
Definition: Line.cpp:2045
int DECLDIR MoorDyn_GetLineFairTen(MoorDynLine l, double *t)
Get the tension module at the end point B (the fairlead)
Definition: Line.cpp:2211
int DECLDIR MoorDyn_GetLineNodeBendStiff(MoorDynLine l, unsigned int i, double t[3])
Get a line node bending stiffness force.
Definition: Line.cpp:2113
int DECLDIR MoorDyn_SetLinePressBend(MoorDynLine l, int b)
Set whether the line pressure bending is considered or not.
Definition: Line.cpp:2034
int DECLDIR MoorDyn_GetLineNodeCurv(MoorDynLine l, unsigned int i, double *c)
Get a line curvature at a node.
Definition: Line.cpp:2183
int DECLDIR MoorDyn_GetLineNodeSeabedForce(MoorDynLine l, unsigned int i, double f[3])
Get a line node seabed reaction.
Definition: Line.cpp:2169
int DECLDIR MoorDyn_GetLineID(MoorDynLine l, int *id)
Get the line identifier.
Definition: Line.cpp:1952
int DECLDIR MoorDyn_IsLinePressBend(MoorDynLine l, int *b)
Get whether the line pressure bending is considered or not.
Definition: Line.cpp:2026
int DECLDIR MoorDyn_GetLineNodeTen(MoorDynLine l, unsigned int i, double t[3])
Get a line node tension.
Definition: Line.cpp:2099
int DECLDIR MoorDyn_GetLineNodeForce(MoorDynLine l, unsigned int i, double f[3])
Get a line node force.
Definition: Line.cpp:2085
int DECLDIR MoorDyn_GetLineMaxTen(MoorDynLine l, double *t)
Get the maximum tension module.
Definition: Line.cpp:2219
int DECLDIR MoorDyn_SetLineConstantEA(MoorDynLine l, double EA)
Set the constant stiffness of the line.
Definition: Line.cpp:2018
int DECLDIR MoorDyn_GetLineUnstretchedLength(MoorDynLine l, double *ul)
Get the line unstretched length.
Definition: Line.cpp:1978
int DECLDIR MoorDyn_GetLineNodeM(MoorDynLine l, unsigned int i, double m[3][3])
Get a line node mass matrix.
Definition: Line.cpp:2197
int DECLDIR MoorDyn_GetLineN(MoorDynLine l, unsigned int *n)
Get the line number of segments.
Definition: Line.cpp:1960
int DECLDIR MoorDyn_GetLineNumberNodes(MoorDynLine l, unsigned int *n)
Get the line number of nodes.
Definition: Line.cpp:1968
int DECLDIR MoorDyn_GetLineNodePos(MoorDynLine l, unsigned int i, double pos[3])
Get a line node position.
Definition: Line.cpp:2057
int DECLDIR MoorDyn_GetLineNodeDrag(MoorDynLine l, unsigned int i, double f[3])
Get a line node drag force.
Definition: Line.cpp:2141
int DECLDIR MoorDyn_SaveLineVTK(MoorDynLine l, const char *filename)
Save the line to a VTK (.vtu) file.
Definition: Line.cpp:2233
struct __MoorDynLine * MoorDynLine
A mooring line instance.
Definition: Line.h:48
int DECLDIR MoorDyn_GetLineNodeVel(MoorDynLine l, unsigned int i, double vel[3])
Get a line node velocity.
Definition: Line.cpp:2071
int DECLDIR MoorDyn_GetLineConstantEA(MoorDynLine l, double *EA)
Get the constant stiffness of the line.
Definition: Line.cpp:2010
int DECLDIR MoorDyn_IsLineConstantEA(MoorDynLine l, int *b)
Get whether the line is governed by a non-linear stiffness or a constant one.
Definition: Line.cpp:2002
int DECLDIR MoorDyn_SetLineUnstretchedLength(MoorDynLine l, double ul)
Set the line unstretched length.
Definition: Line.cpp:1986
int DECLDIR MoorDyn_GetLineNodeFroudeKrilov(MoorDynLine l, unsigned int i, double f[3])
Get a line node Froude Krilov force.
Definition: Line.cpp:2155