[MMTK] Problems adding configuration to Universe Copy
Jaroslaw Kalinowski
jak at biogeo.uw.edu.pl
Wed Feb 8 21:00:11 CET 2006
Hi,
The exception is exacly due to what is says: gradients and configurations
are instances of ParticlePropery class (or derived classes). Now, for any
arithmetical operation, at first performed is a test wheather both
particle properties are related to the same Universe. If not exception is
raised. Thus when you do:
energy, gradient = universeCopy.energyAndGradients()
Dphi0 = gradient.dotProduct(direction)
direction is a property related to original universe, but gradient is a
property of a new universe being a copy of the first one. You can think
about ParticlePropety (~Scalar, ~Vector, Configuration) as arrays that
remember universes they belong to.
The question is why do you need copies of universe? I suppose that what
you really need is ability to evaluate energy and gradients for a new
point. So why not just make a copy of the configuration object using
copyConfiguration() method and after doing calculations revert changes
using setConfiguration()?
BTW, addToConfiguration method was broken in recent stable versions, see
http://starship.python.net/pipermail/mmtk/2005/000907.html.
Best regards,
Jaroslaw Kalinowski
More information about the mmtk
mailing list