TABLE OF CONTENTS


63-treatrun

DESCRIPTION

This example shows how to use the ::pwtk::treatrun feature which allows to replace a default implementation of a runCmd command (e.g. runPW, runNEB...), which can be useful for reusing existing workflows in various circumstances, as illustrated below with a simple example.

This is a reused flo-N2OPd.pwtk example, utilizing the FLO workflow to perform the dissociation of N2O on Pd(110), but here the focus is on the ::pwtk::treatrun feature.

EXAMPLE SOURCE FILE

treatrun.pwtk

SOURCE

# import input data for N2O/Pd(110) from N2OPd.pwtk
import N2OPd.pwtk


# The FLO workflow (::pwtk::flo::run) utilizes a path-type
# transition-state calculation, where the first and last images are
# first optimized with pw.x and only then the neb.x calculation is
# performed using the so-optimized first and last images.
#
# ::pwtk::flo::run uses the plain ::pwtk::runNEB command. However, it
# is more efficient to use the ::pwtk::auto_neb workflow instead,
# which consists of preliminary no-CI calculation followed by the
# auto-CI calculation.
#
# With ::pwtk::treatrun we can instruct PWTK to use ::pwtk::auto_neb
# instead of ::pwtk::runNEB, i.e.:

treatrun runNEB {
    auto_neb -noCI_thr 0.8 -CI_thr 0.05
}

# just as an excercise, let's also use ::pwtk::postrun to print to
# stdout the total energies of relaxed first and last images

postrun pw.x {
    set niter  [llength [pwtk::egrep ^! $output]]
    set totene [pwo_totene $output]
    print "Relaxed total energy = $totene Ry\nRelaxation took $niter iterations.\n"
}


# the FLO workflow is run with flo_run, a shorcut to ::pwtk::flo::run
flo_run flo.N2O-Pd110-c2x2-3L