Пример #1
0
 def test_pssCalculateElementForces_horizontal(self):
     pssCalculateElementForces(self.structure)
     for element in self.structure.e:
         self.assertEqual(element.nx,
                          (self.spacing / self.original_length) *
                          self.stiffness)
         self.assertEqual(element.ny, 0.0)
Пример #2
0
    def test_pssCalculateElementForces_vertical(self):
        self.displacement = self.spacing * 2.0
        self.structure.n[1].y = self.displacement

        self.assertEqual(self.structure.n[1].x, self.spacing)
        self.assertEqual(self.structure.n[1].y, self.displacement)

        self.assertEqual(self.structure.e[0].dx, self.spacing)
        self.assertEqual(self.structure.e[0].dy, self.displacement)

        length = self.structure.e[0].length
        self.assertEqual(length, math.sqrt((self.displacement ** 2) + (self.spacing ** 2)))

        pssCalculateElementForces(self.structure)

        force = math.sqrt(self.structure.e[0].nx ** 2 + self.structure.e[0].ny ** 2)
        self.assertEqual(force, (length / self.original_length) * self.stiffness)
Пример #3
0
    def test_pssCalculateElementForces_vertical(self):
        self.displacement = self.spacing * 2.0
        self.structure.n[1].y = self.displacement

        self.assertEqual(self.structure.n[1].x, self.spacing)
        self.assertEqual(self.structure.n[1].y, self.displacement)

        self.assertEqual(self.structure.e[0].dx, self.spacing)
        self.assertEqual(self.structure.e[0].dy, self.displacement)

        length = self.structure.e[0].length
        self.assertEqual(length,
                         math.sqrt((self.displacement**2) + (self.spacing**2)))

        pssCalculateElementForces(self.structure)

        force = math.sqrt(self.structure.e[0].nx**2 +
                          self.structure.e[0].ny**2)
        self.assertEqual(force,
                         (length / self.original_length) * self.stiffness)
Пример #4
0
 def test_pssCalculateElementForces_horizontal(self):
     pssCalculateElementForces(self.structure)
     for element in self.structure.e:
         self.assertEqual(element.nx, (self.spacing / self.original_length) * self.stiffness)
         self.assertEqual(element.ny, 0.0)