MCPcopy Create free account
hub / github.com/PyMesh/PyMesh / test_isotropic_material_2D

Method test_isotropic_material_2D

python/pymesh/tests/test_material.py:50–65  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

48 self.assertAlmostEqual(0.0, stress[2, 1])
49
50 def test_isotropic_material_2D(self):
51 young = 1000.0
52 poisson = 0.3
53 mat = Material.create_isotropic(2, 1.0, young, poisson)
54 self.assertEqual(2, mat.dim)
55 self.assertEqual(1.0, mat.density)
56 self.assert_symmetry(mat.material_tensor, mat.dim)
57
58 strain = np.array([ [1.0, 0.0], [0.0, 0.0] ])
59 stress = mat.strain_to_stress(strain)
60 self.assertAlmostEqual(strain[0,0],
61 stress[0,0]/young - poisson*stress[1,1]/young )
62 self.assertAlmostEqual(strain[1,1],
63 stress[1,1]/young - poisson*stress[0,0]/young )
64 self.assertAlmostEqual(strain[0, 1],
65 stress[0,1] * (1+poisson) / young)
66
67 def test_equivalence(self):
68 young = 1000.0

Callers

nothing calls this directly

Calls 3

assert_symmetryMethod · 0.95
create_isotropicMethod · 0.45
strain_to_stressMethod · 0.45

Tested by

no test coverage detected