MoorDyn
Rod.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 ROD_H
36 #define ROD_H
37 
38 #ifdef __cplusplus
39 extern "C"
40 {
41 #endif
42 
48 typedef struct __MoorDynRod* MoorDynRod;
49 
56 int DECLDIR
57 MoorDyn_GetRodID(MoorDynRod l, int* id);
58 
65 int DECLDIR
67 
75 int DECLDIR
76 MoorDyn_GetRodForce(MoorDynRod l, double f[6]);
77 
84 int DECLDIR
85 MoorDyn_GetRodM(MoorDynRod l, double m[6][6]);
86 
95 int DECLDIR
96 MoorDyn_GetRodN(MoorDynRod l, unsigned int* n);
97 
105 int DECLDIR
106 MoorDyn_GetRodNumberNodes(MoorDynRod l, unsigned int* n);
107 
115 int DECLDIR
116 MoorDyn_GetRodNodePos(MoorDynRod l, unsigned int i, double pos[3]);
117 
125 int DECLDIR
126 MoorDyn_GetRodNodeVel(MoorDynRod l, unsigned int i, double vel[3]);
127 
137 int DECLDIR
138 MoorDyn_SaveRodVTK(MoorDynRod l, const char* filename);
139 
144 #ifdef __cplusplus
145 }
146 #endif
147 
148 #endif
#define DECLDIR
Prefix to export C functions on the compiled library.
Definition: MoorDynAPI.h:68
struct __MoorDynRod * MoorDynRod
A mooring line instance.
Definition: Rod.h:48
int DECLDIR MoorDyn_GetRodType(MoorDynRod l, int *t)
Get the line type.
Definition: Rod.cpp:1737
int DECLDIR MoorDyn_GetRodN(MoorDynRod l, unsigned int *n)
Get the line number of segments.
Definition: Rod.cpp:1763
int DECLDIR MoorDyn_SaveRodVTK(MoorDynRod l, const char *filename)
Save the line to a VTK (.vtu) file.
Definition: Rod.cpp:1809
int DECLDIR MoorDyn_GetRodForce(MoorDynRod l, double f[6])
Get the net force acting on the rod, as well as the moment at end point A if the node is not pinned.
Definition: Rod.cpp:1745
int DECLDIR MoorDyn_GetRodID(MoorDynRod l, int *id)
Get the line identifier.
Definition: Rod.cpp:1729
int DECLDIR MoorDyn_GetRodNodePos(MoorDynRod l, unsigned int i, double pos[3])
Get a rod node position.
Definition: Rod.cpp:1781
int DECLDIR MoorDyn_GetRodNumberNodes(MoorDynRod l, unsigned int *n)
Get the line number of nodes.
Definition: Rod.cpp:1771
int DECLDIR MoorDyn_GetRodM(MoorDynRod l, double m[6][6])
Get the total rod mass matrix.
Definition: Rod.cpp:1754
int DECLDIR MoorDyn_GetRodNodeVel(MoorDynRod l, unsigned int i, double vel[3])
Get a rod node velocity.
Definition: Rod.cpp:1795