-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 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
1 parent
7a8d81c
commit 012a232
Showing
11 changed files
with
1,492,605 additions
and
3 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.