1 Introduction

2 Installation

2.1 Components of Slinky

2.2 Stuff required

2.3 Instructions

3 Features

3.1 Initial value problem

3.2 Animations

3.2.1 Homotopy

3.2.2 Variation of parameters

3.2.3 Frames

4 Requests

Slinky is a package built to solve an initial value problem concerning an elastic rod whose initial configuration is a straight rod. The model is derived from the theory of unshearable and inextensible rods. The code was formerly written in C++/OpenGL. Some customizations were possible by changing the values of certain parameters of the computation in a text file.

For visualization tasks, the LCVM laboratory has developed DataViewer, a software that allows to use OpenGL in an easier and more powerful manner. Its philosophy is to provide classes in C++ that allow to start from more complex primitives without having to write the code using simple OpenGL primitives each time.

As we said above, DataViewer provides classes, i.e objects, that we may use to construct the geometrical objects we need. The most useful classes are

- DVpoints
- DVlines
- DVspheres
- DVtriangle_grid
- DVtriangle_strip

For example, we understand in seeing
the core code of DataViewer that DVlines inherits from DVpoints. Generally, the power of an
object oriented programming language is in the reusability of code. Moreover,
it is very pleasant to derive a complex primitive from another that is
simpler.

Slinky was initially composed of a file named "slinky.cc" containing all the code needed to represent the solution of the problem, combining C++ code and OpenGL functions with glu interface. The numerics is done by a file called "ivp.E.f" written in Fortran. The latter contains two function definitions that are "dna_data_compute.f" and "ode.f", which is the real solver. This function computes a system of N differential equations of first order in N variables, that can explicitly depend on the time or not. For our problem the time represents the arclength of the rod. The number N is in our case equal to fourteen.

The easiest way to construct a new base for Slinky is to rewrite all the code in order to translate it from a C++/OpenGL program to a DataViewer one so that we may integrate it in other computational programs of of the lab without difficulty. Moreover, it will be interesting to construct a more efficient interface for the Slinky package that we will write in the Python language that is the interfacing standard for DataViewer and the other packages developped in the lab. Schematically, the code of DataViewer receives input from the Ivp solver and from the interface. The output of the solver is the computed solution containing all the points of the curve. The interface provides the values of some geometrical parameters and allows to choose between a certain number of visualization options for the curve. The interface also communicates the physical parameters of the computation to the Ivp solver.

First of all, Slinky needs . After downloading it, follow the installation instructions. Don't forget to verify that you also have the libraries needed by DataViewer. Some frequent errors are to forget to initialize some environment variables. If you use the bash shell with a Linux box, you may need to do:

- export DV=foo/DataViewer
- export GRAPHIC_LIB=Mesa

where foo is the absolute path to the DataViewer directory. People who use other platforms (Sun,SGI,...) have to look at the installation documentation for DataViewer very carefully.

Installing Slinky is very easy once you have DataViewer working. The file you download is a compressed one in tar format. or and copy it in the "applications" directory of DataViewer. After that, uncompress it with a tar instruction. You should have now a directory named Slinky. I sum up the steps

- cp slinky.tar foo/DataViewer/applications
- cd foo/DataViewer/applications
- tar xvf slinky.tar

After that, you have to compile the package

- cd Slinky
- make LCVM_ARCH=`uname`

Normally, it should work!

Slinky has several components built to study Initial Value Problem IVP. From a numerical point of view, Slinky uses a solver called Vode in double precision that may treat stiff and non stiff problems. You will see the amazing shapes that a straight rod may have under the different initial conditions you choose. The goal of Slinky is to link a powerful solver and a strong tool for visualizing the computed solution. Numbers by themselves say nothing, but binding them into DataViewer brings transparency!

Generally, solving the IVP is easy. You have to launch slinky. To sum up, you have to type

- cd foo/DataViewer/applications/Slinky
- ./slinky

You should see two windows as shown below

Once you get that, you may begin to introduce your parameters in the different areas of the control panel.

