To begin, unpack the FLASH source code distribution.
tar -xvf FLASHX.Y.tar
where X.Y is the FLASH version number (for example, use FLASH4-alpha.tar for FLASH version 4-alpha, or FLASH3.1.tar for FLASH version 3.1). This will create a directory called FLASHX/. Type `cd FLASHX' to enter this directory. Next, configure the FLASH source tree for the Sedov explosion problem using the setup script. Type
./setup Sedov -autoThis configures FLASH for the 2d Sedov problem using the default hydrodynamic solver, equation of state, Grid unit, and I/O format defined for this problem, linking all necessary files into a new directory, called `object/'. For the purpose of this example, we will use the default I/O format, serial HDF5. In order to compile a problem on a given machine FLASH allows the user to create a file called Makefile.h which sets the paths to compilers and libraries specific to a given platform. This file is located in the directory sites/mymachine.myinstitution.mydomain/. The setup script will attempt to see if your machine/platform has a Makefile.h already created, and if so, this will be linked into the object/ directory. If one is not created the setup script will use a prototype Makefile.h with guesses as to the locations of libraries on your machine. The current distribution includes prototypes for AIX, IRIX64, Linux, Darwin, and TFLOPS operating systems. In any case, it is advisable to create a Makefile.h specific to your machine. See Sec:SetupMakefile for details.
Type the command cd object to enter the object directory which was created when you setup the Sedov problem, and then execute make. This will compile the FLASH code.
cd object makeIf you have problems and need to recompile, `make clean' will remove all object files from the object/ directory, leaving the source configuration intact; `make realclean' will remove all files and links from object/. After `make realclean', a new invocation of setup is required before the code can be built. The building can take a long time on some machines; doing a parallel build (make -j for example) can significantly increase compilation speed, even on single processor systems.
Assuming compilation and linking were successful, you should now find an executable named flashX in the object/ directory, where X is the major version number (e.g., 4 for X.Y = 4.0). You may wish to check that this is the case.
If compilation and linking were not successful, here are a few common suggestions to diagnose the problem:
./setup Sedov -auto +noio
These are just a few suggestions; you might also check for further information in this guide or at the FLASH web page.
FLASH by default expects to find a text file named flash.par in the directory from which it is run. This file sets the values of various runtime parameters that determine the behavior of FLASH. If it is not present, FLASH will abort; flash.par must be created in order for the program to run (note: all of the distributed setups already come with a flash.par which is copied into the object/ directory at setup time). There is command-line option to use a different name for this file, described in the next section. Here we will create a simple flash.par that sets a few parameters and allows the rest to take on default values. With your text editor, edit the flash.par in the object directory so it looks like Figure 2.1.
# runtime parameters basenm = "sedov_" lrefine_max = 5 refine_var_1 = "dens" refine_var_2 = "pres" restart = .false. checkpointFileIntervalTime = 0.01 nend = 10000 tmax = 0.05 gamma = 1.4 xl_boundary_type = "outflow" xr_boundary_type = "outflow" yl_boundary_type = "outflow" yr_boundary_type = "outflow" plot_var_1 = "dens" plot_var_2 = "temp" plot_var_3 = "pres" sim_profFileName = "/dev/null" |
This example first instructs FLASH to name output files appropriately (through the basenm parameter). FLASH is then instructed to use up to five levels of adaptive mesh refinement (AMR) (through the lrefine_max parameter), with the actual refinement adapted based on the density and pressure of the solution (parameters refine_var_1 and refine_var_2). We will not be starting from a checkpoint file (“restart = .false.” -- this is the default, but here it is explicitly set for clarity). Output files are to be written every 0.01 time units (checkpointFileIntervalTime) and will be created until or 10000 timesteps have been taken (tmax and nend respectively), whichever comes first. The ratio of specific heats for the gas (gamma = ) is taken to be 1.4, and all four boundaries of the two-dimensional grid have outflow (zero-gradient or Neumann) boundary conditions (set via the _boundary_type parameters).
Note the format of the file - each line is of the form variable = value, a comment (denoted by a hash mark, #), or a blank. String values are enclosed in double quotes ("). Boolean values are indicated in the FORTRAN style, .true. or .false.. Be sure to insert a carriage return after the last line of text. A full list of the parameters available for your current setup is contained in the file setup_params located in the object/ directory, which also includes brief comments for each parameter. If you wish to skip the creation of a flash.par, a complete example is provided in the source/Simulation/SimulationMain/Sedov/ directory.