NPIB1.6 User's Guide

by

Ronald D. Kriz, Associate Professor
Engineering Science and Mechanics
Virginia Polytechnic Institute and State University
Blacksburg, Virginia 24061


Table of Contents:

  1. Introduction
  2. Installation
  3. Set up "public_html" for JWave and NPIB"
  4. "How-to" NPIB-form tutorials:
  5. Frequently asked questions:
  6. Known bugs:


1.0 Introduction:

Newtwork Programming Interface Builder (NPIB) is a Graphical User Interface (GUI) tool that educators and researchers can use to create, maintain, and archive numerous parametric studies based on their legacy computer simulations. With NPIB users can create an interactive and collaborative Web-based working environment. Although NPIB uses standard Java, it is designed so that the community of scientists and engineers can build an NPIB working environment without knowledge of Java programming.

For educators NPIB provides a format that instructors can use to develope interactive modules based on computer simulation legacy codes that students can access and learn across a platform independent Java environment of a Web server. Instructors can more accurately monitor and evaluate students progress.

For researchers NPIB provides a format that scientists and engineers can develope a collaborative environment where participants can submit, monitor, and share computer simulation results running in real-time on a heterogeneous network of different remote-site computers unique to each researcher.

DISCLAIMER:

Below we provide instructions on how to install, create and use NPIB. NPIB is not commercially supported, hence we provide NPIB here AS IS with out any implied waranty. While we did our best to create an application that performed well without errors, we do no make any quarantees about its suitability to any particular purpose. By installing and running this program you explicitly agree to accept the terms of this statement. If you find a bug please send us a description of the bug, including as much information as you can. While we cannot guarantee a prompt fix, we would appreciate your feedback and try to help as we can.


2.0 Installation

I. Software:

Required Software:

  • A web server with access to a directory that supports CGI execution.
    Apache was used to develop NPIB. It can be obtained from http://apache.org

  • Java 1.1.8 or Java 2 runtime environment (JRE).
    It can downloaded from http://java.sun.com

  • NPIB. Download form.tar from http://www.jwave.vt.edu/npib/npib.tar

Software Required if NPIB Uses Remote Execution:

  • SSH
  • Expect
  • TCL

NOTE: TCL and Expect are open source applications,
                which may already be installed on your system.

  1. - For Solaris OS go to: http://www.sunfreeware.com.
  2. - For other OS go to: http://dev.ajubasolutions.com/.

