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)))
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)))
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)))
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)))
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)))
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)))
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))
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))
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)))