[Paraview] help
乔彦超
oliver.qiao at gmail.com
Fri Nov 19 01:45:20 EST 2010
Hi:
i want write my results into VTK format, then i can use the paraview.
but i have some problem. my compute model is 700KM*700KM, there are 71*71
nodes. it's a Quadrilateral mesh.
my matlab code as followed
% Model size, m
xsize=700000;
ysize=700000;
% Defining resolution
xnum=71;
ynum=71;
NP=xnum*ynum;
NC=xnum*ynum-2*xnum+1;
% Defining gridline positions for regular basic grid
% In horizontal direction
gridx=zeros(xnum,1);
for i=2:1:xnum
gridx(i)=gridx(i-1)+xstp;
end
% Defining gridline positions for 51x51 irregular basic grid
% In vertical direction
gridy=zeros(ynum,1);
for i=2:1:6
gridy(i)=gridy(i-1)+20000;
end
for i=7:1:46
gridy(i)=gridy(i-1)+1250;
end
for i=46:1:51
gridy(i)=gridy(i-1)+10000;
end
for i=51:1:71
gridy(i)=gridy(i-1)+25000;
end
gridy(ynum)=ysize;
%write the points
a=0;
for i=1:1:ynum
for j=1:1:xnum
a=a+1;
Points(1,a)=gridx(j);
Points(2,a)=gridy(i);
end
end
% write the cell
nn=0;
for j=1:1:ynum
for i=1:1:xnum
nn=nn+1;
Cells(1,nn)=(j-1)*(xnum+1)+i;
Cells(2,nn)=(j-1)*(xnum+1)+i+1;
Cells(3,nn)=j*(xnum+1)+i+1;
Cells(4,nn)=j*(xnum+1)+i;
Cells(5,nn)=nn;
end
end
% write VTK file
fp=fopen('Resault.vtk','w');
fprintf(fp,'# vtk DataFile Version 3.0\n');
fprintf(fp,'vtk output\n');
fprintf(fp,'ASCII\n');
fprintf(fp,'DATASET STRUCTURED_GRID\n');
fprintf(fp,'POINTS %d float\n',NP);
for i=1:NP
fprintf(fp,'%e %e %e \n',Points(1,i),Points(2,i),0);
end
fprintf(fp,'\n');
fprintf(fp,'CELLS %d %d\n',NC,NC*4);
aa=0;
for i=1:NC
aa=aa+1;
fprintf(fp,'%d %d %d %d
%d\n',aa,Cells(1,i)-1,Cells(2,i)-1,Cells(3,i)-1,Cells(4,i)-1);
end
fprintf(fp,'\n');
fprintf(fp,'CELL_TYPES %d\n',NC);
for i=1:NC
fprintf(fp,'%d\n',4);
end
fprintf(fp,'\n');
fprintf(fp,'POINT_DATA %d\n',NP);
when i tried to open it with paraview.
it sayed "ERROR: In
C:\berk\ReleaseBuilds\ParaView3\VTK\IO\vtkDataReader.cxx, line 2078
ERROR: In C:\berk\ReleaseBuilds\ParaView3\VTK\IO\vtkDataReader.cxx, line
2078
ERROR: In
C:\berk\ReleaseBuilds\ParaView3\VTK\Parallel\vtkPDataSetReader.cxx, line 705
vtkPDataSetReader (0AEA4D18): Expecting 'DIMENSIONS' insted of: POINTS
ERROR: In
C:\berk\ReleaseBuilds\ParaView3\VTK\Parallel\vtkPDataSetReader.cxx, line 705
vtkPDataSetReader (0AEA4D18): Expecting 'DIMENSIONS' insted of: POINTS"
What's the problem? could you help me?
thank you very much.
Best regards!
--
Yanchao Qiao
Ph.D student of Geodynamics
+86-136 010 926 41
College of Earth Science
Graduate University of Chinese Academy of Sciences
19A, YuQuan Road, Beijing, China, 100049
Email:oliver.qiao at 163.com <Email%3Aoliver.qiao at 163.com>;
oliver.qiao at gmail.com;qiaoyanchao07 at mails.gucas.ac.cn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20101119/3bf1885a/attachment.htm>
More information about the ParaView
mailing list