7. Files and file names¶
7.1. mesh files (
Files that contain a finite element mesh. See Nmesh file format.
7.2. Simulation scripts (
Files that contain simulation program code. The ending is (by
.py which reflects that the programming language used
All the example codes provided in the Guided Tour are such simulation scripts.
7.3. Data files (
ndt files are ascii files where each row corresponds to one time
step (or, more generally, configuration of the system). The columns
- metadata such as
- a unique identifier for every row
- the time at which the row was written
- (spatially) averaged field data
The first two lines contain information about what data is stored in the various columns:
- The first line provides a header
- The second line provides the SI units
All other lines contain the actual data.
The file can be loaded into any data processing software (such as MS Excel, Origin, Matlab, Gnuplot, ...). However, often it is more convenient to use the ncol tool to select the relevant columns, and only to pass the filtered data to a post-processing (e.g. plotting) program.
Data is written into the
ndt file whenever the save_data method
of the simulation object is called.
7.4. Data files (
h5 data files store spatially resolved fields. The format is
a binary and compressed `hdf5`_ format to which we have convenient
access via the `pytables`_ package for Python. The user should not have
to worry about reading this file directly, but use the nmagpp tool to
access the data.
7.5. File names for data files¶
When a simulation object is created, for example in a file called
mybar.py starting like this:
import nmag sim = nmag.Simulation(name="bar")
then the simulation name is
If no name is provided, i.e. the file
mybar.py starts like this:
import nmag sim = nmag.Simulation()
then the simulation name will be the run id. The run id is the
filename of the simulation script (without the
i.e. the simulation name then will be
Let us assume for the rest of this section that the simulation name
bar. Once we use the save_data command, for example like this:
ndt file will be created, with name
Similarly, if we write the fields spatially resolved:
a h5 data file with name
will be created.
7.6. File names for log files¶
A log file is created that stores (most of) the messages displayed to
stdout (i.e. the screen). The name of the log file starts with the
name of the simulation script (without the
.py extension), and ends with
For example, a simulation script with name
mybar.py will have an
associated log file with name
Another three files will be created if the (undocumented)
--dumpconf switch is provided. This are primarily of use to the
developers and can usually be ignored:
mybar_log.conf: This can be used to configure what data is logged.
mybar_ocaml.conf: Configuration of some variables used in the ocaml code
mybar_nmag.conf: Some variables used in the nmag code