mailr14848 - /1.3/test_suite/system_tests/scripts/n_state_model/metal_pos_opt.py


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

Header


Content

Posted by edward on October 12, 2011 - 17:36:
Author: bugman
Date: Wed Oct 12 17:36:19 2011
New Revision: 14848

URL: http://svn.gna.org/viewcvs/relax?rev=14848&view=rev
Log:
Added another check to the metal optimisation N-state model system test 
script.

This now catches if the metal has been optimised when the tensors are fixed.


Modified:
    1.3/test_suite/system_tests/scripts/n_state_model/metal_pos_opt.py

Modified: 1.3/test_suite/system_tests/scripts/n_state_model/metal_pos_opt.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/test_suite/system_tests/scripts/n_state_model/metal_pos_opt.py?rev=14848&r1=14847&r2=14848&view=diff
==============================================================================
--- 1.3/test_suite/system_tests/scripts/n_state_model/metal_pos_opt.py 
(original)
+++ 1.3/test_suite/system_tests/scripts/n_state_model/metal_pos_opt.py Wed 
Oct 12 17:36:19 2011
@@ -7,6 +7,7 @@
 # relax module imports.
 from data import Relax_data_store; ds = Relax_data_store()
 from generic_fns import pipes
+from relax_errors import RelaxError
 from status import Status; status = Status()
 
 
@@ -70,9 +71,28 @@
     # Fix the tensor.
     align_tensor.fix(id=align_list[i])
 
+# Print out.
+print "\n\n"
+print "##############################"
+print "# Ln3+ position optimisation #"
+print "##############################\n\n\n"
+
 # Optimise the Ln3+ position.
+x, y, z = cdp.paramagnetic_centre
 paramag.centre(fix=False)
 minimise('simplex', constraints=False)
+
+# Check that the metal moved.
+print("\nOriginal position: [%.3f, %.3f, %.3f]" % (x, y, z))
+print("New position:      [%.3f, %.3f, %.3f]\n" % 
(cdp.paramagnetic_centre[0], cdp.paramagnetic_centre[1], 
cdp.paramagnetic_centre[2]))
+if "%.3f" % x == "%.3f" % cdp.paramagnetic_centre[0] or "%.3f" % y == "%.3f" 
% cdp.paramagnetic_centre[1] or "%.3f" % z == "%.3f" % 
cdp.paramagnetic_centre[2]:
+    raise RelaxError("The metal position has not been optimised!")
+
+# Print out.
+print "\n\n"
+print "#######################"
+print "# Tensor optimisation #"
+print "#######################\n\n\n"
 
 # Optimise each tensor again, one by one.
 paramag.centre(fix=True)
@@ -80,6 +100,12 @@
     align_tensor.fix(id=align_list[i], fixed=False)
     minimise('newton', constraints=False)
     align_tensor.fix(id=align_list[i], fixed=True)
+
+# Print out.
+print "\n\n"
+print "#######################"
+print "# Global optimisation #"
+print "#######################\n\n\n"
 
 # Optimise everything.
 align_tensor.fix(fixed=False)




Related Messages


Powered by MHonArc, Updated Wed Oct 12 18:00:02 2011