Mathematica/AVS modules

PURPOSE
These modules allow communication between Mathematica and AVS.
With them one can transmit geometries and fields from Mathematica
to AVS and fields from AVS to Mathematica.

REQUIREMENTS
Mathematica: V2.1 Mathematica or later.
AVS: Pre-Version 4.0 AVS will need to modify the networks.

TO BUILD
Each directory contains C files, makefiles, a file of
Mathematica code and a txt file.  There are makefiles for
different systems.   The main difference between these is
the command which is used to start a window in which to run 
the Mathematica session.   This is xterm for a SPARC and
dxterm for a DECstation.

PROBLEM
To build modules for other than the DECstation there is a name 
conflict for string_to_argv which is defined in both the MathLink
and AVS libraries.  This can be simply resolved by editing the
MathLink library with an editor such as emacs and changing the
two instances of string_to_argv with a name of the same length
such as MLring_to_argv.   The MathLink library is called libML.a
and can normally be found in /usr/math/Bin.*/MathLink.

TO USE
When the module is invoked a window is started running Mathematica
with the input and output of the window directed to and from the
Mathematica session main loop.  Entering Mathematica commands
into the window will result in the appropriate Mathematica
results.  The session is initialised with a package of Mathematica
commands which have started a MathLink communication channel to AVS.
Other initialisations are made to support the behaviour of the
particular module.

The module will search for the package of Mathematica code, for
example AVSGeometry.m, in the following order

in directory math from the environment variable AVS_PATH
in the environment variable AVS_MATH_PATH
in /usr/avs/math
in ~
in ~/AVS
in ~/AVS/math
in .
in ./AVS
in ./AVS/math

if it fails to find the package in any of these an error will result.
Thus the package should be installed in one of these places.

The txt file is used for the documentation.   This should be placed
in somewhere which is on AVS_HELP_PATH for example in /usr/avs/math/help
Each txt file contains a sample network to build as well as some
sample commands to enter to the Mathematica to make them operate.


COPYRIGHT

You are free to copy and distribute these files. 
Feel free to modify and enhance them.

This work was done at WRI by Tom Wickham-Jones and Oleg Perelet with
help from Ham Lord and Robert Mazaika at AVS.

Comments can be sent to:
	Tom Wickham-Jones twj@wri.com
	Oleg Perelet	  perelet@wri.com


NAME
	geom from Math - Input a geometry from Mathematica

SUMMARY
	Name	geom from Math
	Type	Input
	Inputs	NONE
	Outputs	out1 - 	geom

	Parameters 
	Name		NONE

DESCRIPTION
	The "geom from Math" module allows three-dimensional graphics
	commands in Mathematica to supply AVS with an input geometry.

	When the "geom from Math" module is invoked an xterm is started
	running Mathematica with the input and output of the xterm directed
	to and from the Mathematica session main loop.  Entering Mathematica
	commands into the window will result in the appropriate Mathematica
	results.  The session is initialised with a package of Mathematica
	code which starts a MathLink communication channel to AVS.
	Other initialisations are made so the typical Mathematica three
	dimensional graphics commands such as Plot3D or ParametricPlot3D
	send their results into AVS rather than rendering them in the more
	typical Mathematica ways.


INPUTS

	There are no inputs to this module.

PARAMETERS

	There are no parameters to this module.

OUTPUTS
	out1 - geom

EXAMPLE NETWORKS
	This network will send any three-dimensional graphics created
in Mathematica into AVS.

			geom from Math
			      |
			geometry viewer
	
Mathematica commands such as 
	Plot3D[ Sin[ x y], {x,0,2Pi}, {y,0,Pi}]
or 
	ParametricPlot3D[ {Sin[z] Sin[t], Sin[z] Cos[t], z}, 
		{t,0,2Pi}, {z,-Pi,Pi}]
will then work.



RELATED MODULES
	There is a collection of modules which serve to connect Mathematica
	and AVS.   Examples are geom_from_Math, field3_from_Math and
	field2_to_Math.

SEE ALSO