As I have already mentioned, please replace <span style="border-collapse: collapse; font-family: arial,sans-serif; font-size: 13px;">"</span><span style="border-collapse: collapse; font-family: arial,sans-serif; font-size: 13px;">DATASET STRUCTURED_GRID</span>" with <span style="border-collapse: collapse; font-family: arial,sans-serif; font-size: 13px;">"</span><span style="border-collapse: collapse; font-family: arial,sans-serif; font-size: 13px;">DATASET UNSTRUCTURED_GRID</span>"<br>
<br><br><div class="gmail_quote">2010/11/21 乔彦超 <span dir="ltr"><<a href="mailto:oliver.qiao@gmail.com">oliver.qiao@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>Hi Hom:</div>
<div>Â </div>
<div>i followed your advice to change the code.</div>
<div>but it still have the problem. <br>as followed</div>
<div><div class="im"><span style="font-family:'Courier';color:#800000">ERROR: In C:\berk\ReleaseBuilds\ParaView3\VTK\Parallel\vtkPDataSetReader.cxx, line 705</span>
</div><p style="text-indent:0px;margin:0px;font-family:'Courier';color:#800000">vtkPDataSetReader (094D4C88): Expecting 'DIMENSIONS' insted of: POINTS</p><div class="im">
<p style="text-indent:0px;margin:0px;font-family:'Courier';color:#800000"></p>
<p style="text-indent:0px;margin:0px;font-family:'Courier';color:#800000"></p>
<p style="text-indent:0px;margin:0px;font-family:'Courier';color:#800000">ERROR: In C:\berk\ReleaseBuilds\ParaView3\VTK\Parallel\vtkPDataSetReader.cxx, line 705</p>
</div><p style="text-indent:0px;margin:0px;font-family:'Courier';color:#800000">vtkPDataSetReader (094D4C88): Expecting 'DIMENSIONS' insted of: POINTS</p>
<p style="text-indent:0px;margin:0px;font-family:'Courier';color:#800000"></p>
<p style="text-indent:0px;margin:0px;font-family:'Courier';color:#800000"></p>
<p style="text-indent:0px;margin:0px;font-family:'Courier';color:#800000">ERROR: In C:\berk\ReleaseBuilds\ParaView3\VTK\IO\vtkStructuredGridReader.cxx, line 150</p>
<p style="text-indent:0px;margin:0px;font-family:'Courier';color:#800000">vtkStructuredGridReader (094D8C88): Could not read dimensions</p>
<p style="text-indent:0px;margin:0px;font-family:'Courier';color:#800000"></p>
<p style="text-indent:0px;margin:0px;font-family:'Courier';color:#800000"></p>
<p style="text-indent:0px;margin:0px;font-family:'Courier';color:#800000">ERROR: In C:\berk\ReleaseBuilds\ParaView3\VTK\IO\vtkStructuredGridReader.cxx, line 150</p>
<p style="text-indent:0px;margin:0px;font-family:'Courier';color:#800000">vtkStructuredGridReader (094D8C88): Could not read dimensions</p>
<p style="text-indent:0px;margin:0px;font-family:'Courier';color:#800000"></p>
<p style="text-indent:0px;margin:0px;font-family:'Courier';color:#800000"></p>
<p style="text-indent:0px;margin:0px;font-family:'Courier';color:#800000">ERROR: In C:\berk\ReleaseBuilds\ParaView3\VTK\IO\vtkStructuredGridReader.cxx, line 317</p>
<p style="text-indent:0px;margin:0px;font-family:'Courier';color:#800000">vtkStructuredGridReader (094D8C88): Unrecognized keyword: cells</p>
<p style="text-indent:0px;margin:0px;font-family:'Courier';color:#800000">Â </p>
<p style="text-indent:0px;margin:0px;font-family:'Courier';color:#800000">the accessory is my result.</p>
<p style="text-indent:0px;margin:0px;font-family:'Courier';color:#800000">Â </p>
<p style="text-indent:0px;margin:0px;font-family:'Courier';color:#800000">thank you!<br></p></div>
<div class="gmail_quote">2010/11/19 Hom Nath Gharti <span dir="ltr"><<a href="mailto:hng.email@gmail.com" target="_blank">hng.email@gmail.com</a>></span><div><div></div><div class="h5"><br>
<blockquote style="border-left:#ccc 1px solid;margin:0px 0px 0px 0.8ex;padding-left:1ex" class="gmail_quote">I think:
<div><br></div>
<div>1. It should be "<span style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px">DATASET UNSTRUCTURED_GRID" not "</span><span style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px">DATASET STRUCTURED_GRID"</span></div>
<div><span style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px">2. In CELLS it should be NC*5 not NC*4, because this represents the total number of integer values in the CELL list. In your case it is (Number of elements*(1 + Number of nodes per element))</span></div>
<div><span style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px">3. In the CELL list you should have</span></div>
<div><span style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px">Number of nodes per element, node1, node2, node3, node4</span></div>
<div><span style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px">...</span></div>
<div><span style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px">...</span></div>
<div><span style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px">Therefore, it should be:</span></div>
<div><span style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px">fprintf(fp,'%d %d %d %d %d\n',4,Cells(1,i)-1,Cells(2,i)-1,Cells(3,i)-1,Cells(4,i)-1);</span></div>
<div><span style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px"><br></span></div>
<div><font face="arial, sans-serif"><span style="border-collapse:collapse">4. Because you are displaying Quadrilateral, in the list of </span></font><span style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px">CELL_TYPE you should use:</span></div>
<div><span style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px"><br></span></div>
<div><span style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px">fprintf(fp,'%d\n',9);  not </span><span style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px">fprintf(fp,'%d\n',4); 4 is for polyline see figure 3 of (5)</span></div>
<div><span style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px"><br></span></div>
<div><font face="arial, sans-serif"><span style="border-collapse:collapse"><br></span></font></div>
<div><span style="border-collapse:collapse;font-family:arial, sans-serif;font-size:13px">5. See </span><a href="http://www.vtk.org/VTK/img/file-formats.pdf" target="_blank">http://www.vtk.org/VTK/img/file-formats.pdf</a> for detail</div>
<div><br></div>
<div>Good luck!</div>
<div>HNG</div>
<div><br>
<div class="gmail_quote">
<div>
<div></div>
<div>On Fri, Nov 19, 2010 at 7:45 AM, 乔彦超 <span dir="ltr"><<a href="mailto:oliver.qiao@gmail.com" target="_blank">oliver.qiao@gmail.com</a>></span> wrote:<br></div></div>
<blockquote style="border-left:#ccc 1px solid;margin:0px 0px 0px 0.8ex;padding-left:1ex" class="gmail_quote">
<div>
<div></div>
<div>Hi:<br>Â <br>i want write my results into VTK format, then i can use the paraview.<br>but i have some problem. my compute model is 700KM*700KM, there are 71*71 nodes. it's a Quadrilateral mesh.<br>Â <br>
my matlab code as followed<br>% Model size, m<br>xsize=700000;<br>ysize=700000;<br>% Defining resolution<br>xnum=71;<br>ynum=71;<br>NP=xnum*ynum;<br>NC=xnum*ynum-2*xnum+1;<br>% Defining gridline positions for regular basic grid<br>
% In horizontal direction<br>gridx=zeros(xnum,1);<br>for i=2:1:xnum<br>Â Â Â gridx(i)=gridx(i-1)+xstp;<br>end<br>% Defining gridline positions for 51x51 irregular basic grid<br>% In vertical direction<br>gridy=zeros(ynum,1);<br>
for i=2:1:6<br>Â Â Â gridy(i)=gridy(i-1)+20000;<br>end<br>for i=7:1:46<br>Â Â Â gridy(i)=gridy(i-1)+1250;<br>end<br>for i=46:1:51<br>Â Â Â gridy(i)=gridy(i-1)+10000;<br>end<br>for i=51:1:71<br>Â Â Â gridy(i)=gridy(i-1)+25000;<br>
end<br>gridy(ynum)=ysize;<br>Â <br>%write the points<br>a=0;<br>for i=1:1:ynum<br>Â Â Â for j=1:1:xnum<br>Â Â Â Â Â Â Â a=a+1;<br>Â Â Â Â Â Â Â Points(1,a)=gridx(j);<br>Â Â Â Â Â Â Â Points(2,a)=gridy(i);<br>Â Â Â end<br>end<br>% write the cell<br>
nn=0;<br>for j=1:1:ynum<br>Â Â Â for i=1:1:xnum<br>Â Â Â Â Â Â Â nn=nn+1;<br>Â Â Â Â Â Â Â Cells(1,nn)=(j-1)*(xnum+1)+i;<br>Â Â Â Â Â Â Â Cells(2,nn)=(j-1)*(xnum+1)+i+1;<br>Â Â Â Â Â Â Â Cells(3,nn)=j*(xnum+1)+i+1;<br>Â Â Â Â Â Â Â Cells(4,nn)=j*(xnum+1)+i;<br>
       Cells(5,nn)=nn;<br>   end<br>end<br>% write VTK file<br>fp=fopen('Resault.vtk','w');<br>fprintf(fp,'# vtk DataFile Version 3.0\n');<br>fprintf(fp,'vtk output\n');<br>fprintf(fp,'ASCII\n');<br>
