PSCF v1.1
Examples

Thermodynamic Properties (Prev)         Crystal Unit Cells (Next)

A good way to become familiar with the PSCF simulation programs is to run a few example simulations and examine the associated input and output files. A set of examples containing input files for PSCF simulations are provided in the pscfpp/examples directory of the PSCF repository.

Each top level subdirectory of the examples root directory contains examples of simulations of a particular program or set of closely related program. For example, the pc directory contains examples that use the pscf_pc1, pscf_pc2 or pscf_pc3 CPU programs for periodic microstructres. The next level of subdirectory specifies a type of physical system. For example, the pc/diblock/ subdirectory contains examples of computations involving three-dimensional structures of diblock copolymer melts. Lower level subdirectories such as pc/diblock/gyroid contain one or more examples for a specific crystal structure.

Input files

The input files for each example are in a separate directory, which we will refer to as an example directory. Each example directory contains a set of input files that include at least one parameter file, at least one command file and an input chemical potential file. In the simplest and most common case, there is a single parameter file named "param" and a single command file is named "command". Directories that contain two or more closely related examples generally contain a filed README or CONTENTS that explains how to use the files to run different examples.

A typical example directory contains files and subdirectories with the following names:

param
command
run
clean
in/
w.bf
out/

Here, in/ and out/ are names of subdirectories. The file in/w.bf is the input chemical potential field. The out/ subdirectory is initially empty. The files named "run" and "clean" are unix shell scripts that users may execute to run the simulation and clean up afterwards, respectively.

Running an example

Users may run example simulations either by executing the "run" script that is provided with most examples, or by invoking the relevant simulation program from the command line. The run script is a bash script that contains a line that gives the required executable command name and arguments, so it is useful for users to examine the text of the "run" script in order to see an example of the relevant command.

To use a "run" script, simply issue the command

./run

from within the directory containing the example and the "run" script file.

To use pscf_pc3 to run a simple example computation with the above directory structure, one could change directory (cd) to the directory containing the example and issue the command

pscf_pc3 -e -p param -c command

This command would send log output to the terminal. The "run" script simply issues this command or something very similar to it for you. To run the calculation in background and redirect the log output to a file out/log, one could instead type

pscf_pc3 -e -p param -c command > out/log &

A command to execute a different PSCF programs would have a similar syntax except for the replacement of the executable name pscf_pc3 by a different executable name, such as pscf_pc2 or pscf_fd.

Note: In the above examples, we recommend issuing the command "./run" rather than simply "run" to execute the run script. Most users will need to include the "./" prefix in order to tell the unix shell to look for the executable file named "run" in the current working directory, rather than in one of the standard system directories that contain executable files. The prefix is unnecessary if and only if the users PATH variable has been modified so as to include the current working directory among the list of directories in which to search for an executable file.

Cleaning Up

After running an example, you may run the command

./clean

in order to execute a script that removes any output data files created by the example. Most output files are created in the out/ directory, so this script normally removes all files in this directory.


Thermodynamic Properties (Prev)         User Guide (Up)         Crystal Unit Cells (Next)