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
Feature paraview #1081
Feature paraview #1081
Conversation
…ation start and end time, unless otherwise specified in the input file
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.
Thanks @agmoore4 for your Paraview PR. My apologies for the delay reviewing it. Overall this looks really good. I had a comment regarding paraview.dt
, otherwise I think this is ready for a merge.
source/objects/simulationClass.m
Outdated
'startTime', 0, ... % | ||
'endTime', 100, ... % | ||
'startTime', [], ... % | ||
'endTime', [], ... % | ||
'dt', 0.1, ... % |
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.
Should paraview.dt = [ ]
too? For consistency I think it should, and then it should also be updated in paraviewVisualization.m
, similar to paraview.startTime
and paraview.endTime
end | ||
if isempty(simu.paraview.endTime) | ||
simu.paraview.endTime = simu.endTime; | ||
end |
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.
I think you should also add an if statement here to set simu.paraview.dt
@@ -29,9 +29,15 @@ | |||
mkdir([simu.paraview.path filesep 'body' num2str(vtkbodiesii) '_' bodyname]); | |||
TimeBodyParav = output.bodies(ii).time; | |||
PositionBodyParav = output.bodies(ii).position; |
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.
I think all of this could be inside one if statement that re-assigns TimeBodyParaview
only if paraview.startTime
, paraview.endTime
, or paraview.dt
are specified. Otherwise all of these lines can be skipped, and go straight to line 41.
if isempty(simu.paraview.startTime) || isempty(simu.paraview.dt) || isempty(simu.paraview.endTime)
if isempty(simu.paraview.startTime)
simu.paraview.startTime = simu.startTime;
end
if isempty(simu.paraview.dt)
simu.paraview.dt= simu.dt;
end
if isempty(simu.paraview.endTime)
simu.paraview.endTime = simu.endTime;
end
NewTimeParaview(:,1) = simu.paraview.startTime:simu.paraview.dt:simu.paraview.endTime;
PositionBodyParav = interp1(TimeBodyParav,PositionBodyParav,NewTimeParaview);
TimeBodyParav = NewTimeParaview;
end
Implemented the requested changes. |
@agmoore4 this looks good, and it's ready for a merge once you update the embedded videos. The update should be something like this for the RM3:
and this for nonlinear:
|
Thanks @agmoore4. As soon as these tests run and pass I'll merge the PR |
All tests are passing, so I'm going to merge this PR. Thanks again! |
Several changes were made to improve visualization with ParaView and make WEC-Sim compatible with ParaView 5.11.1: