[Xplor-nih] error message
Charles at Schwieters.org
Charles at Schwieters.org
Tue Jun 19 10:04:11 EDT 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Hello Marco--
>
> Is there an easy way to write the energies during the dynamic e.g. in a csv
> file? So it would become very easy to make a graph out of them. One of the
> molecular modelling guys here asked me this also a few days ago.
>
sure. Place the definition of the PrintEnergyTraj class (below) before
the structure calculation loop. Then at the beginning of structure
calculation (in calcOneStructure in eginput/gb1_rdc/anneal.py)
initialize the ivm object before high-temperature dynamics like
dyn.setTrajectory( PrintEnergyTraj("energy.out",dyn) )
on each line of energy.out are iteration number, time, potential and
total energy.
best regards--
Charles
class PrintEnergyTraj:
"""a trajectory object to be used with an <m ivm>.IVM object, used to
print energy during a trajectory run.
Use the IVM setTrajectory method to assign to view a given ivm
trajectory.
"""
def __init__(s,filename,ivm):
"""specify the filename to print energy in. The frequency of update is
controlled via the saveInterval member (defaults to 1 [every frame]).
"""
s.saveInterval = 1
s.file=open(filename,"w")
s.time=0
s.ivm=ivm
return
def write(s,iter,stepsize):
if iter%s.saveInterval != 0: return
s.time += stepsize
print >>s.file,iter,s.time,s.ivm.Epotential(), s.ivm.Etotal()
return
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.8+ <http://mailcrypt.sourceforge.net/>
iD8DBQFGd+JbPK2zrJwS/lYRAm87AJ9aggtJEicGjMs1kreggTWx72i//ACdFq3a
rg8kHEFT/ZoC0c4eyqspB14=
=N8+c
-----END PGP SIGNATURE-----
More information about the Xplor-nih
mailing list