コード例 #1
0
 def setUp(self):
     self.pts = [[0.,0.,0.],
                 [1.,0.,0.],
                 [0.,1.,0.],
                 [0.,0.,1]]
     self.tet = linear_tet(1, self.pts, range(4))
     self.vtk = create_vtk([-1.,0,1])
     self.vtk2 = create_vtk([-1,0,1],[5]*27)
     self.vtk3 = create_vtk([0,1,2],[0, 5, 10]*9)
コード例 #2
0
def create_linear_tet_part():
    p = part('Part1','C3D4','linear_tet')
    pts = [[-1., 1., -1.],
           [-1., -1., 1.],
           [1., -1., -1.],
           [1., 1. , 1.]]
    nodes = [repr(n+1) for n in range(4)]
    p.add_element(linear_tet(1, pts, nodes))
    p.moduli = [1.]
    return [p]
コード例 #3
0
 def test_element_is_stored_in_part(self):
     self.part[0].add_element(linear_tet(1, self.pts, self.nodes))
     self.assertEqual(len(self.part[0].elements), 2,
                      "Elements not stored correctly in part: should have 2 elements, but has: " + repr(len(self.part[0].elements)))