************************************************************************** Installation instructions for Windows Users Created by Jinsong Huang and Vaughan Griffiths Colorado School of Mines July 2008 ************************************************************************** The following instructions explain how you can download and run the programs and subroutines as described in detail in the text: "Programming the Finite element Method (4th edition)" by I.M. Smith and D.V. Griffiths John Wiley and Sons 2004 (reprinted 2006) Both source code (in Fortran 95) and executable versions of all the program are included in the download. This readme.txt file is in five parts as follows: A) Instructions for downloading all the programs, executables and subroutines. B) Instructions for downloading gsview.exe, which is software for previewing and printing PostScript files produced by some of the programs. C) Instructions for running executable versions of the finite element programs. D) Instructions for downloading a free Fortran 95 compiler. This will be needed if you want to change any of the main programs or subroutines, or add new subroutines to the finite element libraries. E) Instructions for running source versions of the finite element programs. *************************************************************************** A) Instructions for downloading the programs and subroutines. Locate file 4th_ed.exe: Follow either a) or b) below. a) From the course cd in the "Software" folder, double-click on 4th_ed.exe, choose the folder you want to Unzip to (or accept the default of c:\4th_ed), click "Unzip" b) From web site http://www.mines.edu/fs_home/vgriffit/4th_ed/Software, click on 4th_ed.exe, select "Run", select "Run" again, choose the folder you want to Unzip to (or accept the default of c:\4th_ed), click "Unzip". In either case When it has finished it should say "488 files unzipped successfully". Click on "OK" and "Close" the WinZip Self-Extractor window. You are free to select any installation folder you wish for 4th_ed, but the following instructions assume you have accepted the default installation folder of c:\4th_ed. If you are unable, or do not wish to use the default installation folder, you are free to replace the default folder with another folder of your choosing. As an example, let us assume that you wish to install the finite element programs in d:\fe_progs\4th_ed. Execute the file 4th_ed.exe as described above, but when the pop-up window appears, replace c:\4th_ed with d:\fe_progs\4th_ed before clicking on "Unzip". In this case, you will need to replace all occurrences of "c:\4th_ed" with "d:\fe_progs\4th_ed" in sections C) and E) below. *************************************************************************** B) Instructions for downloading gsview.exe, which is software for previewing and printing PostScript files produced by some of the programs. Locate file gstools.exe: Follow either a) or b) below. a) From the course cd in the "Software" folder, double-click on gstools.exe, choose the folder you want to Unzip to (or accept the default of c:\gstools), click "Unzip". b) From web site http://www.mines.edu/fs_home/vgriffit/4th_ed/Software, click on gstools.exe, select "Run", select "Run" again, choose the folder you want to Unzip to (or accept the default of c:\gstools), click "Unzip". In either case When it has finished it should say "279 files unzipped successfully". Click on "OK" and "Close" the WinZip Self-Extractor window. You are free to select any installation folder you wish for gstools, but the following instructions assume you have accepted the default installation folder of c:\gstools If you are unable, or do not wish to use the default installation location, you are free to replace the default folder with another folder of your choosing. As an example, let us assume that you wish to install the graphics applications in d:\graphics\gstools. Execute the file gstools.exe as described above, but when the pop-up window appears, replace c:\gstools with d:\graphics\gstools before clicking on "Unzip". In this case, to run the graphics application you will need to replace all occurrences of "c:\gstools" with "d:\graphics\gstools" in the remainder of this Section. The executable file needed with some of the programs in this finite element system is c:\gstools\gsview\gsview32.exe. This application enables PostScript files to be previewed and printed. It is suggested that you create a desktop icon for this application so it can easily be accessed. When executing gsview32.exe for the first time you will need to configure it using "Options|Configure" In the panel asking "In which directory is Ghostscript located?", type c:\gstools\gs5.50 Files can be previewed on the screen by going to File==>Open... etc, or dragging a PostScript file icon into the Ghostscript window. In order to print files previewed in a Ghostscript window, go to File==>Print...==>Select Device "mswinpr2" and Queue your printer choice. *************************************************************************** C) Instructions for running executable versions of the finite element programs. To run an executable finite element program, say p51.exe from Chapter 5 in the book with a sample data, say p51_3.dat, navigate in Windows Explorer to folder c:\4th_ed\executable\chap5 and double-click on the p51.exe icon This should bring up a black command window prompting you to type the basename of your data file. At this time type "p51_3" and press Enter. Note: All data files in this system MUST have the extension *.dat The basename of any data file is the part before the period. If the program executes successfully, the results file is given the same basename as the data file but with the extension *.res In the above example, the results will be held in p51_3.res If for example you want to run program p62.exe with your own data file called fred.dat navigate in Windows Explorer to folder c:\4th_ed\executable\chap6 Open the example data file p62.dat that goes with the program using any suitable text editor. Make your changes and Save As... fred.dat Double-click on the p62.exe icon and at the prompt type "fred" If the program executes successfully, the results will be held in the file fred.res Some programs create additional graphics files in PostScript which may be previewed using gsview32.exe as described above. These graphics files have the same basename as the data file, and the following extensions: *.msh which is an image of the finite element mesh *.vec which is an image of the nodal displacement vectors *.dis which is an image of the deformed mesh *.con which is an image of the contour map *************************************************************************** D) Instructions for downloading a free Fortran 95 compiler. This will be needed if you want to change any of the main programs or subroutines, or add new subroutines to the finite element libraries Go to web-site http://www.g95.org Click on "Download ==> Binaries" Scroll down to section on WINDOWS and "g95-MinGW.exe" Click on link which says Download from: "http//ftp.g95.org/g95-MinGW.exe" Click on "Run", Click on "Run" again, Click on "Yes" If you have Administrator privileges you are free to select any installation folder you wish for g95 and read the next paragraph. The following instructions assume you installed the compiler in c:\g95. If you are unable, or do not wish to use the default installation folder, you are free to replace the default folder with another folder of your choosing. As an example, let us assume that you wish to install the Fortran 95 compiler in c:\compilers\g95. Execute the file g95-MinGW.exe as described above, but when the pop-up window appears, enter c:\compilers\g95 in the "Destination Folder" window before clicking "Install". In this case, you will need to replace all occurrences of "c:\g95" with "c:\compilers\g95" in the remainder of this section and in Section E). When g95 installer asks "Install MinGw utilities and libs?", click "OK". When g95 installer asks "Set PATH=C:\g95\bin & LIBRARY_PATH=C:\G95\LIB? (Recommended)" ,click "OK". When g95 installer asks "Open README.txt now?", click "Cancel". Click "OK" to exit *************************************************************************** E) Instructions for running source versions of the programs. You must build two libraries called main and geom which is done by running a batch file called c:\4th_ed\source\build.bat Before running build.bat, it may need to be edited (using Wordpad or similar) to ensure that environment variables ED4, G95 and VER point to, respectively, the correct installation folders of 4th_ed, g95 and the version number of g95. To check your current version, look in folder c:\g95\lib\gcc-lib\i686-pc-mingw32 Once you are satisfied that the environment variables are correctly set, go to folder c:\4th_ed\source and double-click on build.bat There are two ways of running a source finite element program. As an example let's try to run program p51.f95 from Chapter 5 in the book with sample data p51_3.dat 1) In Windows Explorer Go to folder c:\4th_ed\source\chap05 Double-click on runs.exe Type in the base name of the program p51 Type in the base name of the data file p51_3 2) In a black Command window Open a black "cmd" window Go to folder c:\4th_ed\source\chap5 by typing cd c:\4th_ed\source\chap5 On the command line type run4 p51 p51_3 followed by "Enter". run4 is always followed by two arguments as shown above. The first argument is the name of the source program (must have extension *.f95) and the second argument is the name of the data file (must have extension *.dat). DO NOT TYPE THE EXTENSIONS WHEN USING run4 If the program executes successfully, the results file is given the same name as the data file but with the extension *.res Some programs also produce PostScript graphics output files with the extension *.msh, *.dis, *.vec, *.con In the above example, the results will be held in p51_3.res and some graphics files will be held in p51_3.msh, p51_3.dis, p51_3.vec ***************************************************************************