def test_stressSolution1D1Elem(self): result, steps = solver(self.numD[0], self.load1, self.nodes1, self.ien1, self.ida1, self.ncons1, self.cons1) stress = get_stress_sol(result, self.ien1, self.nodes1, 'sigma_x') correct = [2.0e6, 2.0e6] for i in range(len(correct)): # for each node... self.assertAlmostEqual(correct[i], stress[i])
def test_stressSol3D1ElemZ(self): result, steps = solver(self.numD[2], self.load3, self.nodes3, self.ien3, self.ida3, self.ncons3, self.cons3) stress = get_stress_sol(result, self.ien3, self.nodes3, 'sigma_z') correct = 8 * [0.0] for i in range(len(correct)): # for each node... self.assertAlmostEqual(correct[i], stress[i], 3)
def test_stressSol3D1ElemVM(self): result, steps = solver(self.numD[2], self.loadVM, self.nodes3, self.ien3, self.ida3, self.ncons3, self.cons3) stress = get_stress_sol(result, self.ien3, self.nodes3, 'von Mises') correct = 8 * [1996.4] for i in range(len(correct)): # for each node... self.assertAlmostEqual(correct[i], stress[i], 1)