II. Setting up NPIB

  1. Extract the contents for the npib.tar file using the command:

            tar -xvf npib.tar

  2. Create a directory for the NPIB support scripts.
    This directory should not be web accessible.

            Example: mkdir /usr/local/npib

  3. Copy ssh.exp, scp.exp, and local.sh to the directory you created in step 2.
    These files should have been extracted from the npib.tar file in step 1.

            Example: cp ssh.exp scp.exp local.sh /usr/local/npib

  4. Create a CGI-accesible directory for the NPIB scripts.

            Example: mkdir /apache/htdocs/cgi-bin

  5. Copy npib.cgi, npib.command, and npib.config to
    the CGI-accesible directory you created in step 4.
    These files should have been extracted from the npib.tar file in step 1.

            cp npib.cgi npib.command npib.config /apache/htdocs/cgi-bin

  6. Create a web-accessible directory for output
    which the web server has permission to write to.

            Example: mkdir /apache/htdocs/output
                             chmod 755 /apache/htdocs/output
                             chown nobody /apache/htdocs/output

  7. Create a web-accessible directory for the Java Form file
    which the web server has permission to write to.

            Example: mkdir /apache/htdocs/form
                             chmod 755 /apache/htdocs/form

    NOTE: The directorys relative web location will be required
                    when users create NPIB forms.

  8. Copy form.jar to the web-accessible directory you created in step 7.
    This file should have been extracted from the npib.tar file in step 1.

  9. Edit the npib.config file that you put in the CGI-enabled directory in step 5.
    The npib.config file should look like:

    outroot /www/jwave/output/
    webroot /output/
    commandfile npib.commands
    tempname npib.in
    sshScriptDir /www/jwave/cgi-bin/
    hostname www.jwave.vt.edu
    email rlevensa@spelunker.sv.vt.edu

    Make the following changes:

    outroot - change this to the directory you created in step 6
    webroot - set this to the path of the outroot directory,
                         as seen by the web server.
    commandfile - this does not need to be modified.
                               This file states where the users command files are located.
    tempname - this does not need to be modified
    sshScriptDir - set this to the path of the directory you created in step 2
    hostname - set this to the full dns name of this web server
    email - this address will be the FROM address used when results
                     are mailed to users. Set this as desired.

  10. Edit the npib.cgi file that you put in the CGI-enabled directory in step 5.
    The npib.cgi file should look like:

    #!/bin/sh
    export CLASSPATH
    CLASSPATH=/usr/local/java2/lib/:/apache/htdocs/form/form.jar
    /usr/local/java2/bin/java form.run.CGIReceiver $QUERY_STRING

    Make the following changes:

    a.) Set the CLASSPATH variable to include the jar file from step 8,
           and the standard java runtime classes

    b.) Change the last line of the script so that it points the
           java runtime binary on your machine.

  11. Edit the npib.commands file that you put in the CGI-enabled directory in step 5.
    The npib.commands file should look like:

    kriz /export/home/rkriz/npib/npib.commands

    The npib.commands file will consist of multiple one-line records.
    Each record is used to tell NPIB the commands file for each user.
    A line consists of two fields, delimited by a space:

    <username> <full patch to the users command file>

    Add a line to this file for each NPIB user.
    The format of a users command file is discussed in the
    NPIB General Users Guide.

3.0 Set up "public_html" for JWave and NPIB


4.0 "How-to" NPIB-form tutorials


4.1 How-to-create NPIB1.6-forms. Example: Polar Plot, module02

For NPIB1.6 modules a split web page appears with the NPIB1.6 form in the lower frame and the upper frame appears with the "how-to-use" instructions. The lower frame is created by a java form1.6 builder. This web page describes how to create the NPIB1.6 form for the polar plot module02 as an example.

The NPIB1.6 form, shown below, appears in the lower frame.

We provide a NPIB1.6 form editor ("form.jar") that creates new NPIB1.6 (*.html) files or edits existing NPIB1.6 (*.html) files. On the server spelunker.sv.vt.edu this NPIB1.6 form editor is located in two places:

  1. /www/jwave/npib/form.jar_Archive/form.jar_1.6/form.jar
    (form.jar ver1.6 is archived in this directory)

  2. /home/"username"/npib/form.jar
    NOTE: a home-directory "username" corresponds to a user-account on the server.

In this case the /home/"username"/npib/form.jar is accessed by setting both the PATH and CLASSPATH to this directory. With these two paths set any NPIB file (*.html) can be edited in any directory when you logged onto the server (i.e. spelunker.sv.vt.edu).

echo $PATH --> ... /home/"username"/npib: ....

echo $CLASSPATH --> ... /home/"username"/npib/form.jar: ....

For this example on the server spelunker.sv.vt.edu we can go to the directory /www/jwave/crcd/kriz/modules/module02 and edit the file new_polar.html with the following command at the UNIX prompt.

   spelunker% form1.6 -e polar.html

To create a new NPIB file at the UNIX prompt type...

   spelunker% form1.6 -e

You can give this file a name using the Save option when you leave the editor.


Only one "Working Window" should appear on your monitor**: (1) "NPIB Creator". The earlier 1.5 version also generated a second window: "Output Editor". IF you are logged onto the server (i.e. spelunker) from a remote workstation and are using NPIB1.6 form.jar file on the sever (i.e. spelunker), then you must have setup the environmental DISPLAY variable to display X-windows back to your remote workstation**. But if you are using NPIB1.6, we recommend that you install your own NPIB1.6 form.jar file in the ~/bin directory off of your home directory similar to how the NPIB1.6 form.jar file was setup on the ~/bin directory on the server (i.e. spelunker). If you are creating the NPIB1.6 file (*.html) on a remote machine it is not necessary to ftp transfer the NPIB1.6 file (*.html) to the server (i.e. spelunker) because the newer NPIB1.6 form editor has a "Save Local" or "Save Ftp" feature built into NPIB1.6 form editor that transfers the edited NPIB1.6 form file to a directory on the server (i.e. spelunker). This will be explained in more detail below.


