Re: Optimize speed of plotting mesh
- To: mathgroup at smc.vnet.net
- Subject: [mg99741] Re: Optimize speed of plotting mesh
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Tue, 12 May 2009 05:44:45 -0400 (EDT)
- Organization: Uni Leipzig
- References: <gub76t$48t$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
Hi, and ContourPlot3D[] doesn not accept data on a regular grid anymore ? My Mathematica 7 does data = Table[ Sin[x*y*z], {x, 0, Pi, Pi/8}, {y, 0, Pi, Pi/8}, {z, 0, Pi, Pi/8}]; ListContourPlot3D[data] and your "coordinates" generation is complete useless. And it is not better for an interpolation when you remove values. Regards Jens Gehricht at googlemail.com wrote: > Dear MathGroup! > > I have to bring coordinates with the corresponding mesh (at each > coordinate) together. The question is not, how do it but how to do it > more efficiently. The following steps are necessary > > a) Generation of the coordinates from a dx in each spatial direction. > At the moment I am doing this with table > > coordinates=Table[i*dx+j*dy+k*dz,{i,0,imax},{j,0,jmax},{k,0,kmax}] > > which seems to be the true bottleneck (takes 24 sec's for 2299968 > Points) > > b) Bring coordinates and mesh together > > (Flatten[#1]) & /@ Transpose[{coordinates, mesh}] > > Takes about 6 secs > > c) Delete Cases, in which the mesh data is lower than a certain value > > choppedData=DeleteCases[data, {_, _, _, x_ /; x <= 10^-4}] > > Also takes about 6 secs. Might be unnecessary, but I thought it is a > good idea to decrease the number of mesh points for the CounterPlot. > > d) Plot the mesh > > ListContourPlot3D[choppedData, Mesh -> None, Contours -> 5, > PlotRange -> All, MaxPlotPoints -> 50, > ContourStyle -> Yellow] // Timing > > I guess, this can be improved by Interpolation of the data, though I > have not tried it yet. I have to use a large value for MaxPlotPoints, > because otherwise the mesh does not look smooth. > > With thanks for your help > Yours Wolfgang > >