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

  1. Load structure data from pw.x output and XSF files
  2. Retrieve data from QE output files
  3. Retrieve data from XSF files
  4. Retrieve data with grep
  5. Retrieve instances of currently stored input data
  6. Manipulate atomic structures

Load structure data from pw.x output and XSF files

Load atomic positions (for pw.x and cp.x):

Load atomic positions (for neb.x):

Load cell parameters:

Load cell parameters + atomic positions (for pw.x and cp.x):

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.: