MoorDyn
Point.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 POINT_H
36 #define POINT_H
37 
38 #include "Line.h"
39 
40 #ifdef __cplusplus
41 extern "C"
42 {
43 #endif
44 
50 typedef struct __MoorDynPoint* MoorDynPoint;
51 
58 int DECLDIR
59 MoorDyn_GetPointID(MoorDynPoint point, int* id);
60 
68 int DECLDIR
69 MoorDyn_GetPointType(MoorDynPoint point, int* t);
70 
78 int DECLDIR
79 MoorDyn_GetPointPos(MoorDynPoint point, double pos[3]);
80 
88 int DECLDIR
89 MoorDyn_GetPointVel(MoorDynPoint point, double v[3]);
90 
98 int DECLDIR
99 MoorDyn_GetPointForce(MoorDynPoint point, double f[3]);
100 
108 int DECLDIR
109 MoorDyn_GetPointM(MoorDynPoint point, double m[3][3]);
110 
118 int DECLDIR
119 MoorDyn_GetPointNAttached(MoorDynPoint point, unsigned int* n);
120 
130 int DECLDIR
132  unsigned int i,
133  MoorDynLine* l,
134  int* e);
135 
145 int DECLDIR
146 MoorDyn_SavePointVTK(MoorDynPoint point, const char* filename);
147 
152 #ifdef __cplusplus
153 }
154 #endif
155 
156 #endif
#define DECLDIR
Prefix to export C functions on the compiled library.
Definition: MoorDynAPI.h:68
struct __MoorDynPoint * MoorDynPoint
A mooring point instance.
Definition: Point.h:50
int DECLDIR MoorDyn_GetPointM(MoorDynPoint point, double m[3][3])
Get the point mass matrix.
Definition: Point.cpp:503
int DECLDIR MoorDyn_GetPointType(MoorDynPoint point, int *t)
Get the point type.
Definition: Point.cpp:468
int DECLDIR MoorDyn_GetPointNAttached(MoorDynPoint point, unsigned int *n)
Get the number of connected lines.
Definition: Point.cpp:512
int DECLDIR MoorDyn_GetPointAttached(MoorDynPoint point, unsigned int i, MoorDynLine *l, int *e)
Get the number of connected lines.
Definition: Point.cpp:520
int DECLDIR MoorDyn_GetPointID(MoorDynPoint point, int *id)
Get the point identifier.
Definition: Point.cpp:460
int DECLDIR MoorDyn_GetPointPos(MoorDynPoint point, double pos[3])
Get the position of a point.
Definition: Point.cpp:476
int DECLDIR MoorDyn_SavePointVTK(MoorDynPoint point, const char *filename)
Save the point to a VTK (.vtu) file.
Definition: Point.cpp:539
int DECLDIR MoorDyn_GetPointForce(MoorDynPoint point, double f[3])
Get the force at a point.
Definition: Point.cpp:494
int DECLDIR MoorDyn_GetPointVel(MoorDynPoint point, double v[3])
Get the velocity of a point.
Definition: Point.cpp:485
struct __MoorDynLine * MoorDynLine
A mooring line instance.
Definition: Line.h:48