def test_add_maximum_shear(self, default): default.add_Cauchy('P', 'F') default.add_maximum_shear('sigma') loc = { 'sigma': default.get_dataset_location('sigma'), 'max_shear(sigma)': default.get_dataset_location('max_shear(sigma)') } in_memory = mechanics.maximum_shear( default.read_dataset(loc['sigma'], 0)).reshape(-1, 1) in_file = default.read_dataset(loc['max_shear(sigma)'], 0) assert np.allclose(in_memory, in_file)
def test_spherical_no_shear(self): """Ensure that sherical stress has max shear of 0.0.""" A = tensor.spherical(tensor.symmetric(np.random.rand(self.n, 3, 3)), True) assert np.allclose(mechanics.maximum_shear(A), 0.0)
def test_add_maximum_shear(self, default): default.add_stress_Cauchy('P', 'F') default.add_maximum_shear('sigma') in_memory = mechanics.maximum_shear(default.place('sigma')) in_file = default.place('max_shear(sigma)') assert np.allclose(in_memory, in_file)