mailr11280 - /1.3/generic_fns/paramag.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on July 02, 2010 - 12:07:
Author: bugman
Date: Fri Jul  2 12:07:05 2010
New Revision: 11280

URL: http://svn.gna.org/viewcvs/relax?rev=11280&view=rev
Log:
Fixes for solely specifying that the paramag centre will be optimised.


Modified:
    1.3/generic_fns/paramag.py

Modified: 1.3/generic_fns/paramag.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/paramag.py?rev=11280&r1=11279&r2=11280&view=diff
==============================================================================
--- 1.3/generic_fns/paramag.py (original)
+++ 1.3/generic_fns/paramag.py Fri Jul  2 12:07:05 2010
@@ -74,6 +74,13 @@
     if not force and hasattr(cdp, 'paramagnetic_centre'):
         raise RelaxError("The paramagnetic centre has already been set to 
the coordinates " + repr(cdp.paramagnetic_centre) + ".")
 
+    # The fixed flag.
+    if fix:
+        print("The paramagnetic centre will be fixed during optimisation.")
+    else:
+        print("The paramagnetic centre will be optimised.")
+    cdp.paramag_centre_fix = fix
+
     # Position is supplied.
     if pos != None:
         centre = array(pos)
@@ -81,7 +88,7 @@
         full_pos_list = []
 
     # Position from a loaded structure.
-    else:
+    elif atom_id:
         # Get the positions.
         centre = zeros(3, float64)
         full_pos_list = []
@@ -107,6 +114,10 @@
         if not num_pos:
             raise RelaxError("No positional information could be found for 
the spin '%s'." % atom_id)
 
+    # No position - so simply exit the function.
+    else:
+        return
+
     # Averaging.
     centre = centre / float(num_pos)
 
@@ -127,6 +138,3 @@
         if verbosity:
             print("\nUsing all paramagnetic positions.")
         cdp.paramagnetic_centre = full_pos_list
-
-    # The fixed flag.
-    cdp.paramag_centre_fix = fix




Related Messages


Powered by MHonArc, Updated Fri Jul 02 13:40:02 2010