diff --git a/pyNastran/dev/bdf_vectorized3/cards/elements/shell_utils.py b/pyNastran/dev/bdf_vectorized3/cards/elements/shell_utils.py index 227ab915e..1c437eb97 100644 --- a/pyNastran/dev/bdf_vectorized3/cards/elements/shell_utils.py +++ b/pyNastran/dev/bdf_vectorized3/cards/elements/shell_utils.py @@ -206,7 +206,9 @@ def tri_volume(grid: GRID, assert normal.shape == (nelements, 3) unit_normal = normal / norm[:, np.newaxis] - iequal = (dthickness.max(axis=0) == dthickness.min(axis=0)) + iequal = (dthickness.max(axis=1) == dthickness.min(axis=1)) + assert len(iequal) == nelements + inot_equal = ~iequal nequal = iequal.sum() nnot_equal = inot_equal.sum() @@ -264,7 +266,8 @@ def quad_volume(grid: GRID, assert normal.shape == (nelements, 3) unit_normal = normal / norm[:, np.newaxis] - iequal = (dthickness.max(axis=0) == dthickness.min(axis=0)) + iequal = (dthickness.max(axis=1) == dthickness.min(axis=1)) + assert len(iequal) == nelements inot_equal = ~iequal nequal = iequal.sum() nnot_equal = inot_equal.sum() @@ -288,8 +291,6 @@ def quad_volume(grid: GRID, return volume - - def shell_thickness(model: BDF, tflag: np.ndarray, T: np.ndarray, diff --git a/pyNastran/dev/bdf_vectorized3/cards/test/all_tests.py b/pyNastran/dev/bdf_vectorized3/cards/test/all_tests.py index 68bd341ed..e8a091a9a 100644 --- a/pyNastran/dev/bdf_vectorized3/cards/test/all_tests.py +++ b/pyNastran/dev/bdf_vectorized3/cards/test/all_tests.py @@ -19,10 +19,11 @@ from pyNastran.dev.bdf_vectorized3.cards.test.test_vector_rigid import * from pyNastran.dev.bdf_vectorized3.cards.test.test_vector_rods import * from pyNastran.dev.bdf_vectorized3.cards.test.test_vector_sets import * -from pyNastran.dev.bdf_vectorized3.cards.test.test_vector_shells import TestShells, TestAcoustic +from pyNastran.dev.bdf_vectorized3.cards.test.test_vector_shells import TestShells, TestAxisymmetricShells, TestAcoustic from pyNastran.dev.bdf_vectorized3.cards.test.test_vector_solids import * from pyNastran.dev.bdf_vectorized3.cards.test.test_vector_springs import * from pyNastran.dev.bdf_vectorized3.cards.test.test_vector_superelements import * +from pyNastran.dev.bdf_vectorized3.cards.test.test_vector_thermal import * if __name__ == '__main__': # pragma: no cover diff --git a/pyNastran/dev/bdf_vectorized3/cards/test/test_vector_shells.py b/pyNastran/dev/bdf_vectorized3/cards/test/test_vector_shells.py index 0e59db82e..4e0eea879 100644 --- a/pyNastran/dev/bdf_vectorized3/cards/test/test_vector_shells.py +++ b/pyNastran/dev/bdf_vectorized3/cards/test/test_vector_shells.py @@ -14,7 +14,7 @@ from pyNastran.dev.bdf_vectorized3.cards.test.utils import save_load_deck #from pyNastran.bdf.mesh_utils.mass_properties import ( #mass_properties, mass_properties_no_xref, mass_properties_nsm) - +from pyNastran.dev.bdf_vectorized3.cards.elements.shell_utils import tri_volume, quad_volume #try: #import matplotlib @@ -1751,6 +1751,54 @@ def test_pshln2(self): model.pshln2.write() save_load_deck(model) + def test_tri_volume(self): + log = get_logger(level='warning') + model = BDF(log=log) + rho = 0.0 + nu = 0.3 + E = 3.0e7 + G = None + t = 1.0 + nsm = 0.0 + self._make_ctria3(model, rho, nu, G, E, t, nsm) + model.setup() + + ctria3 = model.ctria3 + nodes = ctria3.nodes + nelements = len(ctria3) + area = ctria3.area() + average_thickness = 3.1 + expected_volume = area * average_thickness + + dthickness = np.ones((nelements, 3), dtype='float64') * average_thickness + vol = tri_volume(model.grid, nodes, dthickness) + assert np.allclose(vol, expected_volume), (vol, expected_volume) + + + def test_quad_volume(self): + log = get_logger(level='warning') + model = BDF(log=log) + rho = 0.0 + nu = 0.3 + E = 3.0e7 + G = None + t = 1.0 + nsm = 0.0 + self._make_cquad4(model, rho, nu, G, E, t, nsm) + model.setup() + + cquad4 = model.cquad4 + nodes = cquad4.nodes + nelements = len(cquad4) + area = cquad4.area() + average_thickness = 3.1 + expected_volume = area * average_thickness + + dthickness = np.ones((nelements, 4), dtype='float64') * average_thickness + vol = quad_volume(model.grid, nodes, dthickness) + assert np.allclose(vol, expected_volume), (vol, expected_volume) + + class TestAxisymmetricShells(unittest.TestCase): def test_cquadx4(self): """tests a CQUADX4"""