MoorDyn
Body.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_BODY_H
36 #define MOORDYN_BODY_H
37 
38 #ifdef __cplusplus
39 extern "C"
40 {
41 #endif
42 
48 typedef struct __MoorDynBody* MoorDynBody;
49 
56 int DECLDIR
57 MoorDyn_GetBodyID(MoorDynBody b, int* id);
58 
66 int DECLDIR
68 
76 int DECLDIR
77 MoorDyn_GetBodyState(MoorDynBody b, double r[6], double rd[6]);
78 
85 int DECLDIR
86 MoorDyn_GetBodyPos(MoorDynBody b, double r[3]);
87 
94 int DECLDIR
95 MoorDyn_GetBodyAngle(MoorDynBody b, double r[3]);
96 
103 int DECLDIR
104 MoorDyn_GetBodyVel(MoorDynBody b, double rd[3]);
105 
112 int DECLDIR
113 MoorDyn_GetBodyAngVel(MoorDynBody b, double rd[3]);
114 
121 int DECLDIR
122 MoorDyn_GetBodyForce(MoorDynBody b, double f[6]);
123 
130 int DECLDIR
131 MoorDyn_GetBodyM(MoorDynBody b, double m[6][6]);
132 
142 int DECLDIR
143 MoorDyn_SaveBodyVTK(MoorDynBody b, const char* filename);
144 
149 #ifdef __cplusplus
150 }
151 #endif
152 
153 #endif
#define DECLDIR
Prefix to export C functions on the compiled library.
Definition: MoorDynAPI.h:68
int DECLDIR MoorDyn_GetBodyID(MoorDynBody b, int *id)
Get the body identifier.
Definition: Body.cpp:773
int DECLDIR MoorDyn_GetBodyAngle(MoorDynBody b, double r[3])
Get the body angle.
Definition: Body.cpp:810
int DECLDIR MoorDyn_GetBodyPos(MoorDynBody b, double r[3])
Get the body position.
Definition: Body.cpp:801
int DECLDIR MoorDyn_SaveBodyVTK(MoorDynBody b, const char *filename)
Save the point to a VTK (.vtu) file.
Definition: Body.cpp:855
int DECLDIR MoorDyn_GetBodyM(MoorDynBody b, double m[6][6])
Get the body mass and intertia matrix.
Definition: Body.cpp:846
int DECLDIR MoorDyn_GetBodyForce(MoorDynBody b, double f[6])
Get the body angular velocity.
Definition: Body.cpp:837
int DECLDIR MoorDyn_GetBodyState(MoorDynBody b, double r[6], double rd[6])
Get the body state.
Definition: Body.cpp:789
struct __MoorDynBody * MoorDynBody
A mooring line instance.
Definition: Body.h:48
int DECLDIR MoorDyn_GetBodyVel(MoorDynBody b, double rd[3])
Get the body velocity.
Definition: Body.cpp:819
int DECLDIR MoorDyn_GetBodyType(MoorDynBody b, int *t)
Get the point type.
Definition: Body.cpp:781
int DECLDIR MoorDyn_GetBodyAngVel(MoorDynBody b, double rd[3])
Get the body angular velocity.
Definition: Body.cpp:828