Skip to content

Commit a8d0434

Browse files
committed
merge main branch
2 parents ae1fb77 + 1913e36 commit a8d0434

File tree

6 files changed

+32
-31
lines changed

6 files changed

+32
-31
lines changed

.github/workflows/all-tests-reusable.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Install MATLAB
2828
uses: matlab-actions/setup-matlab@v2
2929
with:
30-
release: R2024a
30+
release: R2024b
3131
- name: Get test target folder
3232
uses: matlab-actions/run-command@v2
3333
with:
655 Bytes
Binary file not shown.
10.5 KB
Binary file not shown.

Paraview_Visualization/RM3_MoorDyn_Viz/TestMoorDynViz.m

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@ function removeVTK(testCase)
6262

6363
methods(Test)
6464
function testParaview_Visualization_RM3_MoorDyn_Viz(testCase)
65-
% assumeError(testCase, ...
66-
% @() run("wecSim"), ...
67-
% 'Simulink:Engine:CallbackEvalErr', ...
68-
% 'Expected failure');
6965
wecSim
7066
end
7167
end

Passive_Yaw/PassiveYawRegression/runLoadPassiveYawIrr.m

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,20 @@
3939
plot(IrrYaw.time_new,IrrYaw.Pos_new,':k','LineWidth',1.4)
4040
hold on; grid on;
4141
plot(IrrYaw.time_org,IrrYaw.Pos_org,'-k')
42-
title('Passive Yaw, irregular wave')
4342
xlabel('Time(s)'); ylabel('Yaw position (rad)')
43+
title('Yaw position comparison')
44+
4445
subplot(1,2,2) % plots of yaw position
4546
plot(IrrYaw.time_new,IrrYaw.Force_new,':k','LineWidth',1.4)
4647
hold on; grid on;
47-
plot(IrrYaw.time_org,IrrYaw.Force_org,'-k')
48-
xlabel('Time(s)'); ylabel('Total Yaw Force (N)')
49-
legend('New','Original')
50-
savefig('figYawIrr');
48+
plot(IrrYaw.time_org,IrrYaw.Force_org,'-k');
49+
xlabel('Time(s)');
50+
ylabel('Total Yaw Force (N)');
51+
legend('New','Original');
52+
title('Yaw force comparison');
53+
54+
sgtitle('Passive yaw regression, irregular wave')
55+
savefig('figYawIrr');
5156

5257
%% Clear output and .slx directory
5358
try

Passive_Yaw/TestPassiveYawRegression.m

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@
77
IrrYaw
88
end
99

10-
methods(Access = 'public')
11-
function obj = TestPassiveYawRegression(openCompare)
10+
methods(Access = 'public')
11+
function obj = TestPassiveYawRegression(openCompare)
1212
arguments
1313
openCompare (1,1) double = 1
14-
end
14+
end
1515
% Assign arguments to test Class
16-
obj.openCompare = openCompare;
16+
obj.openCompare = openCompare;
1717
% Set test directory
18-
obj.testDir = fileparts(mfilename('fullpath'));
18+
obj.testDir = fileparts(mfilename('fullpath'));
1919
% Save the visibility state at construction
20-
obj.OriginalDefault = get(0,'DefaultFigureVisible');
21-
end
20+
obj.OriginalDefault = get(0,'DefaultFigureVisible');
21+
end
2222
end
2323

2424
methods (TestMethodSetup)
@@ -27,32 +27,32 @@ function killPlots (~)
2727
end
2828
end
2929

30-
methods(TestClassSetup)
31-
function runYawIrrTest(testCase)
30+
methods(TestClassSetup)
31+
function runYawIrrTest(testCase)
3232
cd(fullfile(testCase.testDir, ...
33-
'PassiveYawRegression'))
33+
'PassiveYawRegression'))
3434
runLoadPassiveYawIrr;
3535
close_system('OSWEC',0)
3636
testCase.IrrYaw = load('IrrYaw.mat').("IrrYaw");
3737
cd(fullfile(testCase.testDir));
3838
end
3939
end
4040

41-
methods(TestClassTeardown)
42-
function plotRegressionTests(testCase)
41+
methods(TestClassTeardown)
42+
function plotRegressionTests(testCase)
4343
% Open new vs. org Comparisons
44-
if testCase.openCompare == 1
44+
if testCase.openCompare == 1
4545
cd(testCase.testDir);
46-
open(fullfile('.','PassiveYawRegression','figYawIrr.fig'));
47-
end
46+
open(fullfile('.','PassiveYawRegression','figYawIrr.fig'));
47+
end
4848
set(0,'DefaultFigureVisible',testCase.OriginalDefault);
4949
testCase.assertEqual(get(0,'DefaultFigureVisible'), ...
50-
testCase.OriginalDefault);
51-
cd(testCase.testDir);
50+
testCase.OriginalDefault);
51+
cd(testCase.testDir);
5252
end
5353
end
5454

55-
methods(Test)
55+
methods(Test)
5656
function body1_irregYaw_disp_yaw(testCase)
5757
% Body1 Displacement in Yaw
5858
tol = 1e-10;
@@ -66,7 +66,7 @@ function body1_irregYaw_torque_yaw(testCase)
6666
testCase.verifyEqual(testCase.IrrYaw.Force_diff,0,'AbsTol',tol);
6767
fprintf(['Body1 Torque in Yaw, Diff = ' ...
6868
num2str(testCase.IrrYaw.Force_diff) '\n']);
69-
end
69+
end
7070
function irregYaw_0th_Spectral_Moment(testCase)
7171
% 0th Order Spectral Moment
7272
tol = 1e-10;
@@ -75,7 +75,7 @@ function irregYaw_0th_Spectral_Moment(testCase)
7575
testCase.verifyEqual(new,org,'AbsTol',tol);
7676
fprintf(['0th Order Spectral Moment, Diff = ' ...
7777
num2str(max(abs(org-new))) '\n']);
78-
end
78+
end
7979
function irregYaw_2nd_Spectral_Moment(testCase)
8080
% 2nd Order Spectral Moment
8181
tol = 1e-10;
@@ -84,6 +84,6 @@ function irregYaw_2nd_Spectral_Moment(testCase)
8484
testCase.verifyEqual(new,org,'AbsTol',tol);
8585
fprintf(['2nd Order Spectral Moment, Diff = ' ...
8686
num2str(max(abs(org-new))) '\n']);
87-
end
87+
end
8888
end
8989
end

0 commit comments

Comments
 (0)