Skip to content

slitvinov/sphysics2d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

--- QUICKSTART GUIDE TO RUNNING 2D version of SPHYSICS ---

(All source codes for SPHYSICS are distributed under the terms of General Public License, GPL, as published by the Free Software Foundation, http://www.gnu.org)

CONTENTS
1. File Structure
2. Running SPHYSICS
3. Plotting SPHYSICS output


1. File Structure
The SPHYSICS code has the following structure:

directories:
  execs		: executable files
  execs.bak	: backup executable files
  Post-Processing: plotting routines are located here under matlabRoutines
  run_directory	: each demonstration case is under a separate subdirectory, e.g. CaseN
  source	: the fortran source codes are contained under two subdirectories SPHYSICS2D and SPHYSICSgen2D



2. Running SPHYSICS

Which Compilers?
- Under windows the code has been run using the Intel ifort compiler and the Silverfrost/Salford FTN95, as well as the GCC gfortran compiler on cygwin (linux emulator).
- Under linux the code has been run using the GCC gfortran compiler and the non-commerical version of the Intel ifort compiler. These compilers along with the GNU Make utility should be available on the machine's default PATH.

NOTE: The choice of compiler is controlled by one of the last options in the input file for each demonstration case located under: run_directory/CaseN/CaseN.txt.  The Default value is set at 3 for the Compaq Visual Fortran Compiler.
1 - gfortran
2 - ifort (linux/unix)
3 - Intel ifort for Windows
4 - Silverfrost/Salford ftn95 (Windows)

(i)    COMPILE & RUN SPHYSICS EXECUTABLE IN ONE STEP

After compiling SPHYSICSgen, change to directory: run_directory/CaseN/ where N is the number of the case to run.

LINUX/UNIX:   Open the file CaseN.txt in a text editor and change the number on the penultimate line to 1 (for gfortran) or 2(for ifort). Then type the following at the command prompt.

    ./CaseN_unix_gfortran.bat   OR   ./CaseN_unix_ifort.bat

ifort on WINDOWS:  Open the file CaseN.txt in a text editor and change the number on the penultimate line to 3 for the CVF compiler on windows. Then type the following at the command prompt

   .\CaseN_windows_ifort.bat

FTN95 on WINDOWS: Open the file CaseN.txt in a text editor and change the number on the penultimate line to 4 for the Silverfrost FTN95 compiler on windows. Then type the following at the command prompt

   .\CaseN_windows_ftn95.bat

NOTES:	(i)  for FTN95 you must have the file default.mk in the source directories.
	(ii) in the CaseN.txt file, there must be a space character " " (not a TAB) after each numerical entry

gfortran on cygwin WINDOWS: Open the file CaseN.txt in a text editor and change the number on the last line to 1 (for gfortran). Then type the following at the command prompt.

    ./CaseN_windows_cygwin_gfortran.bat

This compiles and runs the SPHYSICS code. For further details on running the test cases please refer to the SPHYSICS User's Manual.


(ii)   COMPILE SPHYSICSgen EXECUTABLE ONLY

Once the code is downladed, the pre-processing program SPHYSICSgen_2D should be compiled. To do this,

Change to directory: source/SPHYSICSgen2D/
gfortran on linux:     make -f SPHYSICSgen_gfortran.mak
ifort on linux: make -f SPHYSICSgen_ifort.mak
ifort on windows:  NMAKE/f"SPHYSICSgen_win_ifort.mak"
Silverfrost FTN95 on windows: mk32 -f SPHYSICSgen_ftn95.mak
gfortran on cygwin: make -f SPHYSICSgen_gfortran.mak


(iii)  COMPILE SPHYSICS EXECUTABLE ONLY

To compile the SPHYSICS_2D executable only, a Makefile (say SPHYSICS.mak), needs to be generated by running SPHYSICSgen_2D. Then this Makefile has to be copied to the directory /source/SPHYSICS2D. Then

Change to directory: source/SPHYSICS2D/
linux/cygwin:     make -f SPHYSICS.mak
ifort on Windows:   NMAKE/f"SPHYSICS.mak"
FTN95 on Windows: mk32 -f SPHYSICS.mak

(iv)   GENERATE GEOMETRY & INPUT FILES

Change to directory: run_directory/CaseN where N is the number of the case to run.

LINUX/UNIX:     Open the file CaseN.txt in a text editor and change the number on the last line to 1 (for gfortran) or 2(for ifort). Then type the following at the command prompt.

../../execs/SPHYSICSgen_2D < CaseN.txt


Intel IFORT, FTN95 or gfortran on WINDOWS:  Open the file CaseN.txt in a text editor and change the number on the last line to 3 (for the CVF compiler), 4 (for FTN95) or 1 (for gfortran on windows). Then type the following at the command prompt

 ..\..\execs\SPHYSICSgen_2D.exe < CaseN.txt

NOTES:	(i)  for FTN95 you must have the file default.mk in the source directories.
	(ii) in the CaseN.txt file, there must be a space character " " (not a TAB) after each numerical entry


3. Plotting SPHYSICS output
SPHYSICS comes with routines to plot the results in both Matlab and ParaView 3.0+.  The SPHYSICS code generates the following output files:
PART_ijkl	: Particle Field snap shot, x y z u v w ....
DT		: Output timesteps of PART_ijkl files
ENERGY		: Energy of System,
EPART		: Final Particle Field snap shot

These files are generated in the current working directory for each case, i.e. run_directory/CaseN/
To plot the results, more information can be found under each directory: 
Post-Processing/fortranRoutines/README and 
Post-Processing/matlabRoutines/README.