Skip to content

Commit 44efe6b

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents e572468 + d87820d commit 44efe6b

File tree

155 files changed

+228653
-4991
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

155 files changed

+228653
-4991
lines changed

.clang-format-ignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
source/Eigen/*

.github/workflows/build-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ jobs:
125125
mkdir -p ${{github.workspace}}/install
126126
127127
- name: Configure CMake (Linux)
128-
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DEXTERNAL_EIGEN:BOOL=OFF -DPYTHON_WRAPPER:BOOL=OFF -DFORTRAN_WRAPPER:BOOL=ON -DRUST_WRAPPER:BOOL=OFF -DUSE_VTK=ON -DBUILD_TESTING=ON
128+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DEXTERNAL_EIGEN:BOOL=OFF -DPYTHON_WRAPPER:BOOL=OFF -DFORTRAN_WRAPPER:BOOL=ON -DRUST_WRAPPER:BOOL=ON -DUSE_VTK=ON -DBUILD_TESTING=ON
129129
if: runner.os == 'Linux'
130130

131131
- name: Configure CMake (MacOS)

.github/workflows/matlab.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
name: Test MATLAB MEX
2+
3+
on:
4+
push:
5+
branches: [ $default-branch, master ]
6+
pull_request:
7+
branches:
8+
- "**"
9+
10+
env:
11+
BUILD_TYPE: Release
12+
LD_LIBRARY_PATH: ${{github.workspace}}/install/lib:${{github.workspace}}/install/lib64
13+
DYLD_LIBRARY_PATH: ${{github.workspace}}/install/lib
14+
15+
jobs:
16+
test:
17+
name: Test MATLAB MEX
18+
runs-on: ${{ matrix.os }}
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
# MATLAB requires an old version of Windows
23+
# Ubuntu dropped because of libcstd++ incompatibilities
24+
os: [macos-latest]
25+
26+
steps:
27+
- name: Check out repository
28+
uses: actions/checkout@v2
29+
30+
- name: Create install folder
31+
run: |
32+
mkdir -p ${{github.workspace}}/install
33+
34+
- name: Configure CMake (Linux)
35+
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{github.workspace}}/install -DEXTERNAL_EIGEN:BOOL=OFF -DPYTHON_WRAPPER:BOOL=OFF -DFORTRAN_WRAPPER:BOOL=OFF -DRUST_WRAPPER:BOOL=OFF -DMATLAB_WRAPPER:BOOL=OFF -DUSE_VTK=OFF -DBUILD_TESTING=OFF
36+
37+
- name: Build
38+
id: build
39+
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
40+
41+
- name: Install
42+
run: cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
43+
44+
- name: Set up MATLAB
45+
uses: matlab-actions/setup-matlab@v2
46+
47+
- name: Compile and run
48+
uses: matlab-actions/run-command@v2
49+
with:
50+
command: |
51+
mex('-setup', '-v', 'C');
52+
cd('wrappers/matlab/');
53+
fnames = struct2table(dir('*.cpp')).name;
54+
for i = 1:length(fnames)
55+
fname = cell2mat(fnames(i));
56+
mex('-v', fname, '-I./', '-I${{github.workspace}}/install/include/moordyn', '-L${{github.workspace}}/install/lib', '-L${{github.workspace}}/install/lib64', '-lmoordyn');
57+
end
58+
% Run the same minimal test we have on matlab_bindings.m.in
59+
system = MoorDynM_Create('../../tests/Mooring/lines.txt');
60+
%% 3 coupled points x 3 components per point = 9 DoF
61+
x = zeros(9,1);
62+
dx = zeros(9,1);
63+
%% Get the initial positions from the system itself
64+
for i=1:3
65+
%% 4 = first fairlead id
66+
point = MoorDynM_GetPoint(system, i + 3);
67+
x(1 + 3 * (i - 1):3 * i) = MoorDynM_GetPointPos(point);
68+
end
69+
%% Setup the initial condition
70+
MoorDynM_Init(system, x, dx);
71+
%% Make the points move at 0.5 m/s to the positive x direction
72+
for i=1:3
73+
dx(1 + 3 * (i - 1)) = 0.5;
74+
end
75+
t = 0.0;
76+
dt = 0.5;
77+
[t, f] = MoorDynM_Step(system, x, dx, t, dt);
78+
%% Print the position and tension of the line nodes
79+
n_lines = MoorDynM_GetNumberLines(system);
80+
for line_id=1:n_lines
81+
line_id
82+
line = MoorDynM_GetLine(system, line_id);
83+
n_nodes = MoorDynM_GetLineNumberNodes(line);
84+
for node_id=1:n_nodes
85+
node_id
86+
pos = MoorDynM_GetLineNodePos(line, node_id - 1);
87+
pos
88+
ten = MoorDynM_GetLineNodeTen(line, node_id - 1);
89+
ten
90+
end
91+
end
92+
%% Alright, time to finish!
93+
MoorDynM_Close(system);

.github/workflows/python-wheels-emulated.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
os: ${{ fromJSON(inputs.os) }}
4040
env:
4141
# Skip 32-bit windows wheels builds.
42-
CIBW_SKIP: "*-win32* pp38-* pp39-* pp310-*"
42+
CIBW_SKIP: "*-win32* pp38-* pp39-* pp310-* pp311-*"
4343
CIBW_ARCHS: ${{inputs.arch}}
4444
CIBW_ENVIRONMENT_LINUX: "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/project/install/lib"
4545
CIBW_BEFORE_ALL_LINUX: >
@@ -142,7 +142,7 @@ jobs:
142142
if: runner.os == 'Linux'
143143

144144
- name: Build wheels
145-
uses: pypa/cibuildwheel@v2.20.0
145+
uses: pypa/cibuildwheel@v2.23.1
146146
with:
147147
output-dir: dist
148148

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ compile/SO/test*
5353
.eggs
5454
moordyn.egg-info
5555
tests/__pycache__
56+
wrappers/python/moordyn/__pycache__
5657
/out/build
5758
/.vs/MoorDyn/FileContentIndex
5859
/.vs
@@ -65,4 +66,4 @@ dist
6566

6667
/source/.vscode
6768
.vscode/*
68-
docs/_build/*
69+
docs/_build/*

0 commit comments

Comments
 (0)