Author: bugman Date: Mon Aug 9 12:21:07 2010 New Revision: 11442 URL: http://svn.gna.org/viewcvs/relax?rev=11442&view=rev Log: Added 4 more unit tests for the compile_2nd_matrix_*() functions, and modified one of the others. Modified: 1.3/test_suite/unit_tests/_maths_fns/test_frame_order_matrix_ops.py Modified: 1.3/test_suite/unit_tests/_maths_fns/test_frame_order_matrix_ops.py URL: http://svn.gna.org/viewcvs/relax/1.3/test_suite/unit_tests/_maths_fns/test_frame_order_matrix_ops.py?rev=11442&r1=11441&r2=11442&view=diff ============================================================================== --- 1.3/test_suite/unit_tests/_maths_fns/test_frame_order_matrix_ops.py (original) +++ 1.3/test_suite/unit_tests/_maths_fns/test_frame_order_matrix_ops.py Mon Aug 9 12:21:07 2010 @@ -180,17 +180,17 @@ cone_axis = zeros(3, float64) # Calculate the frame order matrix. - f2 = compile_2nd_matrix_iso_cone_free_rotor(self.f2_temp, R, z_axis, cone_axis, 0.0, 1.0, -0.5) - - # Print outs. - print_frame_order_2nd_degree(self.I_disorder_free_rotor, "Free rotor identity for disorder") - print_frame_order_2nd_degree(f2, "Compiled frame order") - - # Check the values. - for i in range(9): - for j in range(9): - print "Element %s, %s." % (i, j) - self.assertAlmostEqual(f2[i, j], self.I_disorder_free_rotor[i, j]) + f2 = compile_2nd_matrix_iso_cone_free_rotor(self.f2_temp, R, z_axis, cone_axis, 0.0, 1.0, 0.0) + + # Print outs. + print_frame_order_2nd_degree(self.I_disorder, "Free rotor identity for disorder") + print_frame_order_2nd_degree(f2, "Compiled frame order") + + # Check the values. + for i in range(9): + for j in range(9): + print "Element %s, %s." % (i, j) + self.assertAlmostEqual(f2[i, j], self.I_disorder[i, j]) def test_compile_2nd_matrix_iso_cone_free_rotor_order(self): @@ -203,6 +203,94 @@ # Calculate the frame order matrix. f2 = compile_2nd_matrix_iso_cone_free_rotor(self.f2_temp, R, z_axis, cone_axis, 0.0, 1.0, 1.0) + + # Print outs. + print_frame_order_2nd_degree(self.I_order_free_rotor, "Free rotor identity for order") + print_frame_order_2nd_degree(f2, "Compiled frame order") + + # Check the values. + for i in range(9): + for j in range(9): + print "Element %s, %s." % (i, j) + self.assertAlmostEqual(f2[i, j], self.I_order_free_rotor[i, j]) + + + def test_compile_2nd_matrix_pseudo_ellipse_disorder(self): + """Check if compile_2nd_matrix_pseudo_ellipse() can return the identity matrix for disorder.""" + + # Init. + R = eye(3) + z_axis = array([0, 0, 1], float64) + cone_axis = zeros(3, float64) + + # Calculate the frame order matrix. + f2 = compile_2nd_matrix_pseudo_ellipse(self.f2_temp, R, 0.0, 0.0, 0.0, pi, pi, pi) + + # Print outs. + print_frame_order_2nd_degree(self.I_disorder, "Identity for disorder") + print_frame_order_2nd_degree(f2, "Compiled frame order") + + # Check the values. + for i in range(9): + for j in range(9): + print "Element %s, %s." % (i, j) + self.assertAlmostEqual(f2[i, j], self.I_disorder[i, j]) + + + def test_compile_2nd_matrix_pseudo_ellipse_order(self): + """Check if compile_2nd_matrix_pseudo_ellipse() can return the identity matrix for order.""" + + # Init. + R = eye(3) + z_axis = array([0, 0, 1], float64) + cone_axis = zeros(3, float64) + + # Calculate the frame order matrix. + f2 = compile_2nd_matrix_pseudo_ellipse(self.f2_temp, R, 0.0, 0.0, 0.0, 1e-5, 1e-10, 1e-5) + + # Print outs. + print_frame_order_2nd_degree(self.I_order, "Identity for order") + print_frame_order_2nd_degree(f2, "Compiled frame order") + + # Check the values. + for i in range(9): + for j in range(9): + print "Element %s, %s." % (i, j) + self.assertAlmostEqual(f2[i, j], self.I_order[i, j]) + + + def test_compile_2nd_matrix_pseudo_ellipse_free_rotor_disorder(self): + """Check if compile_2nd_matrix_pseudo_ellipse_free_rotor() can return the identity matrix for disorder.""" + + # Init. + R = eye(3) + z_axis = array([0, 0, 1], float64) + cone_axis = zeros(3, float64) + + # Calculate the frame order matrix. + f2 = compile_2nd_matrix_pseudo_ellipse_free_rotor(self.f2_temp, R, 0.0, 0.0, 0.0, pi, pi) + + # Print outs. + print_frame_order_2nd_degree(self.I_disorder, "Free rotor identity for disorder") + print_frame_order_2nd_degree(f2, "Compiled frame order") + + # Check the values. + for i in range(9): + for j in range(9): + print "Element %s, %s." % (i, j) + self.assertAlmostEqual(f2[i, j], self.I_disorder[i, j]) + + + def test_compile_2nd_matrix_pseudo_ellipse_free_rotor_order(self): + """Check if compile_2nd_matrix_pseudo_ellipse_free_rotor() can return the identity matrix for order.""" + + # Init. + R = eye(3) + z_axis = array([0, 0, 1], float64) + cone_axis = zeros(3, float64) + + # Calculate the frame order matrix. + f2 = compile_2nd_matrix_pseudo_ellipse_free_rotor(self.f2_temp, R, 0.0, 0.0, 0.0, 1e-10, 1e-10) # Print outs. print_frame_order_2nd_degree(self.I_order_free_rotor, "Free rotor identity for order")