-
Notifications
You must be signed in to change notification settings - Fork 163
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
Wave visualization as a post-processing function #678
Conversation
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.
See inline comments for suggested changes. I think this works well but there are a few changes that can make it more robust and easier to read. Also, I would consider including a colored plane for the seafloor and force the axes to have the same aspect ratio (see daspect([])
or axis equal
commands). If not, then the device can appear stretched depending on the domain size input
@akeeste Thanks for the suggestions! I made the requested changes and I think it is a lot simpler and easier to read now. One small issue I ran into is that because I used simu.domainSize/2 for the axes, the seafloor is not on the figure for the RM3 because it's at -200 m. Should I just make the axes go to the full simu.domainSize? |
@jtgrasb For the lower z-axis limit, you could instead use The upper z-axis limit doesn't need to be very high. A couple thoughts:
It might be worthwhile letting users override the default limits regardless of method chosen. |
@akeeste I like the idea of having options instead of needing to specify some of the inputs. I made the default z maximum 10 and allow the user to input the axis limits, timesPerFrame, and saveSetting as optional inputs. |
- use ``options.axisLimits`` for ``X,Y`` grids - allow different simu.dtOut and simu.dt - Change default z axis maximum to -999. By default this is overwritten with the ``maxHeight`` of the body if the user does not input another option - move time annotation to the 2nd title line so that it cannot lie on top of the title box (this happened to me depending on the figure size upon opening)
@jtgrasb Great work! I made a few more minor changes:
I wasn't sure if you will have time to review before your semester starts so I went ahead and committed directly to your branch. Let me know if you disagree with anything Adam |
@kmruehl @jtgrasb My only other concern is that this function will not work with the variable step solver. However this relates to a larger problem of how we use |
@jtgrasb another option would be to make it a multiplier of |
@akeeste that sounds good to me. I think we should go ahead and merge it and then open an issue or project card related to the variable time-step issue with this feature. |
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.
@jtgrasb and @akeeste I made some minor revisions in this PR, feel free to merge or resolve them elsewhere: jtgrasb#1
- added output.plotWaves to examples, we could comment this but provide it as an example
- resolved issues with examples files to use the wecSimInputFile instead of custom parameters
To Do
- add documentation
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.
Please add documentation!
@kmruehl Where are you thinking to add this? I don't see anything in the documentation about |
@akeeste I think that's a good suggestion. The only reason we don't have docs for functions it because they were merged prior to our enforcement of the docs requirement. So if you'd like to add docs for them too... :) |
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 looks good, I'll add a the lines to the examples, and we should be good to go.
I created a function in the response class which creates a visualization of the waves and body reactions and saves it as either a video file or gif. I've attached examples below of the RM3 with regular waves and the OSWEC with irregular, directional waves.
The function can be run by adding "output.plotWaves(simu.dt,1,simu.g,[-100 100 -100 100 -40 15],body,waves,1);" to the userDefinedFunctions.