PSCF v1.3.3
State Files

Thermo Files (Prev)         Parameter Sweeps (Prev)        

State files are designed to contain values of both input parameters and output variables for an SCFT calculation. The file format for a state file consists of a parameter file block followed by a thermo file block. The parameter file block contains input variables and has the nested curly-bracket format of a parameter file. The thermo section contains output variables and has the format of a thermo file block.

Each instance of class State (or pscfpp.output.State) is used to store the contents of such a state file. Each State object has two data attributes named param and thermo that are used to store the contents of these two sections of the corresponding file. The data attribute named 'param' is a param.Composite object that contains the contents of the parameter block of the state file. A second attribute named 'thermo' is a Thermo object that that contains the contains of the thermo block of the state file.

To parse a state file named 'input' that was produced by an SCFT calculation, one may enter the commands

from pscfpp.output import *
state = State('input')
Module of parsers for PSCF output file formats.
Definition output.py:1
Python package of all python modules provided with PSCF.
Definition __init__.py:1

The constructor for class State opens and parses the specified file and returns an object that contains the contents of this file. The resulting object is assigned here to a variable named state.

After construction, values of individual input and output variables can be obtained by using the dot syntax for attributes of the param.Composite and Thermo data attributes. In the case described above, the quantity

state.param.Mixture.nMonomer

is the number of monomer types in the system of interest. Similarly,

state.thermo.polymers[1].mu

is the chemical potential of polymer 1 (the second polymer) in a mixture that contains two or more polymer species. Values for any other variable can be accessed through state.param or state.thermo using the dot syntax for accessing data stored in a param.Composite or Thermo object, as described above for these two classes.


Thermo Files (Prev)         Python Tools (Up)         Parameter Sweeps (Prev)