예제 #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)))
예제 #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)))
예제 #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)))
예제 #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)))
예제 #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)))
예제 #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)))
예제 #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))
예제 #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))
예제 #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)))