MandelbrotGen

Synopsis

Generates the mandelbrot set.


module MandelbrotGen <build_dir="iac_proj/mandel",
  src_file="mandel.cxx",
  out_hdr_file="gen.h",
  out_src_file="gen.cxx",
  libdeps="FLD",
  cxx_hdr_files="fld/Xfld.h">{
  MandelbrotParams &MandelbrotParams <NEportLevels={2,0}>;
  double leftx => MandelbrotParams.leftx;
  double rightx => MandelbrotParams.rightx;
  double topy => MandelbrotParams.topy;
  double bottomy => MandelbrotParams.bottomy;
  double max_value => MandelbrotParams.max_value;
  int max_iter => MandelbrotParams.max_iter;
  int resx => MandelbrotParams.resx;
  int resy => MandelbrotParams.resy;
  Mesh_Unif+Node_Data+Xform out <NEportLevels={0,2},NEcolor2=16776960> {
    ndim = 2;
    dims => {<-.resx,<-.resy};
    nspace => ndim;
    nnode_data = 1;
    node_data {
      values+byte;
      null_value+byte;
      min+byte;
      max+byte;
      min_vec+byte;
      max_vec+byte;
    } = {{veclen=1,,,,,,,,}};
    points => {{<-.leftx,<-.bottomy},{<-.rightx,<-.topy}};
  };
  cxxmethod+notify_inst+req update (
    .leftx+read+notify+req,
    .rightx+read+notify+req,
    .topy+read+notify+req,
    .bottomy+read+notify+req,
    .max_value+read+notify+req,
    .max_iter+read+notify+req,
    .resx+read+notify+req,
    .resy+read+notify+req,
    .out+write );
};


Description

MandelbrotGen generates mesh and node data that represents a view of the mandelbrot set. The location of a rectangular portion of the mandelbrot set, and the limits of the algorithm can be specified through either a MandelbrotParams object or by explicitly setting the parameters within the object. The number of iterations is output as a single byte of node data. The node data is mapped onto a uniform mesh that is generated from the input parameters.

Inputs

&MandelbrotParams

Reference to the parameter block, which contains real instances of the parameters for the mandelbrot function.

leftx

Position of the left edge of the mandelbrot set. The value is of type double. This is the minimum real number that the mandelbrot function iterates over. Normally the value of this parameter is found by referring to the parameter block, which is referenced by the &MandelbrotParams input.

rightx

Position of the right edge of the mandelbrot set. The value is of type double. This is the maximum real number that the mandelbrot function iterates over. Normally the value of this parameter is found by referring to the parameter block, which is referenced by the &MandelbrotParams input.

topy

Position of the top edge of the mandelbrot set. The value is of type double. This is the maximum imaginary number that the mandelbrot function iterates over. Normally the value of this parameter is found by referring to the parameter block, which is referenced by the &MandelbrotParams input.

bottomy

Position of the bottom edge of the mandelbrot set. The value is of type double. This is the minimum imaginary number that the mandelbrot function iterates over. Normally the value of this parameter is found by referring to the parameter block, which is referenced by the &MandelbrotParams input.

max_value

The "bailout value" for the mandelbrot set. The value is of type double. The iteration at a point is stopped when the magnitude of the complex number Z(n) exceeds this value ( i.e. |Z(n)| = x^2 + y^2 > max_value ). Normally the value of this parameter is found by referring to the parameter block, which is referenced by the &MandelbrotParams input.

max_iter

The maximum number of iterations that are performed at a point. The value is of type int. If the magnitude at a point is less then the "bailout value" after this number of iterations then the point is assumed to have reached a steady state and therefore no more iterations need to be performed. The maximum number of iterations possible is 255, and values above this level are ignored. Normally the value of this parameter is found by referring to the parameter block, which is referenced by the &MandelbrotParams input.

resx

The horizontal resolution of the generated data. The value is of type int. This is the number of lines that are plotted in each horizontal row of the mesh. Normally the value of this parameter is found by referring to the parameter block, which is referenced by the &MandelbrotParams input.

resy

The vertical resolution of the generated data. The value is of type int. This is the number of lines that are plotted in each vertical column of the mesh. Normally the value of this parameter is found by referring to the parameter block, which is referenced by the &MandelbrotParams input.

Outputs

out

The output field containing Mesh_Unif and Node_Data. The uniform mesh is generated from the horizontal and vertical resolutions input to the module. The node data uses a single byte to store the number of iterations at each point, therefore the maximum number of iterations that can be represented is 255.

Utility Macros

The low-level MandelbrotGen module is used in the User Macro mandelbrot. Additionally, this macro also uses the MandelbrotParams parameter block group object, as does the MandelbrotUI UI Macro.

Example

An example application MandelbrotEg is provided, which generates a large scale portion of the Mandelbrot Set and displays it using the Uviewer2D standard data viewer.

Files

iac_proj/mandel/mandmods.v contains the MandelbrotParams group and the MandelbrotGen module V definitions.

Other Notes

The low-level MandelbrotMods library containing the module MandelbrotGen does not specify a process. By default the express process will be used.

Authors

Paul G. Lever
Andrew Dodd

Contact

International AVS Centre
Manchester Visualization Centre
Manchester Computing
University of Manchester
Oxford Road
Manchester
United Kingdom
M13 9PL