def test_dofset_reset(self): dof = DofSet() self.assertTrue(dof.count() == 0) dof.reset(True) self.assertTrue(dof.count() == 6) dof.reset() self.assertTrue(dof.count() == 0)
def test_dofset_inplace(self): dof1 = DofSet(Dx=True, Dy=True, Dz=True) dof2 = DofSet(Dx=True, Dy=True, Dz=True, Rx=True, Ry=True, Rz=True) dof1 &= dof2 self.assertTrue(dof1.count() == 3) self.assertTrue(dof1.is3DSolid()) self.assertTrue(not dof1.is3DShell()) self.assertTrue(dof1.elementDimension() == 3) dof1 = DofSet(Dx=True, Dy=True, Dz=True) dof2 = DofSet(Dx=True, Dy=True, Dz=True, Rx=True, Ry=True, Rz=True) dof1 |= dof2 self.assertTrue(dof1.count() == 6) self.assertTrue(not dof1.is3DSolid()) self.assertTrue(dof1.is3DShell()) self.assertTrue(dof1.elementDimension() == 3)
def test_dofset_2d(self): dof1 = DofSet(Dx=True, Dy=True, Dz=False) self.assertTrue(dof1.count() == 2) self.assertTrue(not dof1.is3DSolid()) self.assertTrue(not dof1.is3DShell()) self.assertTrue(dof1.elementDimension() == 2) dof2 = DofSet(Dx=True, Dy=True, Dz=True, Rx=True, Ry=True, Rz=True) dofa = dof1 & dof2 self.assertTrue(dofa.count() == 2) self.assertTrue(not dofa.is3DSolid()) self.assertTrue(not dofa.is3DShell()) self.assertTrue(dofa.elementDimension() == 2) dofo = dof1 | dof2 self.assertTrue(dofo.count() == 6) self.assertTrue(not dofo.is3DSolid()) self.assertTrue(dofo.is3DShell()) self.assertTrue(dofo.elementDimension() == 3)
def __init__(self, n1, n2, material=None, properties=None): BaseBeam.__init__(self) self.nodeCount = 2 self.name = 'Structural 3D Truss' self.dofSet = DofSet(Dx=True, Dy=True, Dz=True) self.nodes = (n1, n2) self.material = material self.loads = List() if properties is None: properties = Properties() self.properties = properties
def test_dofset_dofPos(self): dof = DofSet(Dx=True, Dy=True, Dz=True) self.assertTrue(dof.dofPos(3) == 2) dof = DofSet(Dx=False, Dy=False, Dz=False, Rx=True, Ry=True, Rz=True) self.assertTrue(dof.dofPos(3) == 5)