NPIB1.6 User's Guide

by

Ronald D. Kriz*, Associate Professor
Randy T. Levensalor**, Graduate Research Assistant
* Engineering Science and Mechanics, and ** Computer Science
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. However installing NPIB and creating a working environment on an existing Apache Web server, requires a basic understanding of shell scripts and configuring unix system level environmental variables in each user's public_html directory.

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 not 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. Contact Ron Kriz at rkriz@vt.edu.


2.0 Installation

2.1. Software:

2.1.1 Required Software:

2.1.2 Additional Software Required if NPIB Uses Remote Execution:

Example: location of files (ssh,expect,tclsh) on local and remote computers

NOTE: TCL and Expect are open source applications, which may
                             already be installed on your system. For open source software
                             on Solaris OS go to: http://www.sunfreeware.com.

2.2 Setting up NPIB: Web-server system administrator

2.2.1 Download and extract the contents for the npib.tar file

           Choose a temporary installation directory
           http://www.jwave.vt.edu/npib/npib.tar
           tar -xvf npib.tar

2.2.2 Create a directory for the NPIB support scripts.

           This directory should not be web accessible.

           mkdir /usr/local/npib

2.2.3 Copy ssh.exp, scp.exp, and local.sh files to the directory created in step 2.2.2

           These files should have been extracted from the npib.tar file in step 2.2.1

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

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

           mkdir /apache/htdocs/cgi-bin

             i.e. on our Web server we used apache virtual hosting
             where /apach/htdocs/ is replaced with /www/jwave/ and
             "www.jwave.vt.edu" has been defined as a virtual host.

2.2.5 Copy npib.cgi, npib.command, and npib.config to the CGI directory created in step 2.2.4

           These files should have been extracted from the npib.tar file in step 2.2.1

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

2.2.6 Create a web-accessible "output" directory for archiving simulation results

           This "output" directory is created so that web server has permission to write to it.

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

NOTE: the "output" directory can be located anywhere. For example if
             only one user is using NPIB you can locate the output directory in
             that users ~/public_html/ directory and let that user manage their
             own archived results. For multiple users we have located the output
             directory on an 18GB disk mounted in the /etc/vfstab file at mount
             point /www/jwave/output/ and used cron to check and clean up
             directories that exceed a predetermined number of months/weeks.

2.2.7 Create a web-accessible directory for the Java Form file (form.jar)

           Create this directory so the web server has permission to write to.

                   mkdir /apache/htdocs/form
                   chmod 755 /apache/htdocs/form

             i.e. on our Web-server /www/jwave/npib was created for the Java Form file
                   such that the form.jar file can be accessed at http://www.jwave.vt.edu/npib/form.jar

             NOTE: This directory's relative web location will be required when users create NPIB forms.

2.2.8 Copy form.jar to the Web-accessible Form directory created in step 2.2.7

(This file should have been extracted from the npib.tar file in step 2.2.1)

For simplicity we recommend that only one copy of form.jar be included in
the CLASSPATH by all users. For example on www.jwave.vt.edu, form.jar was
copied to Web accessible directory shown below.


Web-server: http://www.jwave.vt.edu/npib/form.jar

NOTE: this same form.jar file can be used outside of a Web-accessible
directory to create NPIB forms. We anticipated that some users will want
to create NPIB forms on remote workstations. In this case the same form.jar
file can be placed some where in the users home directory on the remote
workstation. The NPIB User's Guide section on "How-to-create NPIB-forms"
will demonstrate how users can build NPIB forms on remote workstations but
save the NPIB-form file back to the Web server using form.jar.

2.2.9 Edit the npib.config file

This file was copied to the CGI-enabled directory in step 2.2.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 npib-admin@spelunker.sv.vt.edu

Make the following changes:


outroot - change this to the directory you created in step 2.2.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.2.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 (i.e. npib-admin).

2.2.10 Edit the npib.cgi file in the CGI-enabled directory setup in step 2.2.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 2.2.8,
       and the standard java runtime classes

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

2.2.11 Edit npib.commands file in the CGI-enabled directory set up in step 2.2.5

The npib.commands file should look like:

kriz    /export/home/rkriz/public_html/npib/npib.commands
farkas    /export/home/diana/public_html/npib/npib.commands
batra    /export/home/rbatra/public_html/npib/npib.commands

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

<researcher_output-directory_name>   <full path to each user's npib.commands file>