You have four buttons that let you customize the problem. "IVP" is associated to the initial parameters and variables. "Geometry" to the geometrical parameters. "Material" and "Frenet" to the frames that you may want to represent or not. Quit may be pressed, once you have finished all your computations.

Inspect a little the IVP feature. You see that you have several variables and parameters that you may modify. Always be careful to write numbers in the entries, because you will get an error if you introduce something else when the computation will begin.

- m1, m2 and m3 are the components of a couple acting on one of the extremities of the rod.
- n1 is the net force acting at the same extremity of the rod that the couple.
- phi ,theta and psi are the Euler angles for the orientation of the initial material frame according to the fixed frame designing by the base grid.
- i1 ,i2 and i3 are the inertial coefficients for twisting and bendings respectively.
- u1 ,u2 and u3 are the initial stress configuration for twisting and bendings respectively.
- length is simply that of the rod.
- density is the uniform concentration of material points along the rod.

When you have finished with this panel, click on OK to modify other things. Look at the Geometry panel !

With this panel, you may customize the graphical features of the objects appearing in the window, representing the rod.

- width of the curve.
- red, green and blue for the color of the centerline in RGB.
- curve allows to render the rod. 0 for no curve and 1 for rendering it.
- width is the radius of the segments of the grid.
- red, green and blue for the color of the grid in RGB.
- xsize, ysize and zsize are the length of interval between the segments.
- xoff, yoff and zoff are the coordinates of the origin, which is also the position of the fixed extremity of the rod.

It is also possible to attach a frame along the rod. We have provided two types of frames : the first is the material frame of the rod that is derived directly from the computation. The second is the Frenet frame that is computed by considering only the position vector and its derivatives.

The panel for the Frenet frame is designed in the same manner.

- frame allows you to render the frame or not. 0 for no frame and 1 for rendering it.
- the following labels allows you to modify the RGB colors for each of the basis vector T (tangent), N (normal),B (binormal).

After having customized your problem, you may launch the computation. Click on the File button. In the menu that appears, click on User and a little window will be generated containing a button labeled Draw. Finally, click on it and you should see a a result like the following

Here is an example of a material frame !

You may zoom, displace and rotate the figure as you want with the mouse or the cursors.

An interesting feature of DataViewer is to provide animations. Slinky gains very much of it.

A homotopy of the rod was developed in collaboration with Joel Langer. Slinky allows to observe the deformation dynamically. You launch the homotopy application in typing ./homotopy. You should see the two following windows

You have to click on the homotopy button to modify the parameters of this transformation

- tmin and tmax are the bounds of the interval of variation for the deformation of the rod.
- alpha is a speed parameter controlling the deformation between each sequence step.
- eps is the precision parameter of the homotopy

The other 4 parameters have the same meaning as for the Centerline section in the Geometrical Values panel seen before.

Let have a look now to an important feature of the package that allows us to see the impact of a variation on one or several external variables, i.e. the three components of the couple m and the net force n.

This Slinky feature allows you to recompute by modifying the IVP parameters and visualize the variation of the rod as an animation. Launch the variation part by typing ./variate. You will obtain these windows:

Most of the buttons are known, see more precisely to the Variation one.

- m1, m2, m3 ,n1 are Boolean variables. 0 means that the parameter will not vary, and 1 leads to its variation.
- dm1, dm2 ,dm3 ,dn1 are the steps of variation for each components.
- sequences is the number of generated frames.

When you have finished with the modifications, click on File and User. You will obtain the Draw button. Click on it ! After a little time, a shape will appear in the rendering window. As for the homotopy, click on the Animate button. Enjoy !

The following images contain samples of an animation sequence:

The last feature of Slinky provides an animation of the motion of the Frenet frame.

Type ./frenet to get this feature. As the other possibilities of the package, you obtain the windows

You have standard buttons. All the controls of this part of Slinky are identical to those previously described. Customize, then click File, User and Draw. Wait until a shape appears in the main window. Click Animate and so on.The following images contain some samples of the animation:

You can look at more samples by clicking on the first image on the top
of this document.

You may ask me any about Slinky, or contact the
laboratory.