# [MMTK] Re: Conjugate gradient minimization in 2.2b6

**Berit Hinnemann
**
Berit.Hinnemann@fysik.dtu.dk

*Mon, 20 Aug 2001 14:05:09 +0200*

>* Strange. Could you do the following test: after setting the "fixed"
*>* attribute,
*>*
*>* print universe.getAtomBooleanArray('fixed').array.typecode()
*
This prints indeed 'l' (you meant the letter 'l', not the number '1',
right?).
>* While you are at it, you can also do
*>*
*>* print universe.getAtomBooleanArray('fixed').sumOverParticles()
*
This also gives the result '4'.
I also tried to do
fixed = universe.getAtomBooleanArray('fixed')
for i in range(len(universe.atomList())):
outfile.write(`fixed[i]`)
outfile.write('\n')
which is, as I understood, done in the class ConjugateGradientMinimizer
before things are handed over to the C-function. I got an array with
zeros, except for the elements 0,22,26,48, where there is '1', so at the
same list positions as where you had the fixed atoms out of the
NetCDFFile.
Could it be that there is something wrong with some functions in my
version of NumPy, and the minimization uses these functions? I could try
to install the newer versions of Python and NumPy and see whether it
works differently.
Thanks a lot for your help,
Berit
--
Berit Hinnemann
Center for Atomic-Scale Materials Physics (CAMP)
Dept. of Physics, Technical University of Denmark
Building 307, DK-2800 Lyngby, Denmark
Phone: +45 4525 3209, Fax: +45 4593 2399