Skip to content
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

paraview functions #490

Merged
merged 5 commits into from
Jan 19, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
update doc strings
  • Loading branch information
akeeste committed Jan 6, 2021
commit 10c45c6d1edaf468628a94068cab4e0d56c7bc6b
40 changes: 20 additions & 20 deletions source/functions/write_paraview_body.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,26 @@ function write_paraview_body(body, t, pos_all, bodyname, model, simdate, hspress
% ------------
% body : bodyClass
% Instance of the bodyClass that is being written to Paraview files.
% t : float
% asdf
% pos_all :
% asdf
% bodyname :
% asdf
% model :
% asdf
% simdate :
% asdf
% hspressure :
% asdf
% wavenonlinearpressure :
% asdf
% wavelinearpressure :
% asdf
% pathParaviewVideo :
% asdf
% vtkbodiesii :
% asdf
% t : float vector
% Body time vector
% pos_all : float vector
% 6D position of the body interpolated to the Paraview output time, t
% bodyname : string
% Name of the body
% model : string
% The simMechanics ``.slx`` filename
% simdate : string
% Date and time of the simulation
% hspressure : float vector
% Hydrostatic pressure on the body cells
% wavenonlinearpressure : float vector
% Nonlinear Froude-Krylov pressure on the body cells
% wavelinearpressure : float vector
% Linear Froude-Krylov pressure on the body cells
% pathParaviewVideo : directory
% Directory the Paraview files were saved
% vtkbodiesii : int
% Index of the body (1 - number of Paraview bodies)
%
numVertex = body.bodyGeometry.numVertex;
numFace = body.bodyGeometry.numFace;
Expand Down
8 changes: 4 additions & 4 deletions source/functions/write_paraview_mooring.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ function write_paraview_mooring(moorDyn, model,t,simdate,nline,nnode,pathParavie
% moorDyn : obj
% The moorDyn object
% model : string
% The simMechanics ``.slx`` file
% The simMechanics ``.slx`` filename
% t : float vector
% Moordyn time vector
% simdate : string
% Date string
% Date and time of the simulation
% nline : integer
% Number of mooring lines
% nnode : integer
Expand All @@ -21,8 +21,8 @@ function write_paraview_mooring(moorDyn, model,t,simdate,nline,nnode,pathParavie
% Directory the Paraview files were saved
% TimeBodyParav : float vector
% Paraview time vector
% simu.g : float
% Gravitational acceleration from simulationClass
% NewTimeParaview : float vector
% Total simulation time interpolated by the Paraview time step
%

nsegment = nnode -1;
Expand Down
27 changes: 17 additions & 10 deletions source/functions/write_paraview_response.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,21 @@ function write_paraview_response(bodies, t, model, simdate, wavetype, mooring, p
%
% Parameters
% ------------
% var : type
% description
%
%
%
%
%
This method is executed by specifying
% ``simu.paraview=1`` in the ``wecSimInputFile.m``.
% bodies : bodyClass vector
% Instances of the bodyClass that are being written to Paraview files.
% t : float vector
% output time vector
% model : string
% The simMechanics ``.slx`` filename
% simdate : string
% Date and time of the simulation
% wavetype : string
% Type of wave used in the simulation
% mooring : int
% MoorDyn flag
% pathParaviewVideo : directory
% Directory the Paraview files were saved
%

% set fileseperator to fs
if strcmp(filesep, '\')
Expand All @@ -22,7 +28,8 @@ function write_paraview_response(bodies, t, model, simdate, wavetype, mooring, p
fs = filesep;
end
% open file
fid = fopen([pathParaviewVideo, fs model(1:end-4) '.pvd'], 'w');
% fid = fopen([pathParaviewVideo, fs model(1:end-4) '.pvd'], 'w');
fid = fopen([pathParaviewVideo, fs erase(model(1:end-4),pwd) '.pvd'], 'w');
% write header
fprintf(fid, '<?xml version="1.0"?>\n');
fprintf(fid, ['<!-- WEC-Sim Visualization using ParaView -->\n']);
Expand Down
28 changes: 22 additions & 6 deletions source/functions/write_paraview_wave.m
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,28 @@ function write_paraview_wave(waves, t, numPointsX, numPointsY, domainSize, model
%
% Parameters
% ------------
% var : type
% description
%
%
%
%
% waves : waveClass
% Instance of the waveClass that is being written to Paraview files.
% t : float vector
% Wave time vector
% numPointsX : int
% Number of points for visualization in the x direction
% numPointsY : int
% Number of points for visualization in the y direction
% domainSize : int
% Length of the wave field in meters
% model : string
% The simMechanics ``.slx`` filename
% simdate : string
% Date and time of the simulation
% mooring : int
% MoorDyn flag
% pathParaviewVideo : directory
% Directory the Paraview files were saved
% TimeBodyParav : float vector
% Paraview time vector
% g : float
% Gravitational acceleration constant
%

% ground plane
Expand Down