NOTE: in the example given above kriz and rkriz can be different for
easier indentification by Web users who can recall the researcher's
name but not their email name. Often user account names are created
the same as their email names which can be cryptic and hard to remember.

       kriz = <researcher_output-directory_name>   "a name recognized by Web users"
                   which is the directory appended to the outroot path defined in step 2.2.9
       rkriz = <user_home-directory_name>
                   which is the name of the user's home directory

For each new user the Web-server system administrator needs to add one line
to this file for each NPIB user. All other NPIB setup procedures is done by
each user in their respective ~/public_html/ directories. This npib.commands
file discussed above "points-to" the npib.commands file created by each user
in their respective ~/public_html/npib/ directory. The format for the user's
npib.commands file is discussed below in the next section 3.0.


3.0 User set up "public_html" for JWave and NPIB

With NPIB version 1.6 all NPIB, JWave, and of course *.html files are now located and executed from within the public_html directory off of the user's home directory. In this section we have provided a template that will assist the user in setting up modules that use NPIB and JWave. In this section we also outline how to set up legacy code to execute on a local (Web-server) computer or on a larger remote-site "number-crunching" computer.

3.1 Download and set up NPIB and JWave directories

3.1.1 Download the STARTUP_public_html.tar file
           Downloaded this file from
http://www.jwave.vt.edu/npib/STARTUP_public_html/
           and put the STARTUP_public_html.tar in the user's home directory.

3.1.2 Extract the contents of the STARTUP_public_html.tar file

% tar xvf STARTUP_public_html.tar

!!!! CAUTION !!!! unpacking this tar file will over-write an existing public_html directory in the user's home directory.

3.1.3 Modify template files to execute NPIB and JWave applications

           Go into the newly created public_html directory

% cd public_html

Notice that there are three directories: crcd/, jwave/, and npib/.

In the crcd/ directory there is a bin/ directory where the user must archive all compiled PV-Wave/JWave *.cpr files. This new directory must be added to the JWave manager path by the server system administrator. The crcd/ directory also contains the lectures/, assignments/, and modules/ set up by the user.

In the jwave/ directory there is a classes/ directory. In this directory there are three JWave *.jar files that were created by the JWave manager. To avoid copying these three *.jar files everytime JWave is reconfigured, the README file in this directory show how to make symbolic links to these files.

In the npib/ directory there are three directories: 1) PUT_contents_IN_home-bin/, 2) local_APP/, 3) remote_APP/, and two files: 1) form.jar, 2) npib.commands. The form.jar file is the same form.jar file located in the codebase file directory "server"/npib. The npib.commands file contains one line for each application, which can be set up to execute either as a local_APP or as a remote_APP application.

CONTENTS of npib.commands: ------------------------------------ 

local_APP local /export/home/USER_NAME/public_html/npib/local_APP/local_APP.sh
remote_APP remote /export/home/USER_NAME/public_html/npib/remote_APP/remote_APP.npib
Setting up local_APP or remote_APP applications is described in sections 3.2.1 and 3.2.2 respectively.

3.1.4 Copy contents of PUT_contents_IN_home-bin directory into ~user-home/bin

           The PUT_contents_IN_home-bin/ directory contains a script file named "form"
           which links the user to the form.jar file. Using this script file the user does not
           have to define the PATH and CLASSPATH to the form.jar file.

CONTENTS of form: ---------------------------------------------

#!/bin/sh
java -cp /usr/local/java2/lib:$HOME/public_html/npib/form.jar:. \
form.FormLoader $ 

3.2 NPIB set up: execute legacy code locally and remotely

All applications based on legacy simulation code can either be executed on the "local_" (Web-server) computer or a larger "remote_" site "number-crunching" computer. When submitting a job to a remote site computer a username, password, and IP-name is required, where the NPIB user can divide up the executable tasks on the local and remote computers by using the localAPP.sh and remoteAPP.sh shell scripts respectively. Filenames and directories, which are prefixed here with local_ or remote_, can be modified to more easily identify them with their respective local or remote computer hostnames (i.e. local_ => spe_ (short for spelunker) and remote_ => pse_). The filename segment APP can be modified to indicate the application name, i.e. APP => polar (see ../crcd/modules/module02/) or APP => edge (see ../crcd/modules/module06/). The directory names in the users' npib.commands file, described in section 3.1.3, uses this naming convention and is shown here again for reference.