Information for working with the NPIB Creator "Working Window"

At the top of the NPIB Creator "Working Window" you can select from a number of pulldown menu options.

At the top of the NPIB Creator window under File, the choices are as expected New, Open, Save and Exit. Under Edit there is only one choice -- Remove which removes the last entry that was created form the items under Insert shown below.

Under Insert the choices are Text Field, Label, and Button. The majority of the time you will select a Text Field box with a Label above the box. A Button is used to select or initiate a task, for example the Submit button is used to create a file, in this case polar.dat, from the information on the NPIB form and then submit this file to the application for processing.

When and item is selected under Insert an Insert-window appears prompting you to enter a unique name for this item: Text-Field, Label, Button. This name will be used again in the Output Editor "Working Window".

After you have entered a unique name followed by OK, the item should appear in the the upper left corner of the NPIB Creator window. To move and reposition the button, label, or text-field items, simply select the item to be moved by holding down the left mouse button over the item on the NPIB Creator "Working Window" and drag (hold down mouse button while moving the mouse) the item by moving the mouse to the desired location. When you let go of the mouse button the item will appear in the new location. NOTE: you will not see the item "move" but rather the item will re-appear in the new position of the NPIB form near the location where the left mouse button was released. You may have to reposition the selected item a second time and "fine-tune" the the exact location. This is not intuative and takes some practice. In this way all of the items (Text Field, Label, Button) of a working NPIB form can be created and positioned as desired.

HELPFUL HINT: unless you have an excellent memory you may want to maintain a hand written sketch on a seperate piece of paper as you build your NPIB form where the "unique name" is written next to the item as you build the form. You will need to access some of these "unique names" again when building the file data format in the Output Editor "Working Window".

Next you will want to assign more information to your button, label or text-field. When a text field, label, or button is selected with the left mouse button a "Properties" window appears that requires you enter specific infomation for that item. For example the figures below show Property windows for each of the items: Text Field, Label, and Button.

Common to all these windows are constraints, foreground, background, and font. If the item is the last in a row you must specify this by changing the "Grid Width" constraint parameter from 1 to 0. Default for the "Grid Width" parameter is one "1".

Experiment with and change foreground, background, and font as needed.

Text Field Property Window options: selectionStart, text, columns, caretPosition, and selectionsEnd:

The Text Field properties window has the most options: selectionStart and selectionEnd define the beginning and end of the text-field displayed in the text entry window just below the sectionStart display window. The possiblilities here are too numerous to spell out in detail so the best way to learn about these options is to experiment and see how each of them effect the NPIB form format.

The editable: True/False button at the bottom can be selected so that the form user can not edit the displayed text if False is selected.

Label Property Window options: alignment

Options for the labels are the same as for Text Field except for the alignment option which left justifies the text if set to 0 and centers the text if set to 1.

Only the Label Property Window initially sets the name and text equal. Typically the Label_name and text have different entries. "Text" is what the users sees on the final NPIB form and "name" is the unique Label_name assigned at the time the item is created with Insert and is hidden except if viewed in this property window.

Button Property Window options: actionCommand

There is only one unique option for the Button Properties, that is the actionCommand. In our case there is only one button which is the submit button. The actionCommand only makes sense within the shell script. This feature has only been used for the submit button.


Information for working with the Output Editor "Working Window"

This "Working Window" describes how the data that is displayed in the NPIB form will be formatted in the file submitted to the shell script.

For comparison the resulting file polar.dat shown below corresponds to the syntax shown above.

