-
Notifications
You must be signed in to change notification settings - Fork 184
Read capytaine functionality #464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…. More IRR issues but closer to WAMIT
kmruehl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@akeeste nice work! I didn't realize that you created all of the BEMIO runs too, that's great. I know it's still in progress, but you've gotten a lot done already.
| @@ -0,0 +1,54 @@ | |||
| """ | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@akeeste are these the Capytaine input files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The *.py scripts in each case directory set all of the Capytaine input parameters and run capytaine for each case (assuming Capytaine is already installed).
| @@ -0,0 +1,9220 @@ | |||
| Rhino->WAMIT file export (mesh) | |||
| 1 9.81 ULEN GRAV | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is the same mesh as used for WAMIT, perhaps we should point to the WAMIT directory so we aren't uploading the same file twice?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes these are the same meshes in the other BEMIO examples. I can change case scripts to point to these meshes instead.
| @author: akeeste | ||
|
|
||
| This script runs all of the current cases for WEC-Sim bemio examples. | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This runs all BEMIO runs, or just the Capytaine ones?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This script runs Capytaine for each case not BEMIO. I included this and call_capytaine.py so that everyone can see how Capytaine is being run for each case because there is an additional function required (hydrostatics)
|
@akeeste we need to re-open this PR. I went ahead and created a new dev branch and re-opened the PR |
|
@dav-og when you have some time, can you test the read_capytaine() function in this PR with any previous Capytaine output that you have? I want to ensure its working before we merge with master for the MECC groups |
Hey Adam, I ran your function on some old .nc files I had which don't have the hydrostatic stiffness matrix (C) included, so I get the following error message from normalize:
Not sure what the best approach to this is 🤔. Obviously the user needs C to run WEC-Sim...But most of the time I would just use meshmagick to compute C separately, so ideally I'd prefer to have the option to pass C separately from the .nc file (i.e. just read from a text file such as 'KH.dat', as we do for Nemoh). Other options for me in this instance could be to re-run Capytaine (which seems uneccessary just for C...especially if there are a lot of panels and/or frequencies to compute). Or manually edit the .nc files in hdfview or Python to include C...which could introduce errors/become tedious if you have a lot of .nc files. I think if you want to merge this function as is, thats fine - I guess most people will just run Capytaine with hydrostatics and the function will read it straight from the .nc file? But if we could eventually have the option to read a separate 'KH.dat' file, as we do with Nemoh, I think that would be handy 👍 |
|
@dav-og I think the warning message is a bit ambiguous, I will change it to an error and point to those .dat files more obviously. |
|
Sounds good! |
This PR adds read capytaine functionality to BEMIO. The BEMIO examples used for NEMOH and WAMIT have been recreated with Capytaine. The current read_capytaine script accomplishes as much as possible given Capytaine's current functionality. A method to add hydrostatics data is included in examples/BEMIO/CAPYTAINE/call_capy.py. This function must be used to output hydrostatics data in the correct format for read_capytaine.m
As Capytaine is still under development, it is important to know how it is being run for these cases to work correctly with BEMIO.
The specific python file that calls Capytaine and creates the .nc output is included in each case for this reason.
Files:
run_cases.py - Runs Capytaine for all cases
call_capytaine.py - Takes in input parameters, setups up Capytaine, runs hydrodynamics, and runs Capytaine
CASE.py - Setups up the input parameters that are sent to call_capytaine
CASE.nc - Capytaine output file for each case. This is read by the BEMIO function Read_CAPYTAINE.m
Notes: