From 65b0c9bd877a19ffb5f68f4c2f6e73d1227b911f Mon Sep 17 00:00:00 2001 From: Thorsten Liebig Date: Mon, 3 Dec 2012 09:37:51 +0100 Subject: [PATCH] matlab: Dump2VTK new option and updated doc Signed-off-by: Thorsten Liebig --- matlab/Dump2VTK.m | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/matlab/Dump2VTK.m b/matlab/Dump2VTK.m index 990ade4..22fda9a 100644 --- a/matlab/Dump2VTK.m +++ b/matlab/Dump2VTK.m @@ -3,6 +3,11 @@ function Dump2VTK(filename, fields, mesh, fieldname, varargin) % % Dump fields extraced from an hdf5 file to a vtk file format % +% possible arguments: +% 'NativeDump': 0 (default) / 1, dump in native coordinate system +% 'CloseAlpha': 0 (default) / 1, repeat first/last line in +% alpha-direction for a full cylindrical mesh +% % example: % % @@ -13,10 +18,15 @@ function Dump2VTK(filename, fields, mesh, fieldname, varargin) % See also ReadHDF5FieldData ReadHDF5Mesh GetField_TD2FD GetField_Interpolation NativeDump = 0; +CloseAlpha = 0; for n=1:2:numel(varargin) if (strcmp(varargin{n},'NativeDump')==1); NativeDump = varargin{n+1}; + elseif (strcmp(varargin{n},'CloseAlpha')==1); + CloseAlpha = varargin{n+1}; + else + warning('openEMS:Dump2VTK', ['"' varargin{n} '" is an unknown argument']); end end @@ -40,6 +50,11 @@ if (~isempty(ind)) fields(ind)=0; end +if ((CloseAlpha~=0) && (mesh.type==1) && (range(y)<2*pi)) + y(end+1) = y(1)+2*pi; + fields(:,end+1,:,:) = fields(:,1,:,:); +end + if (mesh.type==0) %write cartesian mesh to vtk fprintf(fid,'# vtk DataFile Version 2.0\n'); fprintf(fid,'Rectilinear Grid by matlab-interface of openEMS\n');