Skip to content

Commit

Permalink
Cable Application (#13)
Browse files Browse the repository at this point in the history
* draft cable application

* updating Cable example

* revised to use MBARI geometry and hydrodynamics

* updating cable example

* updating cable test

Co-authored-by: kmruehl <[email protected]>
Co-authored-by: dforbush2 <[email protected]>
  • Loading branch information
3 people authored Feb 25, 2022
1 parent 7a8d81c commit 012a232
Show file tree
Hide file tree
Showing 11 changed files with 1,492,605 additions and 3 deletions.
Binary file added Cable/MBARI_cable.slx
Binary file not shown.
13 changes: 13 additions & 0 deletions Cable/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Cable

**Author:** Dominic Forbush

**Version:** WEC-Sim v4.4

**Geometry:** MBARI-WEC, and open-source WEC from Monterey Bay Aquarium Research Institute.

**Dependency:** N/A

**Note:** More WEC information can be found: https://link.springer.com/article/10.1007/s40722-021-00197-9

Example using WEC-Sim to simulate a [Cable](http://wec-sim.github.io/WEC-Sim/advanced_features.html) connecting two rigid bodies for the ??? geometry.
63 changes: 63 additions & 0 deletions Cable/TestCable.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
classdef TestCable < matlab.unittest.TestCase

properties
OriginalDefault
testDir
h5Dir = fullfile("hydroData")
h5Name = 'mbari_snl.h5'
outName = 'mbari_snl.out'
end


methods (Access = 'public')
function obj = TestCable
obj.testDir = fileparts(mfilename('fullpath'));
end
end

methods (TestMethodSetup)
function killPlots (~)
set(0,'DefaultFigureVisible','off');
end
end

methods(TestClassSetup)

function captureVisibility(testCase)
testCase.OriginalDefault = get(0,'DefaultFigureVisible');
end

function runBemio(testCase)
cd(testCase.h5Dir);
hydro = struct();
hydro = Read_WAMIT(hydro,testCase.outName,[]);
hydro = Radiation_IRF(hydro,20,[],[],[],[]);
hydro = Radiation_IRF_SS(hydro,[],[]);
hydro = Excitation_IRF(hydro,30,[],[],[],[]);
Write_H5(hydro)
cd(testCase.testDir)
end

end

methods(TestClassTeardown)

function checkVisibilityRestored(testCase)
set(0,'DefaultFigureVisible',testCase.OriginalDefault);
testCase.assertEqual(get(0,'DefaultFigureVisible'), ...
testCase.OriginalDefault);
end

function removeH5(testCase)
delete(fullfile(testCase.h5Dir, testCase.h5Name));
end

end

methods(Test)
function testCable(testCase)
wecSim
end
end

end
Loading

0 comments on commit 012a232

Please sign in to comment.