fprintf(fp,'DATASET STRUCTURED_GRID\n');<br>fprintf(fp,'POINTS %d float\n',NP);<br>for i=1:NP<br>Â Â Â fprintf(fp,'%e %e %e \n',Points(1,i),Points(2,i),0);<br>end<br>fprintf(fp,'\n');<br>fprintf(fp,'CELLS %d %d\n',NC,NC*4);<br>
aa=0;<br>for i=1:NC<br>Â Â Â aa=aa+1;<br>Â Â Â 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);<br>end<br>fprintf(fp,'\n');<br>fprintf(fp,'CELL_TYPES %d\n',NC);<br>
for i=1:NC<br>Â Â Â fprintf(fp,'%d\n',4);<br>end<br>fprintf(fp,'\n');<br>fprintf(fp,'POINT_DATA %d\n',NP);<br>Â <br>when i tried to open it with paraview.<br>it sayed "ERROR: In C:\berk\ReleaseBuilds\ParaView3\VTK\IO\vtkDataReader.cxx, line 2078 <br>
ERROR: In C:\berk\ReleaseBuilds\ParaView3\VTK\IO\vtkDataReader.cxx, line 2078<br>ERROR: In C:\berk\ReleaseBuilds\ParaView3\VTK\Parallel\vtkPDataSetReader.cxx, line 705<br>vtkPDataSetReader (0AEA4D18): Expecting 'DIMENSIONS' insted of: POINTS<br>
ERROR: In C:\berk\ReleaseBuilds\ParaView3\VTK\Parallel\vtkPDataSetReader.cxx, line 705<br>vtkPDataSetReader (0AEA4D18): Expecting 'DIMENSIONS' insted of: POINTS"<br>Â <br>What's the problem? could you help me?<br>
 <br>thank you very much.<br> <br>Best regards!<br clear="all"><br>-- <br>Yanchao Qiao<br>Ph.D student of Geodynamics<br><br>+86-136 010 926 41<br><br>College of Earth Science<br>Graduate University of Chinese Academy of Sciences<br>
