/[escript]/trunk/finley/test/python/run_models.py
ViewVC logotype

Diff of /trunk/finley/test/python/run_models.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2675 by gross, Mon Sep 21 02:32:17 2009 UTC revision 2676 by gross, Mon Sep 21 08:06:37 2009 UTC
# Line 1103  class Test_FaultSystem(unittest.TestCase Line 1103  class Test_FaultSystem(unittest.TestCase
1103        f.addFault(V0=[0.5,0.], strikes=[3.*pi/4], ls=[0.70710678118654757], tag=1)        f.addFault(V0=[0.5,0.], strikes=[3.*pi/4], ls=[0.70710678118654757], tag=1)
1104        f.addFault(V0=[1.,0.5], strikes=[pi, pi/2], ls=[0.5,0.5], tag=2)        f.addFault(V0=[1.,0.5], strikes=[pi, pi/2], ls=[0.5,0.5], tag=2)
1105    
1106        m, t, l=f.getMaxValue(x[0]*(1.-x[0])*(1-x[1]))        u=x[0]*(1.-x[0])*(1-x[1])
1107          t, loc=f.getMaxValue(u)
1108          p=f.getParametrization(x,t)[0]
1109          m, l=loc(u), loc(p)
1110        self.failUnless(  m == 0.25, "wrong max value")        self.failUnless(  m == 0.25, "wrong max value")
1111        self.failUnless(  t == 1, "wrong max tag")        self.failUnless(  t == 1, "wrong max tag")
1112        self.failUnless(  l == 0., "wrong max location")        self.failUnless(  l == 0., "wrong max location")
1113        m, t, l=f.getMaxValue(x[1]*(1.-x[1])*(1-x[0])*x[0])  
1114          u=x[1]*(1.-x[1])*(1-x[0])*x[0]
1115          t, loc=f.getMaxValue(u)
1116          p=f.getParametrization(x,t)[0]
1117          m, l=loc(u), loc(p)
1118        self.failUnless(  m == 0.0625, "wrong max value")        self.failUnless(  m == 0.0625, "wrong max value")
1119        self.failUnless(  t == 2, "wrong max tag")        self.failUnless(  t == 2, "wrong max tag")
1120        self.failUnless(  l == 0.5, "wrong max location")        self.failUnless(  l == 0.5, "wrong max location")
1121        m, t, l=f.getMaxValue(x[0]*(1.-x[0])*x[1])  
1122          u=x[0]*(1.-x[0])*x[1]
1123          t, loc=f.getMaxValue(u)
1124          p=f.getParametrization(x,t)[0]
1125          m, l=loc(u), loc(p)
1126        self.failUnless(  m == 0.25, "wrong max value")        self.failUnless(  m == 0.25, "wrong max value")
1127        self.failUnless(  t == 2, "wrong max tag")        self.failUnless(  t == 2, "wrong max tag")
1128        self.failUnless(  l == 1.0, "wrong max location")        self.failUnless(  l == 1.0, "wrong max location")
1129        m, t, l= f.getMaxValue(x[1]*(1.-x[1])*x[0])  
1130          u=x[1]*(1.-x[1])*x[0]
1131          t, loc=f.getMaxValue(u)
1132          p=f.getParametrization(x,t)[0]
1133          m, l=loc(u), loc(p)
1134        self.failUnless(  m == 0.25, "wrong max value")        self.failUnless(  m == 0.25, "wrong max value")
1135        self.failUnless(  t == 2, "wrong max tag")        self.failUnless(  t == 2, "wrong max tag")
1136        self.failUnless(  l == 0., "wrong max location")        self.failUnless(  l == 0., "wrong max location")
1137        m, t, l= f.getMaxValue(x[1]*(1.-x[1])*(1.-x[0]))  
1138          u=x[1]*(1.-x[1])*(1.-x[0])
1139          t, loc=f.getMaxValue(u)
1140          p=f.getParametrization(x,t)[0]
1141          m, l=loc(u), loc(p)
1142        self.failUnless(  m == 0.25, "wrong max value")        self.failUnless(  m == 0.25, "wrong max value")
1143        self.failUnless(  t == 1, "wrong max tag")        self.failUnless(  t == 1, "wrong max tag")
1144        self.failUnless(  abs(l-0.70710678118654) <= self.EPS,  "wrong max location")        self.failUnless(  abs(l-0.70710678118654) <= self.EPS,  "wrong max location")
# Line 1130  class Test_FaultSystem(unittest.TestCase Line 1149  class Test_FaultSystem(unittest.TestCase
1149        f.addFault(V0=[0.5,0.], strikes=[3.*pi/4], ls=[0.70710678118654757], tag=1)        f.addFault(V0=[0.5,0.], strikes=[3.*pi/4], ls=[0.70710678118654757], tag=1)
1150        f.addFault(V0=[1.,0.5], strikes=[pi, pi/2], ls=[0.5,0.5], tag=2)        f.addFault(V0=[1.,0.5], strikes=[pi, pi/2], ls=[0.5,0.5], tag=2)
1151    
1152        m, t, l=f.getMinValue(-x[0]*(1.-x[0])*(1-x[1]))        u=-x[0]*(1.-x[0])*(1-x[1])
1153          t, loc=f.getMinValue(u)
1154          p=f.getParametrization(x,t)[0]
1155          m, l=loc(u), loc(p)
1156        self.failUnless(  m == -0.25, "wrong min value")        self.failUnless(  m == -0.25, "wrong min value")
1157        self.failUnless(  t == 1, "wrong min tag")        self.failUnless(  t == 1, "wrong min tag")
1158        self.failUnless(  l == 0., "wrong min location")        self.failUnless(  l == 0., "wrong min location")
1159        m, t, l=f.getMinValue(-x[1]*(1.-x[1])*(1-x[0])*x[0])        u=-x[1]*(1.-x[1])*(1-x[0])*x[0]
1160          t, loc=f.getMinValue(u)
1161          p=f.getParametrization(x,t)[0]
1162          m, l=loc(u), loc(p)
1163        self.failUnless(  m == -0.0625, "wrong min value")        self.failUnless(  m == -0.0625, "wrong min value")
1164        self.failUnless(  t == 2, "wrong min tag")        self.failUnless(  t == 2, "wrong min tag")
1165        self.failUnless(  l == 0.5, "wrong min location")        self.failUnless(  l == 0.5, "wrong min location")
1166        m, t, l=f.getMinValue(-x[0]*(1.-x[0])*x[1])        u=-x[0]*(1.-x[0])*x[1]
1167          t, loc=f.getMinValue(u)
1168          p=f.getParametrization(x,t)[0]
1169          m, l=loc(u), loc(p)
1170        self.failUnless(  m == -0.25, "wrong min value")        self.failUnless(  m == -0.25, "wrong min value")
1171        self.failUnless(  t == 2, "wrong min tag")        self.failUnless(  t == 2, "wrong min tag")
1172        self.failUnless(  l == 1.0, "wrong min location")        self.failUnless(  l == 1.0, "wrong min location")
1173        m, t, l= f.getMinValue(-x[1]*(1.-x[1])*x[0])        u=-x[1]*(1.-x[1])*x[0]
1174          t, loc=f.getMinValue(u)
1175          p=f.getParametrization(x,t)[0]
1176          m, l=loc(u), loc(p)
1177        self.failUnless(  m == -0.25, "wrong min value")        self.failUnless(  m == -0.25, "wrong min value")
1178        self.failUnless(  t == 2, "wrong min tag")        self.failUnless(  t == 2, "wrong min tag")
1179        self.failUnless(  l == 0., "wrong min location")        self.failUnless(  l == 0., "wrong min location")
1180        m, t, l= f.getMinValue(-x[1]*(1.-x[1])*(1.-x[0]))        u=-x[1]*(1.-x[1])*(1.-x[0])
1181          t, loc=f.getMinValue(u)
1182          p=f.getParametrization(x,t)[0]
1183          m, l=loc(u), loc(p)
1184        self.failUnless(  m == -0.25, "wrong min value")        self.failUnless(  m == -0.25, "wrong min value")
1185        self.failUnless(  t == 1, "wrong min tag")        self.failUnless(  t == 1, "wrong min tag")
1186        self.failUnless(  abs(l-0.70710678118654) <= self.EPS,  "wrong min location")        self.failUnless(  abs(l-0.70710678118654) <= self.EPS,  "wrong min location")

Legend:
Removed from v.2675  
changed lines
  Added in v.2676

  ViewVC Help
Powered by ViewVC 1.1.26