GRAPHITE-EPOXY
EPOXY ELASTIC PROPERTIES ( N/M**2 )
   EPOXY YOUNGS MODULUS,   EM=+5.280E+09
   EPOXY POISSONS RATIO,  NUM=0.354
FIBER ELASTIC PROPERTIES ( N/M**2 )
 FIBER LONGITUDINAL YOUNGS MODULUS, EFL=+2.320E+11
 FIBER TRANSVERSE YOUNGS MODULUS,   EFT=+1.500e+10
 FIBER SHEAR MODULUS L-T PLANE,    GFLT=+2.400e+10
 FIBER SHEAR MODULUS  T  PLANE,    GFTT=+5.020E+09
 FIBER PLANE STRAIN BULK MODULUS,  KFTT=+1.500E+10
FIBER VOLUME FRACTIONS: 0.00 0.60 1.00

At the top of the "Working Window" there are two entries: (1) the name of the shell script and (2) is any other parameter the shell script might need.

The next entry links the TextField_name as the return email address when shell script is completed.

The final entry is the window where the format is set with links to each of the textfield_names. The very first line in this window defines the filename where data is stored according to the format specified in the lines below. Here spaces are important if the program reading this file as data input requires accurate spacing which seperates the numbers associated with textfield_name. Notice that all numbers associated with textfield_names use the syntax, <link="textfield_name"\> . Recall that the textfield_names were assigned when the textfield was first created. This is why the HELPFUL HINT recommended that you keep a sketch of textfiled_names associated with the numbers in the boxes on the NPIB form. You can always verify the textfield_name associated with the texfield_item on the NPIB Creator "Working Window" but it is quicker if you use a sketch.


Direct Editing NPIB1.6 Files Using a Text Editor: It is possible to directly edit the syntax of the NPIB1.6 (*.html) file because it is a text file and the syntax is simple enough to understand. We only recommend that in some instances this may be an option to consider when the forms are particularly large where you may want to copy and paste large blocks. In this case again the item_name is key to finding the portion to edit.


**NOTE: If you are logged onto the server (i.e. spelunker.sv.vt.edu from a remote workstation make sure you either use ssh or setup xhost "server-name" and setenv DISPLAY "remote-workstation.IP.name:0.0" so that X-Windows are sent back to your remote-workstation monitor. YOU MAY NEED TO REPOSITION THE WINDOWS USING ALT-F7

4.2 How-to-use NPIB1.6 forms. Example: Polar Plot, module02

For NPIB modules a split web page appears with the NPIB form in the lower frame and the upper frame appears with the "how-to-use" instructions. The upper frame also includes a link to an archived WYSIWYG result if the user submits the NPIB form "as-is". The upper frame can also include supporting information and other links to supporting information about the module such as definitions and background information.

Example of Upper frame instructions:

Example of Lower frame NPIB form:

The user can highlight and change any values in the NPIB form except....

!!!!! RESTRICTION: THE FIELD LENGTH AND FORMAT MUST BE MAINTAINED !!!!!
Plane Stain Bulk Modulus
Correct change:    OLD: +1.500E+10    NEW: +1.857E+10
Incorrect change: OLD: +1.500E+10    NEW: +1.8567E+10

Make sure you change the email address so that the link to the results are sent to your email address.

When the submit button in the NPIB form is selected a new web page appears with a unique directory name. We suggest that the user "Reload/Refresh" this web page and observe the numerical calculations dynamically. When the calculates are completed the excess files are removed and the user can select the appropriate *.html file to see a visual summary of the results.

After a few minutes the calculations are completed and excess files removed.

Of course this particular job is archived in the http://www.jwave.vt.edu/output for future reference and this directory name should be written down for future access. Unlike the JWave interface, the NPIB interface allows the user to dynamically view the numerical calculations as they are taking place and when completed the user has access to all results for future analysis.


5.0 Frequently asked questions


6.0 Known bugs


Contact:
Dr. Ron Kriz
Created 6/24/01 | Revised
http://www.jwave.vt.edu/crcd/archives/npib1.6/usersguide/usersguide.html