示例#1
0
    def test_constructor_1d(self):
        nodes = np.array([1., 2., 3., 4., 5.])
        mesh = Mesh(nodes)
        self.assertMatrixEqual([1., 2., 3., 4., 5.],
                               mesh.positions([0, 1, 2, 3, 4]))

        mesh = Mesh([1., 2., 3., 4., 5.])
        self.assertMatrixEqual([1., 2., 3., 4., 5.],
                               mesh.positions([0, 1, 2, 3, 4]))
示例#2
0
 def test_contructor_3d(self):
     mesh = Mesh([[1, 2, 3], [4, 5, 6]])
     self.assertMatrixEqual([[1, 2, 3], [4, 5, 6]], mesh.positions([0, 1]))
     self.assertEqual(mesh.dimension(), 3)