CONTENTS of npib.commands: ------------------------------------ 

local_APP local /export/home/USER_NAME/public_html/npib/local_APP/local_APP.sh
remote_APP remote /export/home/USER_NAME/public_html/npib/remote_APP/remote_APP.npib

3.2.1 Setting up legacy code on "local_" (Web-server) computer.

The
local_APP directory contains a single shell script file, local_APP.sh (see below), and a local_APP_.d directory that contains all files for execution on the local (Web-server) computer.

The local_APP.sh file first transfers the contents of the local_APP_.d directory into a "Web-accessible working directory", which is indicated in the script file as a period, ".", at the end of the first and second line of this script file.

CONTENTS of local_APP.sh: -------------------------------------
#!/bin/csh
#-------------------- local_APP.sh  -------------------
cp /export/home/USER-NAME/public_html/npib/local_APP/local_APP_.d/* .
cd .
./APP.x
source /usr/local/vni/wave/bin/wvsetup
#echo env: > temp
#/bin/env >> temp 
#echo ' ' >> temp
#echo set: >> temp
#set >> temp
wave create_prop1 > & prop1_foobar
rm prop1_foobar 
rm *.x
rm *.byt
rm *legend.jpg
exit 0

The script file moves into the "Web-accessible working directory" ("cd .") where it then sets up paths and executes the legacy simulation code. After execution of the legacy code the local_APP.sh script also creates images and/or animations of simulation results.

NPIB automatically creates a "Web-accessible working directory" which NPIB labels as outroot / <researcher_output-directory_name> / local_APP / "unique-date-time". The local_APP.sh script file simply refers to this directory as a period, ".". All executions take place in this directroy and can be periodically viewed by the researcher who created the local_APP. Because this outroot directory is web accessible it can also be observed by others ("research collaborators or students"). This feature is particularly useful if the researcher/collaborators/students need to view preliminary legacy simulation results of a batch job that could take several days to execute. If observation of preliminary results suggests errors, the orginiating researcher can "kill" the PID-number associated with the job that was submitted. Inside the archived directory "unique-date-time" the researcher/collaborators/students can make modifications and corrections and resubmit the job using the npib.html file archived within the "Web-accessible working directory".

The syntax for creating a local_APP requires:

  1. insert "local" in the ~user-name/public_html/npib/npib.commands file described in section 3.1.3.
    This file sets up directories where files are to be executed locally.
  2. the same local_APP directory name must appear consistently in four places:
    • two places on each line in the user's npib.commands file
      where the local_APP directory name is used.
    • one place in line of the local_APP.sh that copies files from local_APP_.d to "."
    • one place in "." => outroot/<researcher_output-direcotry-name>/local_APP/"unique-date-time"

Although a password setup is required when creating the npib.html file which uses the form editor, all local jobs can be executed without password access.

3.2.2 Setting up legacy code to run on "remote_" site computers

The
remote_APP/ directory contains two NPIB files: 1) remote_copyAPP.sh and 2) remote_APP.npib, and one directory remote_APP_.d that contains all files for execution.

The remote_copyAPP.sh copies the contents of the remote_APP_.d directory into a "Web-accessible working directory" denoted in the shell script as a period "." at the end of the line. NPIB automatically creates a "Web-accessible working directory" outroot / <researcher_output-directory_name> / remote_APP / "unique-date-time" where all executions take place and can be periodically viewed by the researcher who created the remote_APP but also by the others ("researcher collaborators/students").

CONTENTS of remote_copyAPP.sh: -----------------------------------

#!/bin/sh
cp /export/home/USER_NAME/public_html/npib/remote_APP/remote_APP_.d/* .

The NPIB file, remote_APP.npib, contains the sequence of commands to distribute the execution of this application on the local ("lrun") and remote ("srun") computers.

CONTENTS of remote_APP.npib: -------------------------------------

lrun /export/home/USER_NAME/public_html/npib/remote_APP/remote_copyAPP.sh
sput $APP_remote
srun $APP_remote ./remoteAPP.sh
sget $APP_remote 
lrun ./localAPP.sh
Commands in the remote_APP.npib file need more explanation, where $APP_remote is defined in the NPIB Edit - Passwords "Working Window" and used here like an environmental variable with information about the remote computer.

lrun - run this command or shell script localy
sput - ssh put files in a directory (date-time) on the remote computer.
srun - ssh run on the remoteAPP.sh script in this directory.
sget or sgetd - ssh get or ssh get then delete files from this directory.

The remote_APP_.d directory contains all files for execution on remote computer. NOTE: executable files stored in the remote_APP_.d directory must be compiled on the remote computer, unless the user wants to include an extra compile command in the remoteAPP.sh script which is located in the remote_APP_.d directory. The two *.sh script files: remoteAPP.sh and localAPP.sh are shell script files that control the sequence of commands executed on the remote and local computers respectively:

#!/bin/csh
#------------------ remoteAPP.sh --------------------
APP.x
exit 0

#!/bin/csh
#-------------------- localAPP.sh  -------------------
source /usr/local/vni/wave/bin/wvsetup
#echo env: > temp
#/bin/env >> temp 
#echo ' ' >> temp
#echo set: >> temp
#set >> temp
wave create_prop1 > & prop1_foobar
rm prop1_foobar 
rm *.x
rm *.byt
rm *legend.jpg
exit 0
The other files in the remote_APP_.d directory are templates with helpful hints which can be used to avoid various pitfalls and other problems we encountered in creating PV-Wave modules.

The syntax for creating a remote_APP requires:

  1. insert "remote" in the ~user-name/public_html/npib/npib.commands file described in section 3.1.3.
    This file sets up directories where files are to be executed locally and remotely.
  2. the same remote_APP directory name must appear consistently in four places:
    • two places on each line in the user's npib.commands file
      where the remote_APP directory name is used.
    • one place in a line of the remote_copyAPP.sh that copies files from remote_APP_.d to "."
    • one place in "." => outroot/<researcher_output-direcotry-name>/remote_APP/"unique-date-time"


4.0 "How-to" NPIB-form tutorials


4.1 How-To-Create NPIB1.6 forms: with interface to 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.

4.1.1 NPIB 1.6 forms accessed through a Web browser

The NPIB1.6 form, shown below, appears in the lower frame on a Web browser where the remote client can modify the numbers in this Web editable form and submit the job for execution to a remote computer specified at the bottom of the form.

4.1.2. Setting up access to the form.jar "editor"

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 one place:

/www/jwave/npib/form.jar
The file form.jar is archived in the directory shown below along with java source code.
/www/jwave/npib/form.jar_Archive/form.jar_1.6/form.jar

In this case the /www/jwave/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 --> ... /www/jwave/npib/: ....

echo $CLASSPATH --> ... /www/jwave/npib/form.jar: ....

---------------------------------------------------------------------
ALTERNATE METHOD OF ACCESSING form.jar: is used when creating NPIB forms on remote
workstations or when using two different versions (1.5 or 1.6) of NPIB form.jar on the "NPIB-server"
(i.e. spelunker). Either of these situations can be accommodated without defining PATH or CLASSPATH
This can be done by creating a shell script for each version of form.jar.

Example of a shell script file named, form1.5:

#!/bin/sh
java -cp /usr/local/java2/lib:/www/jwave/applets98/form/form.jar:. form.FormLoader $*         

Example of a shell script file named, form1.6:

!/bin/sh
java -cp /usr/local/java2/lib:$HOME/public_html/npib/form.jar:. form.FormLoader $*

These shell scripts can be placed in the user's ~/bin directory if the user defines
their path to go to ~/bin (common practice). Of course depending on where the user
locates the different form.jar files requires changing the paths in these scripts.
-----------------------------------------------------------------------

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 npib1-6_polar.html with the following command at the UNIX prompt.

   spelunker% form1.6 -e npib1-6_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.

4.1.3 Creating / Editing NPIB form files using the NPIB Creator "Working Window"

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 "NPIB-server" (i.e. spelunker) from a remote workstation and are using NPIB1.6 form.jar file, then you must have setup the environmental DISPLAY variable to display X-windows back to your remote workstation**. If you are creating NPIB forms on a remote workstation we recommend that you install your own NPIB1.6 form.jar file in the ~/bin directory or create shell scripts in the ~/bin directory as described in the section on ALTERNATE METHOD OF ACCESSING form.jar. !!NOTE!! If you are creating the NPIB1.6 file (*.html) on a remote machine it is not necessary to ftp transfer this file to the "NPIB-server" (i.e. spelunker) because the newer NPIB1.6 form editor-creator has a "Save Local" or "Save Ftp" feature built into NPIB1.6 form editor-creator that transfers the edited NPIB1.6 form file to a directory on the "NPIB-server" (i.e. spelunker). This will be explained by example below.


4.1.3.1 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 Local, Open Ftp, Save Local, Save Ftp, and Exit. Under Edit the choices are Refresh, Remove, Properties, Passwords, and Output Editor. Properties, Passwords, and Output Editor will be discussed later. Refresh refreshes the working window, Remove removes the last entry that was created from the items under Insert shown below.

Under Insert the choices are Text Field, Label, and Button, and Grid. The majority of the time you will select a Text Field box with a Label above the box. Grid inserts an m-rows x n-columns of Text Fields because such a grid is often needed and this saves time. A Button is used to select or initiate a task.

When an 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 just after the last item entered in 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 endOfRow, foreground, background, and font. If the item is the last in a row you must specify this by changing the endOfRow to be True. Experiment with and change foreground, background, and font as needed.

Text Field Property Window options not already mentioned: selectionEnd, columns, text, selectionStart, editable, caretPosition, and name:

The Text Field properties window, shown at the left, is the tallest and has the most options: sectionStart, selectionEnd define the beginning and end of the text-field displayed in the text entry 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.


4.1.3.2. Information for working with the Edit - 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

TIME SAVING FEATURE: At the top of the "Working Window" there is a window that lists "names" associated with components: Text Fields, Labels, Buttons. These "names" are listed in the window when "refresh" is selected. Double clicking on any of these names transfers this entry into the format window below with the correct syntax. This feature can save alot of time constructing the syntax which is required by the data file to-be-read by the legacy code.

The final entry is the window where the data file 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 and read by the legacy code. This data file format (spacing, field length, etc.) is set 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, and their default numeric values, were assigned when the textfield_names were 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.


NOTE: after building many NPIB forms this portion is where the most errors occur and hence the most time is spent. Getting the format just right, is a task that is inherent to organizing data in a file that is to be read by legacy code. Although we provided some helpful time saving features in this editor, attention to detail is an unavoidable task that must be realized in constructing this file.

Textfield name conditonal test syntax:
A useful feature of the "Output Editor" format window is a conditional test, that can be used to include or exclude numeric values associated with textfield_names in the final data file: i.e. the following entry <link=no_of_layers<2\> is a conditional test ("is the no-of_layers less than 2 ?") that can be placed at the beginning of lines defined in the "Output Editor" format window. If the conditional test is true, then entries following this conditional test are included in the data file, which will be read by the legacy code. This syntax allows the NPIB Web form builder to enter more lines in the NPIB Web form than needed by the Web form user. The Web form user can than select which values are used to create the data file to be read by the legacy code.

Example: Edit the npib.html file "form1-6_edge.html" in ../crcd/modules/module06 and find the line in the "Output Editor" format window.

BETA values (beta1,beta2,beta3) defined for only one layer:
BETA1=<link=beta1\>  BETA2=<link=beta2\>  BETA3=<link=beta3\>
Note: this NPIB form requires that all layers of this composite laminate use the same moisture expansion coefficients (BETAs). It is possible to expand this form to include different moisture expansion coefficients for each layer by including a conditional test (=, <, >, <=, >=) on a textfield_name set in the "Output Editor" format window. In the example given below a conditional test (>) on the textfield_name noofbetalayers is added at the beginning of each line, where noofbetalayers was assigned a numeric value in the same Web form but prior to the conditional test.
BETA values (beta1,beta2,beta3) defined for up to three different layers:
<link=noofbetalayers>1\>BETA1-1=<link=beta1-1\>  BETA2-1=<link=beta2-1\>  BETA3-1=<link=beta3-1\>
<link=noofbetalayers>2\>BETA1-2=<link=beta1-2\>  BETA2-2=<link=beta2-2\>  BETA3-2=<link=beta3-2\>
<link=noofbetalayers>3\>BETA1-3=<link=beta1-3\>  BETA2-3=<link=beta2-3\>  BETA3-3=<link=beta3-3\>
       NPIB Web form sequence:
           Textfield_name: noofbetalayers = 3
           Conditional test first line: noofbetalayers>1 TRUE, --- BETAs added to data file
           Conditional test second line: noofbetalayers>2 TRUE, --- BETAs added to data file
           Conditional test third line: noofbetalayers>3 FALSE, --- BETAs NOT added to data file

Since the textfield_name noofbetalayers was assigned a value of 3 prior to the conditional test, then only BETA-values listed in the first and second lines would be included in the data file "npib_edge_prop_mech.dat". Because the Web form user can set the value assigned to noofbetalayers prior to the conditional test, then the Web form user determines which values of BETA are included in the data file read by the legacy code.


4.1.3.3 Information for working with the Edit - Form Properties "Working Window"

This "Working Window" describes properties associates with the NPIB form.

Codebase: form.jar location, given as a path after the Web server-URL
                      (i.e. /npib is equivalent to http://www.jave.vt.edu/npib)
Name:directory names appended after the outroot directory where files are archived
Syntax: <user-directory-name>/<APP-directory-name>
NOTE: the <user-directory-name> is arbitrary but
               <APP-directory-name> must be identical to
               the directory-names used in the npib.commands file
               which is described in section 3.1.3.
Title: HTML title (arbitrary - "foobar") for the NPIB form
CGI location: location of the npib.cgi file which can be different from server/cgi-bin
Height - Width: Height and Width of NPIB form in pixels as it appears on a Web browser.


4.1.3.4 Information for working with the Edit - Passwords "Working Window"

This "Working Window" describes information needed to submit a job to remote site computers. The three images below show the progression of setting up this information.

Password information is stored in the lower area of the Passwords "Working Window". Each line corresponds to providing information unique to each remote site computer. Different password information can be set up for submitting multiple jobs to different computers.

The first entry on each line is the password name, i.e. polar_remote. Double clicking on this entry opens this name in a "Remove password" window which is shown below.

Selecting OK removes this line from the list below and places this information in the editable portion of the Passwords "Working Window".

!!! CAUTION !!! Blank lines in this list will generate an error and are obviously hard to see !!!!.

When edits are complete select the "Add" button at the bottom to add this information back to the line-list at the bottom of thw "Working Window". These entries should be obvious except the "Description" entry appears in the NPIB form as text just above the remote site: User Name, Password, and Host Name. We recommend to leave the Password blank.


4.1.3.5 Save your results to a NPIB 1.6 form file (*.html)

Save your results locally if you are logged onto the the Web server
[or]
Save your results by FTP if you are creating the NPIB form on a remote workstation.


YOUR NPIB FORM IS NOW COMPLETE


SUPPLEMENTARY NOTES:

1. 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.


**2. Remote Editing: 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.1.4. "How-to" Create interface to files assocated with calculating Polar Plots (module02)

The NPIB form interface to the Polar Plot (module02) has be organized on the Web at ~rkriz/public_html/crcd/modules/module02 with sufficient documentation ("README" files and comments embedded in code) in each directory so that the reader can study "how-to" setup similar modules. Below we outline how to create a module and interface to the NPIB form.

  1. Download and archive your legacy code and sample data sets for module02 at
    cd ~rkriz/public_html/crcd/modules/module02/ARCHIVE/ORIG_NIST/

  2. Copy legacy code and sample data sets into cd ../MOD_F77 and make the necessay changes so that the lecacy code compiles and executes correctly in this directory.

  3. Copy modified F77 code and sample data sets into cd ../MOD_PVWAVE and further modify the code to generate output that can be used by PV-Wave to generate Polar Plots. In this directory everything is tested first before it is moved into the "Working" directories that will interface with the NPIB form. The README file in this directory fully describes the remaining steps needed to create the interface between the NPIB form and module02. This README file in this directory is listed below FYI.
---- This is the README file for ../module02/ARCHIVE/MOD_PVWAVE ----

This is a working archive directory where all results are confirmed
prior to making this into an interactive NPIB interactive module by
creating results in this directory. Instructions for creating results
are outlined below.

All programs in this directory work so that the viewer can download, 
compile and run this programs on their computers.  This section is 
divided into five sections:

1. Compile polar.f and create the executable polar.x 

 - $FC $FFLAGS polar.f -o polar.x $LINK_FNL (If IMSL libs are used)
 - f77 polar.f -o polar.x (If subroutine inv(a,n,b) is used) 

     NOTE: polar.x is spawned in the PV-WAVE procedure files

3) Plot results using existing PV-Wave procedure files

 - % wave create_e3
 - % wave create_g23
 - % wave create_nu32

4) View results in polar.html

5) Cleanup files in this directory

 - % remove_excess_files.sh

---------------------------------------------------------------------
     CREATION OF INTERACTIVE NPIB1.5 INTERFACE FOR THIS MODULE

Once verified, these working programs are copied to the NPIB directory 
/www/jwave/applets98/Receiver/commands/polar_.d except for *.jpg, 
*.byt *.out, *.DAT, *.sh such that the only remaining files in the 
polar_.d directory are: *.pro, *.f, *.x, and polar.html. 

DO NOT COPY README file from the MOD_PVWAVE directory to polar_.d.
DO NOT DELETED *.sh files FROM the MOD_PVWAVE directory.
The remove_excess_files.sh shell script file will remove the
appropriate files from MOD_PVWAVE for archiving.  

A shell script file named "polar_" recreates results in a unique 
directory located in http://www.jwave.vt.edu/output/"app_date-time"

  /www/jwave/applets98/Receiver/commands/polar_:
  -------------------------------------------------------------------
  #!/bin/csh
  cp /www/jwave/applets98/Receiver/commands/polar_.d/* $1
  cd $1
  source /usr/local/vni/CTT3.0/ctt/bin/cttsetup.csh
  source /usr/local/vni/wave/bin/wvsetup
  wave create_e3 > & e3_foobar 
  wave create_g23 > & g23_foobar 
  wave create_nu32 > & nu32_foobar
  rm e3_foobar g23_foobar nu32_foobar 
  rm *.x
  rm *.byt
  rm *legend.jpg
  rm *.SAVE
  exit 0

  ----------------------------------------------------------------
     CREATION* OF INTERACTIVE NPIB1.6 INTERFACE FOR THIS MODULE

Is the same as creating NPIB1.5 interface except the "polar_" shell
script file is replaced with the npib-script file "polar.npib" and
both the polar_.d directory and polar.npib file are located within 
the users public_html directory at ~USER_NAME/public_html/npib/polar/. 
The polar.npib file uses ssh commands and unique "npib-commands" to
transfer files to the remote computer and coordinate execution at 
remote and local(npib-server) computers. For NPIB1.6 the polar_.d 
directory contains the same files except remote and local shell script 
files are included in the NPIB1.6 polar_.d directory that are used to 
execute program and procedures at remote and local computers. A more
complete description of the npib-commands is given in the NPIB1.6 
Users-Guide. 

   ~rkriz/public_html/npib/polar/polar.npib
   -----------------------------------------------------------
   lrun /export/home/rkriz/public_html/npib/polar/copypolar.sh
   sput $polar_remote
   srun $polar_remote ./remotepolar.sh
   sget $polar_remote 
   lrun ./localpolar.sh

   shell script files in ~rkriz/public_html/npib/polar/polar_.d
   ------------------------------------------------------------
   #!/bin/csh
   #------------------ remotepolar.sh --------------------
   polar.x
   exit 0

   #!/bin/csh
   #-------------------- localpolar.sh  -------------------
   source /usr/local/vni/wave/bin/wvsetup
   wave create_e3 > & e3_foobar
   wave create_g23 > & g23_foobar
   wave create_nu32 > & nu32_foobar
   rm e3_foobar g23_foobar nu32_foobar
   rm *.x
   rm *.byt
   rm *legend.jpg
   exit 0 

----------------------------------------------------------------------
* Motivation for creating NPIB1.6: With NPIB1.6 all files are located
  within the users home directory. NPIB1.5 required that the user copy
  and access files in a variety of different locations on the server. 
---------------------------------------------------------------------
Ronald D. Kriz, Virginia Tech, 06-20-01   


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 message "sumbitting" replaces the form in the lower window which indicates the job has been submitted and files are being transfered to the remote computer for number crunching. When these files have completely transfered to the remote computer, a new web page appears with a message indicating file transfer to the remote computer has been completed with an estimated time when remote computations will be done. The message on this Web page refreshes in five seconds to the archive directory so that the Web browser viewer can observe when files are transfered back to the archive directory from the remote computer. After this file transfer is complete additional computations in the archive directory may take place as specified by the localpolar.sh script file. The compuations at the remote and local (server-side) computers are contolled by the remotepolar.sh and localpolar.sh script files respectively.

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.

------------ NO KNOWN BUGS -------------


5.0 Frequently asked questions


6.0 Known bugs


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