TABLE OF CONTENTS
2.7 Data Retrieval and Atomic Structures
DESCRIPTION
This section explains commands for retrieving data from QE output and XSF files, for retrieving instances of currently stored input data, and for simple manipulation of atomic structures.
TABLE OF CONTENTS
- Load structure data from pw.x output and XSF files
- Retrieve data from QE output files
- Retrieve data from XSF files
- Retrieve data with grep
- Retrieve instances of currently stored input data
- Manipulate atomic structures
Load structure data from pw.x output and XSF files
Load atomic positions (for pw.x and cp.x):
- ATOMIC_POSITIONS_fromPWO (see: ::pwtk::pwi::ATOMIC_POSITIONS_fromPWO)
- ATOMIC_POSITIONS_fromXSF (see: ::pwtk::pwi::ATOMIC_POSITIONS_fromXSF)
Load atomic positions (for neb.x):
- POSITIONS_fromAXSF (see ::pwtk::nebi::POSITIONS_fromAXSF)
- POSITIONS_fromCRD (see ::pwtk::nebi::POSITIONS_fromCRD)
- POSITIONS_fromPATH (see ::pwtk::nebi::POSITIONS_fromPATH)
Load cell parameters:
- CELL_PARAMETERS_fromPWO (see: ::pwtk::pwi::CELL_PARAMETERS_fromPWO)
- CELL_PARAMETERS_fromXSF (see: ::pwtk::pwi::CELL_PARAMETERS_fromXSF)
Load cell parameters + atomic positions (for pw.x and cp.x):
- CELL_PARAMETERS_and_ATOMIC_POSITIONS_fromPWO (see: ::pwtk::pwi::CELL_PARAMETERS_and_ATOMIC_POSITIONS_fromPWO)
- CELL_PARAMETERS_and_ATOMIC_POSITIONS_fromXSF (see: ::pwtk::pwi::CELL_PARAMETERS_and_ATOMIC_POSITIONS_fromXSF)
For more functionality, see ::pwtk::pwi (also ::pwtk::phi, ::pwtk::ppi, ::pwtk::pri ...)
Retrieve data from QE output files
• Retrieve data from pw.x output files:
see ::pwtk::pwo
• Retrieve data from neb.x output files:
see ::pwtk::nebo
• Retrieve data from neb.x path files:
see ::pwtk::path
• Retrieve data from dynmat.x output files:
see ::pwtk::dmo
Retrieve data from XSF files
Retrieve atomic structural data from XSF files: see xsf_struct_utils
Retrieve data with grep
If a PWTK command for retrieving a specific data from a file is not available, one can use 'grep'. PWTK has a few simple grep-type commands, i.e.:
For example, to grep the last line matching "new unit-cell volume" from the pw.x output file, use:
::pwtk::grep {new unit-cell volume} vc-relax.out end
which returns:
new unit-cell volume = 456.81919 a.u.^3 ( 67.69362 Ang^3 )
whereas:
::pwtk::grep_field {new unit-cell volume} vc-relax.out 4 end
returns only the volume:
456.81919
In addition, one can also access the 'egrep' or 'grep' executables using the ::pwtk::try_exec command. For example:
try_exec -i grep -A 3 {crystal axes:} relax.out
returns:
crystal axes: (cart. coord. in units of alat) a(1) = ( 1.000000 0.000000 0.000000 ) a(2) = ( -0.500000 0.866025 0.000000 ) a(3) = ( 0.000000 0.000000 3.077553 )
N.B. the "-i" option, given to ::pwtk::try_exec, implies "ignore errors", which is useful in this case because if a pattern is not found in the file, the 'grep' executable returns an error.
Retrieve instances of currently stored input data
• Retrieve individual namelist:
::pwtk::input::namelistGet
• Retrieve a value of a given namelist's variable:
::pwtk::input::namelistGetVarValue
• Retrieve individual card:
::pwtk::input::cardGet
• Retrieve flags of an individual card:
::pwtk::input::cardGetFlags
• Retrieve the content of an individual card:
::pwtk::input::cardGetContent
Manipulate atomic structures
Various commands are available for simple manipulation of atomic structures, such as inserting, deleting, fixing, and substituting atoms, i.e.:
- for simple manipulation of atomic structures for the pw.x and cp.x programs, see ::pwtk::pwi and pwi_struct_utils
- for simple manipulation of atomic structures for the neb.x program, see ::pwtk::nebi and nebi_struct_utils
- see also generic_struct_utils and xsf_struct_utils