The modules for the stress problem are written in FORTRAN 77 using the MPI communication library. The pstress program will be run on the Data Star, by following the instructions given below.
If you are interested in more information regarding the use of the Data Star, it's recommended that you read the Data Star User Guide.
These programs can be run in the Linux environment. To start, you have two options:
- To use a Linux machine. You have to start a terminal.
- To use the Windows machines. You have to use the "SSH Secure Shell" program. To start SSH, start from
Start-->Programs-->Network Applications-->SSH--->Secure Shell Client
Press "Quick Connect" button. Type "linux" as Host Name and your CADLAB login name, then click Connect. The password required is your CADLAB password. This will make a secure connection to one of the Linux machines in Engineering I. Now you are on your account(i.e. X:/ drive) via a Unix interface.
To login on the Data Star you must use the secure shell command, in the LINUX environment:
% ssh -lUserID dslogin.sdsc.edu [to make a secure connection to the server]Once you login the first time, you must change your password:% rlogin tfpasswd [to make a connection to the server where passwords are changed] and enter your choice as p to change password.After entering the new password, this server will log you out automatically. It might take a while before your new password is activated.
To transfer the pstress modules and auxiliary files to the Data Star, you have to use pftp. pftp is an ftp-like interface to HPSS. The followings links and text below describe how to use the pftp utility:
% pftp [to access HPSS] pftp> cd /users/csb/u4078 [to change directory to Stefan's account] pftp> get stressbatch.tar [to transfer the file from HPSS to your account on Data Star] pftp> quit [to exit pftp access] %
The file transfered is a tar file. A tar file is a file created for archiving purposes. It is one file composed of several files. In order to compile and run the pstress module, you have to untar the file stress.tar:
%tar xvf stressbatch.tar [to extract the contents of the tar file]In the directory stressbatch, the following files will be present (change to the stressbatch directory by "cd" and use "ls" to list the contents of the directory)- Makefile - stressh.f - stressn.f - inpmesh.f - meshgen.f - plotmatlab.f - script64The files Makefile, stressh.f, stressn.f and script64 are the files related to the parallel FEM solver program "pstress". The auxilary file inpmesh.f is used to create the input to the mesh generator for the dam problem. meshgen.f is used to create the mesh for the dam structure. plotmatlab.f is used to create a Matlab file for plotting the mesh, forces of the dam, and the shape under those forces calculated by pstress.To make these Fortran codes work, we first have to compile them. In order to compile the pstress module, run make:
% make [to compile stressh.f and stressn.f and combine to form executable "pstress"]In order to compile the inpmesh.f module:% f77 -o inputgiver inpmesh.f [to compile inpmesh.f to form executable "inputgiver"]In order to compile the meshgen.f module:% f77 -o mesh meshgen.f [to compile meshgen.f to form executable "mesh"]In order to compile the plotmatlab.f module:% f77 -o plot plotmatlab.f [to compile plotmatlab.f to form executable "plot"]After this the new executable files (marked with *) should be available in the directory.
To solve the dam problem and obtain a plot of the output, we have 5 steps to perform:
Step 1: Create the input for mesh generator
The code in charge of creating the input for the mesh generator is inpmesh.f and inputgiver is the executable version of it. (You can open a file with the editor pico by typing %pico name_of_file.) To run the executable type its name:% inputgiver [to execute]You will be prompted for some input. First, the number of nodes in the i direction. This specifies the number of nodes that will cover the width of the dam. Second, the number of nodes in the j direction. This specifies the number of nodes that will cover the height of the dam.
Once these are completed, the program will automatically create the input file for mesh generator inputdamprog.Step 2: Generate mesh for the dam structure
The code in charge of generating the mesh is meshgen.f and mesh is the executable version of it. We have already specified the number of nodes in the previous step. The mesh generator program will distribute nodes evenly and create triangular elements. For this, type:% mesh(Here if file outmesh already exists, you will get an error message. Remove the file first by %rm outmesh) Note, you will not be prompted for input or output file names. They are specified using the command line. File outmesh contains the information on nodes and elements created. The automatically created inputstress file contains similar information as outmesh, however, in a format that is readily available for use in the parallel pstress module. inputstress also contains the hydrostatic forces on the nodes at the dam-water boundary calculated automatically.outmesh [to execute with "inputdamprog" as input file and "outmesh" as output file] Step 3: Solve the Finite Element problem with parallel FEM solver
The parallel FEM solver code is the combination of stressh.f and stressn.f and pstress is the executable version of it.To run the pstress program in batch environment, on 64 processors, your login name [ux.....] has to be included in the script file "script64", instead of the "u4078" login name:
% edit script64 :1,$ s/u4078/ux..../ :w! :quit %To submit the job in the batch queues:% llsubmit script64Once a job is submitted, LoadLeveler assigns it a unique ID number. An actual submit session might therefore look similar to the following:%llsubmit your_job_script submit: The job "tf174i.36727" has been submittedTo cancel the job, use the job ID with the llcancel command as shown.%llcancel tf174i.36727To obtain the status of the job shown previously issue the following.%llq | grep ux.... where ux.... is your login name [see "man llq"].The input data file is inputstress has to be in the stressbatch directory. The file outstress will be created containing the result of the finite element analysis. Also the file CSFEP.GRP will be created with the same information but in a format that's readily available to the plotting program.Step 4: Obtain the plot file in MATLAB format
The code in charge of creating the plot file in MATLAB format is plotmatlab.f and plot is the executable version of it. To run the executable, type:% plot [to execute]This will automatically read the file CSFEP.GRP and create the file inpplot.m in MATLAB format. This is the file we can run using MATLAB to obtain the plot.Step 5: Print the results in the CAD-LAB at UCSB
To print the output file generated by pstress and plot programs, transfer the files to a UCSB machine, using the scp [secure copy] utility. To copy the file from the Data Star to the Engineering domain machines(i.e. linux.engr.ucsb.edu), type:
% scp outstress CADLAB_login_name@linux.engr.ucsb.edu:outstress and enter your CADLAB password % scp inpplot.m CADLAB_login_name@linux.engr.ucsb.edu:inpplot.m and enter your CADLAB passwordThese will copy the files to your X:/ drive. Access outstress using WordPad and follow the standard procedure to print it.(decreasing the right and bottom margins should also help)Access inpplot.m using MATLAB. Run it by either pressing F5 or from the menus:
Debug --> (Save and) Run
To obtain the plot, you should first switch to the MATLAB command window to input the annotation required and if the displaced shape is to be plotted, the magnification factor (10000 would give good results). Once plot is obtained, you can print the figure using the standard procedure.