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 If you use Mathematica V2.1 to build the 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/lib... TO USE When each 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. TROUBLESHOOTING If the module does not start up properly or if a Mathematica session does not appear in a window on the screen the problem is almost certainly that the Mathematica package has been loaded. A message will be printed on the terminal from which avs was started. Follow the instructions in the previous paragraph to rectify the situation. 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