Ejemplo n.º 1
0
 def test_newton_iter(self):
     _test_recursion_cache(
         self, lambda:
         ((types.frozenarray(lhs), resnorm)
          for lhs, resnorm in solver.newton('dofs',
                                            residual=self.residual,
                                            lhs0=self.lhs0,
                                            constrain=self.cons)))
Ejemplo n.º 2
0
 def test_pseudotime_iter(self):
     _test_recursion_cache(
         self, lambda:
         ((types.frozenarray(lhs), info.resnorm)
          for lhs, info in solver.pseudotime('dofs',
                                             residual=self.residual,
                                             lhs0=self.lhs0,
                                             constrain=self.cons,
                                             inertia=self.inertia,
                                             timestep=1)))
Ejemplo n.º 3
0
 def test_minimize_iter(self):
     _test_recursion_cache(
         self, lambda:
         ((types.frozenarray(lhs), info.resnorm) for lhs, info in solver.
          minimize('dofs', energy=self.energy, constrain=self.cons)))
Ejemplo n.º 4
0
 def test_pseudotime_iter(self):
   _test_recursion_cache(self, lambda: ((types.frozenarray(lhs), info.resnorm) for lhs, info in solver.pseudotime('dofs', residual=self.residual, lhs0=self.lhs0, constrain=self.cons, inertia=self.inertia, timestep=1)))
Ejemplo n.º 5
0
 def test_newton_iter(self):
   _test_recursion_cache(self, lambda: ((types.frozenarray(lhs), info.resnorm) for lhs, info in solver.newton('dofs', residual=self.residual, constrain=self.cons)))
Ejemplo n.º 6
0
 def test_minimize_iter(self):
   _test_recursion_cache(self, lambda: ((types.frozenarray(lhs), info.resnorm) for lhs, info in solver.minimize('dofs', energy=self.energy, constrain=self.cons)))
Ejemplo n.º 7
0
 def test_isboolarray(self):
     self.assertTrue(numeric.isintarray(numpy.array(1)))
     self.assertTrue(numeric.isintarray(numpy.array([1])))
     self.assertTrue(numeric.isintarray(types.frozenarray([1])))
     self.assertFalse(numeric.isintarray(numpy.array([1.5])))
     self.assertFalse(numeric.isintarray(1.5))
Ejemplo n.º 8
0
 def test_isboolarray(self):
     self.assertTrue(numeric.isboolarray(numpy.array(True)))
     self.assertTrue(numeric.isboolarray(numpy.array([True])))
     self.assertTrue(numeric.isboolarray(types.frozenarray([True])))
     self.assertFalse(numeric.isboolarray(numpy.array([1])))
     self.assertFalse(numeric.isboolarray(True))
Ejemplo n.º 9
0
 def test_isarray(self):
     self.assertTrue(numeric.isarray(numpy.array([1, 2, 3])))
     self.assertTrue(numeric.isarray(types.frozenarray([1, 2, 3])))
     self.assertTrue(numeric.isarray(numpy.array(1)))