<br>19A, YuQuan Road, Beijing, China, 100049<br><a href="mailto:Email%3Aoliver.qiao@163.com" target="_blank">Email:oliver.qiao@163.com</a>;<a href="mailto:oliver.qiao@gmail.com" target="_blank">oliver.qiao@gmail.com</a>;<a href="mailto:qiaoyanchao07@mails.gucas.ac.cn" target="_blank">qiaoyanchao07@mails.gucas.ac.cn</a><br>
<br></div></div>_______________________________________________<br>Powered by <a href="http://www.kitware.com/" target="_blank">www.kitware.com</a><br><br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
<br></blockquote></div><br></div></blockquote></div></div></div><div><div></div><div class="h5"><br><br clear="all"><br>-- <br>Yanchao Qiao<br>Ph.D student of Geodynamics<br><br>+86-136 010 926 41<br><br>College of Earth Science<br>
Graduate University of Chinese Academy of Sciences<br>
<br>19A, YuQuan Road, Beijing, China, 100049<br><a href="mailto:Email%3Aoliver.qiao@163.com" target="_blank">Email:oliver.qiao@163.com</a>;<a href="mailto:oliver.qiao@gmail.com" target="_blank">oliver.qiao@gmail.com</a>;<a href="mailto:qiaoyanchao07@mails.gucas.ac.cn" target="_blank">qiaoyanchao07@mails.gucas.ac.cn</a><br>
</div></div></blockquote></div><br>