This is the final step in the working process. It helps you visualize your calculation by generating .vtk files which can be used to start an animation in Paraview. These vtk files can then then be used to visualize an animation. The impact of sound can be viewed that way.
Here we explain how to create vtk files, to be visualised in Paraview:
Installation
1.) Create VTK-files for visualization in Paraview by executing the following Matlab script in your project folder:
Make sure that you added the directory EvalTools\Source in the source files to your Matlab path. Otherwise there might be an error!
:::matlab
if ~exist('Visualization','dir')
mkdir('Visualization');
end
if exist('ObjectMesh.mat','file')
load('ObjectMesh.mat')
if ~exist(['Visualization' filesep 'ObjectMesh'],'dir')
mkdir(['Visualization' filesep 'ObjectMesh'])
end
EvalTools_export2VTK(['Visualization' filesep 'ObjectMesh' filesep],nodes{1}(:,2:end),elements{1}(:,2:end),20*log10(abs(element_data{1})/0.00002),'amp')
end
2.) Start Paraview
3.) Load the VTK-files
They are located in Visualization\ObjectMesh
within your project folder
4.) Click on 'Apply' for the visualization to start
Results
• folder: Visualization (contains all the VTK-files)