pwtools.parse.CpmdMDOutputFile¶
- class pwtools.parse.CpmdMDOutputFile(*args, **kwds)[source]¶
Bases:
TrajectoryFileParser
,CpmdSCFOutputFile
Parse CPMD MD output.
Works with BO-MD and CP-MD, fixed and variable cell. Some attrs may be None or have different shapes (2d va 3d arrays) depending on what type of MD is parsed and what info/files are available.
Notes for the comments below:
{A,B,C} = A or B or C (A) = A is optional (A (B)) = A is optional, but only if present, B is optional
Extra files which will be parsed and MUST be present:
GEOMETRY.scale GEOMETRY TRAJECTORY ENERGIES
Extra files which will be parsed and MAY be present depending on the type of MD:
(FTRAJECTORY) (CELL) (STRESS)
Notes
The input should look like that:
&CPMD MOLECULAR DYNAMICS {BO,CP} (PARRINELLO-RAHMAN (NPT)) PRINT ON FORCES COORDINATES TRAJECTORY XYZ FORCES STRESS TENSOR <step> ... &END &SYSTEM SCALE ... &END
Tested with CPMD 3.15.1, the following extra files are always written:
GEOMETRY.scale GEOMETRY TRAJECTORY ENERGIES
In the listing below, we show which extra files are written (+) or not (-) if the input follows the example above.
Also, the order of columns in the ENERGIES file depends on what type of MD we are running. In case of BO-MD it depends on the kind of wavefunction optimizer, too! This is most unpleasant. Currently we rely on the fact that each tested case has a different number of columns, but this is very hackish b/c it is not guaranteed to be unique! Maybe, we should let the user set self.energies_order or a keywords mdtype={‘cp-npt’, ‘bo’, etc} instead of subclassed for each case.
This is what we tested so far (cpmd 3.15.1). For BO-MD + ODIIS, some columns are always 0.0, but all are there (e.g. EKINC is there but 0.0 b/c not defined for BO, only CP). For BO-MD, we list the wf optimizer (xxx for CP b/c there is none):
MOLECULAR DYNAMICS BO +FTRAJECTORY -CELL -STRESS # why!? ODISS NFI EKINC TEMPP EKS ECLASSIC EHAM DIS TCPU LANCZOS DIAGONALIZATION NFI TEMPP EKS ECLASSIC DIS TCPU MOLECULAR DYNAMICS CP +FTRAJECTORY -CELL +STRESS xxx NFI EKINC TEMPP EKS ECLASSIC EHAM DIS TCPU MOLECULAR DYNAMICS BO PARRINELLO-RAHMAN not implemented ! MOLECULAR DYNAMICS CP PARRINELLO-RAHMAN -FTRAJECTORY # why!? +CELL +STRESS xxx NFI EKINC EKINH TEMPP EKS ECLASSIC EHAM DIS TCPU MOLECULAR DYNAMICS BO PARRINELLO-RAHMAN NPT -FTRAJECTORY # why!? +CELL +STRESS ODIIS NFI EKINC EKINH TEMPP EKS ECLASSIC EHAM DIS TCPU MOLECULAR DYNAMICS CP PARRINELLO-RAHMAN NPT -FTRAJECTORY # why!? +CELL +STRESS xxx NFI EKINC EKINH TEMPP EKS ECLASSIC EHAM DIS TCPU
Methods
Like _apply_units_raw(), make sure that units are only applied once.
assert_attr
(attr)Raise AssertionError if self.<attr> is not set (is_set_attr() returns False.
assert_attr_lst
(attr_lst)assert_set_attr
(attr)Same as assert_attr(), but run try_set_attr() first.
assert_set_attr_lst
(attr_lst)check_set_attr
(attr)Run try_set_attr() and return the result of is_set_attr(), i.e. True or False.
check_set_attr_lst
(attr_lst)dump
(dump_filename[, mkdir])Write object to binary file using pickle.
get_cell
()2d cell [Bohr]
get_cont
([auto_calc])Populate and return a Container object.
[Ha]
get_ekin
()get_etot
()[Ha]
Cartesian forces [Ha/Bohr].
Number of atoms.
get_return_attr
(attr_name)Call try_set_attr() are return self.<attr_name> if set.
Stress tensor from STRESS file if available [kbar]
get_struct
(**kwds)[K]
[K]
Timestep [thart].
get_traj
(**kwds)init_attr_lst
([attr_lst])Set each self.<attr> in attr_lst to None.
is_set_attr
(attr)Check if self has the attribute self.<attr> and if it is _not_ None.
is_set_attr_lst
(attr_lst)load
(dump_filename)Load pickled object.
parse
()raw_return
(attr_name)Call
try_set_attr(_<attr_name>_raw)
and return it if set, else None.raw_slice_get
(attr_name, sl, axis)Shortcut method:
set_all
([attr_lst])Call getter for each attr name in attr_lst.
set_attr_lst
(attr_lst)Set self.attr_lst and init each attr to None.
try_set_attr
(attr)If self.<attr> does not exist or is None, then invoke an appropirately named getter as if this command would be executed.
try_set_attr_lst
(attr_lst)update_units
(units)Update self.units dict from units.
Attributes