MathGroup Archive 2008

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: In V7, is it possible to parallelize DensityPlot?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg94350] Re: In V7, is it possible to parallelize DensityPlot?
  • From: Szabolcs Horvát <szhorvat at gmail.com>
  • Date: Thu, 11 Dec 2008 03:42:35 -0500 (EST)
  • Organization: University of Bergen
  • References: <gglsti$8gk$1@smc.vnet.net> <ggog30$s7s$1@smc.vnet.net>

Jens-Peer Kuska wrote:
> Hi,
> 
> sincs version 6. Mathematica uses an adaptive mesh for the density plot
> and there are *no* in the plot. Only triangles as to see from:
> 
> DensityPlot[Sin[x*y], {x, -Pi, Pi}, {y, -Pi, Pi}, Mesh -> All]
> 
> and since the mesh subdivision seems to be a global operation it
> would be very hard to parallelize it.
>

Jens,

I have to disagree here.  The mesh subdivision is based on a square 
grid, and while there may be difficulties at the position where the 
domain is split in two, it should definitely be possible to calculate 
the function values in parallel (provided that the function that is 
being plotted is a well behaved function, and has no internal state).

expr = Abs[(4 (-1)^(2/3) -
      9 (x + I y)^2)^3/((9 + 4 (-1)^(1/3) (x + I y)^2)^3 (x + I y)^3)];

p1 = DensityPlot[expr, {x, -3, 3}, {y, -3, 3}, Mesh -> All,
   ColorFunction -> (RGBColor[1, 1, 1, 0] &), PlotPoints -> 15,
   MeshStyle -> Blue]

p2 = Show[
   DensityPlot[expr, {x, -3, 0}, {y, -3, 3}, Mesh -> All,
    ColorFunction -> (RGBColor[1, 1, 1, 0] &), PlotPoints -> {8, 15},
    MeshStyle -> Red],
   DensityPlot[expr, {x, 0, 3}, {y, -3, 3}, Mesh -> All,
    ColorFunction -> (RGBColor[1, 1, 1, 0] &), PlotPoints -> {8, 15},
    MeshStyle -> Red], PlotRange -> All]

The meshes generated in the two cases do not differ significantly:

Show[p2, p1]

> The final rendering is done by the graphics card and since it is a IO
> operation it can't be parallel outside of the graphics card.
> 


  • Prev by Date: Re: Plot vs NMaximize
  • Next by Date: Re: Run initialization cells before dynamic cells
  • Previous by thread: Re: In V7, is it possible to parallelize DensityPlot?
  • Next by thread: Re: Small question about Filling between two functions in a