Parallel Computing Toolkit
Examples

A Minimal Surface

This example shows the use of ParallelParametricPlot3D to compute a visual representation of an incomplete minimally immersed Klein bottle into (ℝ^3) with total curvature -4 π. The example was provided by Jeff Gaynor, Wolfram Research, Inc.

Reference:
J. J. Gaynor, Minimal Immersions of K into R^3, dissertation, Ruprecht-Karls-Universität, Heidelberg Germany (July, 1998)

Init

Parallel Processing Toolkit

Load the Parallel Computing Toolkit and the package with the parallel commands.

Needs["Parallel`Parallel`"]
Needs["Parallel`Commands`"]

Now, start any number of remote kernels. This command assumes that you have set up the list $AvailableMachines to list all normally available remote computers.

LaunchSlaves[] // TableForm

Find the number of available parallel kernels.

Length[$Slaves]

Optionally enable latency hiding.

$LoadFactor = 2;

The Surface Definitions

These auxiliary definitions are used in the function OneEnded that gives the coordinates of surface points depending on two parameters.

\(
\(nalphas[s_] := N[Exp[4*s]\  + \ Exp[2*s] + 1];\)\)
nbetas[s_] := 
        N[4*(-2*Exp[6*s] - 3*Exp[4*s] + 3*Exp[2*s] + 2)];
ners[s_] := N[Exp[2 s] - 1];
nArs[u_, s_] := 
        N[WeierstrassP[u, nalphas[s], nbetas[s]]  -  ners[s]];
nomps[s_] := N[EllipticK[N[-Exp[2 s]]]/Sqrt[3]];
nomqs[s_] := I*N[EllipticK[1 + N[Exp[2*s]]]/Sqrt[3]];

\(\(\(OneEnded[u_, \ 
          s_]\  := \ 
\ \ \ Module[{Ar, \ hOverg2, \ hgOver2, \ 
            h}, \ 
\ \ \ \ Ar\  = \ nArs[u, \ s]; \ 
          hOverg2\  = \ 
\ \ \ \ \ \ N[\((\((27*I)\)/2*E^\((3*s)\))\)/
                  Ar\  - \ \((\((81*I)\)/2*E^\((4*s)\))\)/
                  Ar^2\  + \ 
\ \ \ \ \ \ \ \ \((\((81*I)\)/2*E^\((5*s)\))\)/
                  Ar^3]; \ 
\ \ \ \ \ hgOver2\  = \ 
\ \ \ \ \ \ N[\(-I\)/2*
                  Ar^2\  - \ \((I/18*Ar^3)\)/E^s\  - \ \((3*I)\)/2*Ar*
                  E^s]; \ 
\ \ \ \ \ h\  = \ 
            N[\(-3\)*I*Ar*E^s\  - \ \((27*I*E^\((3*s)\))\)/
                  Ar]; \ 
\ \ \ \ \ Re[{hOverg2\  - \ hgOver2, \ 
              I*\((hOverg2\  + \ hgOver2)\), \ h}]];\)\(\ \)\)\)

Finally, send the surface definitions to all remote kernels.

ExportEnvironment[{nalphas, nbetas, ners, nArs, nomps, nomqs, 
        OneEnded}]

Parametric Plots

The Moebius Strip Inside the Surface

The surface contains a Moebius strip, which is made visible by restricting the parameter ranges suitable.

Here is a sequential preview using a small number of plot points.

\(\(ParametricPlot3D[
        OneEnded[
          x\  + \ I*y, \ \(-1\)], \ 
\ \ \ \ {x, \ \(-nomps[\(-1\)]\), \ 
          nomps[\(-1\)]}, \ 
\ \ \ \ {y, \ Im[nomqs[\(-1\)]]/2\  - \ 0.05, \ 
          Im[nomqs[\(-1\)]]/2\  + \ 
            0.05}, \ 
\ \ \ \ PlotPoints\  -> \ {15, \ 6}, 
        Compiled -> False];\)\)

Here is a low-resolution parallel rendering.

\(\(ParallelParametricPlot3D[
        OneEnded[
          x\  + \ I*y, \ \(-1\)], \ 
\ \ \ \ {x, \ \(-nomps[\(-1\)]\), \ 
          nomps[\(-1\)]}, \ 
\ \ \ \ {y, \ Im[nomqs[\(-1\)]]/2\  - \ 0.05, \ 
          Im[nomqs[\(-1\)]]/2\  + \ 
            0.05}, \ 
\ \ \ \ PlotPoints\  -> \ {24, \ 6}, 
        Compiled -> False];\)\)

Finally, a high-resolution parallel rendering.

\(\(S\  = \ 
        ParallelParametricPlot3D[
          OneEnded[
            x\  + \ I*y, \ \(-1\)], \ 
\ \ \ \ {x, \ \(-nomps[\(-1\)]\), \ 
            nomps[\(-1\)]}, \ 
\ \ \ \ {y, \ 
            Im[nomqs[\(-1\)]]/2\  - \ 0.05, \ 
            Im[nomqs[\(-1\)]]/2\  + \ 
              0.05}, \ 
\ \ \ \ PlotPoints\  -> \ {300, \ 12}, 
          Compiled -> False];\)\)

An alternate rendering of the same surface data.

\(\(\(\ \ \)\(Show[Graphics3D[{EdgeForm[], \ S[\([1]\)]}], \ 
        PlotRange\  -> \ All, \ 
\ \ \ Boxed\  -> \ False];\)\)\)

The Complete Surface

We render the complete surface in two steps. First, we generate the graphic object in parallel (but do not display it).

T = ParallelParametricPlot3D[OneEnded[x + I*y, -1], 
    {x, -nomps[-1], nomps[-1]}, 
    {y, Im[nomqs[-1]]/2 - 0.2, Im[nomqs[-1]]/2 + 0.2}, 
    PlotPoints -> {300, 5},DisplayFunction->Identity,Compiled->False];

Now we render it. Rendering is necessarily sequential.

Show[Graphics3D[{EdgeForm[], T[[1]]}], PlotRange -> All, 
   Boxed -> False];

Cleanup

CloseSlaves[]