From 7ddb396c3e9bde5fd96a4361d7fe81a695299b87 Mon Sep 17 00:00:00 2001 From: SteveDoyle2 Date: Tue, 2 Jan 2024 16:07:51 -0800 Subject: [PATCH] bdf_vectorized3: - more tests & fixig missed cards (PACBAR) --- pyNastran/dev/bdf_vectorized3/bdf.py | 3 - .../bdf_vectorized3/bdf_interface/add_card.py | 14 +-- .../bdf_interface/bdf_attributes.py | 4 +- .../bdf_interface/write_mesh.py | 2 +- .../dev/bdf_vectorized3/cards/base_card.py | 2 - pyNastran/dev/bdf_vectorized3/cards/coord.py | 10 +-- .../cards/elements/acoustic.py | 6 ++ .../bdf_vectorized3/cards/elements/bolt.py | 8 +- .../cards/elements/plate_stress_strain.py | 20 +++++ .../cards/elements/shell_quality.py | 7 +- .../bdf_vectorized3/cards/elements/utils.py | 10 +-- pyNastran/dev/bdf_vectorized3/cards/rotor.py | 1 + .../cards/test/test_vector_bolt.py | 14 ++- .../cards/test/test_vector_dynamic.py | 4 + .../cards/test/test_vector_materials.py | 8 +- .../cards/test/test_vector_shells.py | 86 ++++++++++++++++++- .../mesh_utils/bdf_equivalence.py | 2 + .../mesh_utils/remove_unused.py | 1 + 18 files changed, 164 insertions(+), 38 deletions(-) diff --git a/pyNastran/dev/bdf_vectorized3/bdf.py b/pyNastran/dev/bdf_vectorized3/bdf.py index 87c474904..0687cb0a2 100644 --- a/pyNastran/dev/bdf_vectorized3/bdf.py +++ b/pyNastran/dev/bdf_vectorized3/bdf.py @@ -2146,9 +2146,6 @@ def add_card(cls, card, comment=''): #'BCPARA' : (BCPARA, add_methods._add_bcpara_object), 'BCTPARM' : (BCTPARM, add_methods._add_bctparm_object), - # nx bolts - 'BOLTLD' : (RuntimeCrash, None), - #'CBEAR', 'PBEAR', 'ROTORB', #'CBEAR' : (Crash, None), #'PBEAR' : (Crash, None), diff --git a/pyNastran/dev/bdf_vectorized3/bdf_interface/add_card.py b/pyNastran/dev/bdf_vectorized3/bdf_interface/add_card.py index 370d947ac..1aa641925 100644 --- a/pyNastran/dev/bdf_vectorized3/bdf_interface/add_card.py +++ b/pyNastran/dev/bdf_vectorized3/bdf_interface/add_card.py @@ -5938,7 +5938,7 @@ def add_cplstn8(self, eid: int, pid: int, nids: list[int], theta: float=0.0, return elem def add_cplsts3(self, eid: int, pid: int, nids: list[int], theta: float=0.0, - tflag=0, T1=None, T2=None, T3=None, comment: str='') -> int: + tflag: int=0, T1=None, T2=None, T3=None, comment: str='') -> int: """Creates a CPLSTS3 card""" elem = self.cplsts3.add( eid, pid, nids, theta=theta, @@ -5946,7 +5946,7 @@ def add_cplsts3(self, eid: int, pid: int, nids: list[int], theta: float=0.0, return elem def add_cplsts4(self, eid: int, pid: int, nids: list[int], theta: float=0.0, - tflag=0, T1=None, T2=None, T3=None, T4=None, + tflag: int=0, T1=None, T2=None, T3=None, T4=None, comment: str='') -> int: """Creates a CPLSTS4 card""" elem = self.cplsts4.add( @@ -8109,9 +8109,9 @@ def add_dphase(self, dphase_id: int, node: int, component: int, phase_lead: floa dphase = self.dphase.add(dphase_id, node, component, phase_lead, comment=comment) return dphase - def add_rotorg(self, sid, nids, comment: str='') -> int: + def add_rotorg(self, rotor_id: int, nids: list[int], comment: str='') -> int: """Creates a ROTORG card""" - rotor = self.rotorg,add(sid, nids, comment=comment) + rotor = self.rotorg.add(rotor_id, nids, comment=comment) return rotor def add_rotord(self, sid, rstart, rstep, numstep, @@ -8457,7 +8457,8 @@ def add_paabsf(self, pid: int, s=s, a=a, b=b, k=k, rhoc=rhoc, comment=comment) return paabsf - def add_pacbar(self, pid, mback, mseptm, freson, kreson, comment: str='') -> PACBAR: + def add_pacbar(self, pid: int, mback: float, mseptm: float, + freson: float, kreson: float, comment: str='') -> int: """ Creates a PACBAR card @@ -8475,8 +8476,7 @@ def add_pacbar(self, pid, mback, mseptm, freson, kreson, comment: str='') -> PAC Resonant stiffness of the sandwich construction. """ - pacbar = PACBAR(pid, mback, mseptm, freson, kreson, comment=comment) - self._add_methods._add_acoustic_property_object(pacbar) + pacbar = self.pacbar.add(pid, mback, mseptm, freson, kreson, comment=comment) return pacbar def add_pacabs(self, pid, cutfr, b, k, m, diff --git a/pyNastran/dev/bdf_vectorized3/bdf_interface/bdf_attributes.py b/pyNastran/dev/bdf_vectorized3/bdf_interface/bdf_attributes.py index d57528a1f..92dfc9ca4 100644 --- a/pyNastran/dev/bdf_vectorized3/bdf_interface/bdf_attributes.py +++ b/pyNastran/dev/bdf_vectorized3/bdf_interface/bdf_attributes.py @@ -869,7 +869,9 @@ def solid_property_cards(self) -> list[Any]: @property def property_cards(self) -> list[Any]: - acoustic_property_cards = [self.paabsf] + acoustic_property_cards = [ + self.paabsf, self.pacbar, + ] zero_d_properties = [ self.pelas, self.pelast, self.pdamp, self.pdampt, diff --git a/pyNastran/dev/bdf_vectorized3/bdf_interface/write_mesh.py b/pyNastran/dev/bdf_vectorized3/bdf_interface/write_mesh.py index b12467462..b2e5c0e60 100644 --- a/pyNastran/dev/bdf_vectorized3/bdf_interface/write_mesh.py +++ b/pyNastran/dev/bdf_vectorized3/bdf_interface/write_mesh.py @@ -464,7 +464,6 @@ def _write_elements(self, bdf_file: TextIOLike, # acoustic shells model.caabsf.write_file(bdf_file, size=size, is_double=is_double) - model.paabsf.write_file(bdf_file, size=size, is_double=is_double) # acoustic solids model.chacab.write_file(bdf_file, size=size, is_double=is_double) @@ -647,6 +646,7 @@ def _write_properties(self, bdf_file: TextIOLike, # acoustic model.pacbar.write_file(bdf_file, size=size, is_double=is_double) + model.paabsf.write_file(bdf_file, size=size, is_double=is_double) def _write_materials(self, bdf_file: TextIOLike, size: int=8, is_double: bool=False, is_long_ids: Optional[bool]=None) -> None: diff --git a/pyNastran/dev/bdf_vectorized3/cards/base_card.py b/pyNastran/dev/bdf_vectorized3/cards/base_card.py index 3cc38033f..5d06f64bb 100644 --- a/pyNastran/dev/bdf_vectorized3/cards/base_card.py +++ b/pyNastran/dev/bdf_vectorized3/cards/base_card.py @@ -96,8 +96,6 @@ def searchsorted_filter(all_ids: np.ndarray, expected2 = lookup_ids[i_lookup2] actual2 = all_ids[i_all2] assert np.array_equal(expected2, actual2) - #if debug: - #x = 2 return i_lookup2, i_all2 diff --git a/pyNastran/dev/bdf_vectorized3/cards/coord.py b/pyNastran/dev/bdf_vectorized3/cards/coord.py index ad71c1fcd..1e0ee8cde 100644 --- a/pyNastran/dev/bdf_vectorized3/cards/coord.py +++ b/pyNastran/dev/bdf_vectorized3/cards/coord.py @@ -701,7 +701,7 @@ def setup(self): assert len(np.unique(self.coord_id)) == len(self.coord_id) debug = False - if debug: + if debug: # pragma: no cover print(f'nresolved = {nresolved}') while nresolved < ncoords: i1 = np.where(self.icoord == 1)[0] @@ -719,7 +719,7 @@ def setup(self): if len(coords_to_resolve) == 0: raise RuntimeError(f'cannot resolve any coordinate systems...unresolved_cids={unresolved_cids}') - if debug: + if debug: # pragma: no cover print('-----------------------') n_to_resolve = len(coord1_cids_to_resolve) + len(coord2_cids_to_resolve) log.debug(f'n={n_to_resolve} resolve this cycle: coord1={np.array(coord1_cids_to_resolve)}; ' @@ -728,7 +728,7 @@ def setup(self): nresolved, cord1s_resolved = self._resolve_cord1( coord1_cids_to_resolve, nresolved, resolved, grid, unresolved_cids) - if debug: + if debug: # pragma: no cover if nresolved > nresolved1: log.debug(f'n={len(coord1_cids_to_resolve)}; resolved CORD1x={cord1s_resolved} -> {coord1_cids_to_resolve}') log.debug(f'n={len(unresolved_cids)}; unresolved_cids = {unresolved_cids}') @@ -738,7 +738,7 @@ def setup(self): coord2_cids_to_resolve, resolved, nresolved, unresolved_cids, rid_to_i_icoord_coordtype) - if debug: + if debug: # pragma: no cover if nresolved > nresolved2: log.debug(f'n={len(coord2_cids_to_resolve)}; resolved CORD2x={cord2s_resolved} -> {coord2_cids_to_resolve}') if unresolved_cids: @@ -747,7 +747,7 @@ def setup(self): if 0 in resolved: # just limiting log messages resolved.remove(0) - if debug and resolved: + if debug and resolved: # pragma: no cover log.info(f'n={len(resolved)}; resolved={np.array(list(resolved))}') if unresolved_cids: #print(f'unresolved_cids = {unresolved_cids}\n{self.write()}') diff --git a/pyNastran/dev/bdf_vectorized3/cards/elements/acoustic.py b/pyNastran/dev/bdf_vectorized3/cards/elements/acoustic.py index 6c48a7b38..75a38cb98 100644 --- a/pyNastran/dev/bdf_vectorized3/cards/elements/acoustic.py +++ b/pyNastran/dev/bdf_vectorized3/cards/elements/acoustic.py @@ -93,6 +93,12 @@ def midside_nodes(self) -> np.ndarray: assert midside_nodes.shape[1] == 12, midside_nodes.shape return midside_nodes + @property + def allowed_properties(self) -> list[Any]: + model = self.model + allowed_properties = [model.pacbar] + return [prop for prop in allowed_properties if prop.n > 0] + @property def max_id(self) -> int: return max(self.element_id.max(), self.property_id.max(), self.nodes.max()) diff --git a/pyNastran/dev/bdf_vectorized3/cards/elements/bolt.py b/pyNastran/dev/bdf_vectorized3/cards/elements/bolt.py index 0386be96b..3d439cc96 100644 --- a/pyNastran/dev/bdf_vectorized3/cards/elements/bolt.py +++ b/pyNastran/dev/bdf_vectorized3/cards/elements/bolt.py @@ -98,15 +98,15 @@ def add(self, bolt_id: int, scale: float, """ return super().add( - sid, scale, scale_factors, bolt_ids, comment=comment) + bolt_id, scale, scale_factors, bolt_ids, comment=comment) def set_used(self, used_dict: dict[str, np.ndarray]) -> None: - used_dict['load_id'].append(self.load_ids) + used_dict['bolt_id'].append(self.bolt_ids) def remove_unused(self, used_dict: dict[str, np.ndarray]) -> int: - load_id = used_dict['load_id'] + load_id = used_dict['bolt_id'] ncards_removed = remove_unused_primary( - self, load_id, self.load_id, 'load_id') + self, load_id, self.bolt_id, 'bolt_id') return ncards_removed diff --git a/pyNastran/dev/bdf_vectorized3/cards/elements/plate_stress_strain.py b/pyNastran/dev/bdf_vectorized3/cards/elements/plate_stress_strain.py index 3a3394800..7b0428910 100644 --- a/pyNastran/dev/bdf_vectorized3/cards/elements/plate_stress_strain.py +++ b/pyNastran/dev/bdf_vectorized3/cards/elements/plate_stress_strain.py @@ -155,6 +155,16 @@ def clear(self) -> None: self.T = np.zeros((0, 3), dtype='float64') self.theta = np.array([], dtype='float64') + def add(self, eid: int, pid: int, nids: list[int], theta: float=0.0, + tflag: int=0, T1=None, T2=None, T3=None, + comment: str='') -> int: + """Creates a CPLSTS3 card""" + self.cards.append((eid, pid, nids, theta, + tflag, [T1, T2, T3], + comment)) + self.n += 1 + return self.n - 1 + def add_card(self, card: BDFCard, comment: str='') -> int: """ Adds a CPLSTS3 card from ``BDF.add_card(...)`` @@ -304,6 +314,16 @@ def clear(self) -> None: self.T = np.zeros((0, 4), dtype='float64') self.theta = np.array([], dtype='float64') + def add(self, eid: int, pid: int, nids: list[int], theta: float=0.0, + tflag: int=0, T1=None, T2=None, T3=None, T4=None, + comment: str='') -> int: + """Creates a CPLSTS4 card""" + self.cards.append((eid, pid, nids, theta, + tflag, [T1, T2, T3, T4], + comment)) + self.n += 1 + return self.n - 1 + def add_card(self, card: BDFCard, comment: str='') -> int: """ Adds a CPLSTS4 card from ``BDF.add_card(...)`` diff --git a/pyNastran/dev/bdf_vectorized3/cards/elements/shell_quality.py b/pyNastran/dev/bdf_vectorized3/cards/elements/shell_quality.py index 12233cbf4..0a4286fba 100644 --- a/pyNastran/dev/bdf_vectorized3/cards/elements/shell_quality.py +++ b/pyNastran/dev/bdf_vectorized3/cards/elements/shell_quality.py @@ -317,7 +317,7 @@ def quad_quality_xyz(p1: np.ndarray, p2: np.ndarray, assert min_area_min == 0., min_area area_ratioi1 = np.full(nelement, np.nan, dtype=area.dtype) iarea = np.where(min_area != 0.)[0] - area_ratioi1[area] = area[area] / min_area[iarea] + area_ratioi1[iarea] = area[iarea] / min_area[iarea] is_nan_area_ratio = True warnings.warn(f'invalid area_ratio for a quad/hexa/penta because min_area=0') @@ -336,7 +336,10 @@ def quad_quality_xyz(p1: np.ndarray, p2: np.ndarray, area_ratio = area_ratios.max(axis=0) if is_nan_area_ratio: inan = np.isnan(area_ratio) - area_ratio[inan] = area_ratio[~inan].max() * 2 + inot_nan = ~inan + not_nan_area = area_ratio[inot_nan] + if inot_nan.sum() > 0: + area_ratio[inan] = not_nan_area.max() * 2 assert area_ratio.shape == (nelement, ) del area_ratios diff --git a/pyNastran/dev/bdf_vectorized3/cards/elements/utils.py b/pyNastran/dev/bdf_vectorized3/cards/elements/utils.py index d641f45c5..207031800 100644 --- a/pyNastran/dev/bdf_vectorized3/cards/elements/utils.py +++ b/pyNastran/dev/bdf_vectorized3/cards/elements/utils.py @@ -27,11 +27,11 @@ def get_density_from_material(material_id: np.ndarray, material_id_check = np.zeros(nmaterials, dtype='int32') rho = np.full(nmaterials, np.nan, dtype='float64') - if debug: + if debug: # pragma: no cover print(f'material_id = {material_id}') for mat in allowed_materials: mat_material_ids = mat.material_id - if debug: + if debug: # pragma: no cover print('mat.material_id = ', mat.material_id) print('mat.rho = ', mat.rho) #print('i_lookup = ', i_lookup) @@ -39,17 +39,17 @@ def get_density_from_material(material_id: np.ndarray, i_lookup, i_all = searchsorted_filter(mat_material_ids, material_id) if len(i_all) == 0: continue - if debug: + if debug: # pragma: no cover print('i_lookup = ', i_lookup) print('i_all = ', i_all) material_id_check[i_lookup] = mat_material_ids[i_all] - if debug: + if debug: # pragma: no cover print('material_id_check = ', material_id_check) print('mat_material_ids = ', mat_material_ids) rho[i_lookup] = mat.rho[i_all] - #if debug: + #if debug: # pragma: no cover #print('material_id_check = ', material_id_check) #print('mat_material_ids = ', mat_material_ids) #x = 1 diff --git a/pyNastran/dev/bdf_vectorized3/cards/rotor.py b/pyNastran/dev/bdf_vectorized3/cards/rotor.py index 15ef4c967..0cb109c94 100644 --- a/pyNastran/dev/bdf_vectorized3/cards/rotor.py +++ b/pyNastran/dev/bdf_vectorized3/cards/rotor.py @@ -52,6 +52,7 @@ def clear(self) -> None: self.node_id = np.array([], dtype='int32') def add(self, rotor_id: int, nids: list[int], comment: str='') -> int: + """Creates a ROTORG card""" nids = expand_thru(nids, set_fields=True, sort_fields=False) nnodes = len(nids) self.cards.append((rotor_id, nids, comment)) diff --git a/pyNastran/dev/bdf_vectorized3/cards/test/test_vector_bolt.py b/pyNastran/dev/bdf_vectorized3/cards/test/test_vector_bolt.py index 869c40e5b..4a7206239 100644 --- a/pyNastran/dev/bdf_vectorized3/cards/test/test_vector_bolt.py +++ b/pyNastran/dev/bdf_vectorized3/cards/test/test_vector_bolt.py @@ -25,13 +25,15 @@ def test_bolt_nx_1(self): model.subcases boltseq = model.boltseq boltfor = model.boltfor + boltld = model.boltld bolt = model.bolt bolt_id = 1 element_type = 1 eids = [11, 12, 13, 14, 15, 16] - bolt = model.add_bolt_nx(bolt_id, element_type, eids=eids, csid=None, idir=None) - str(bolt) + model.add_bolt_nx(bolt_id, element_type, eids=eids, csid=None, idir=None) + str(bolt.write()) + str(boltld.write()) RUN_BOLT = False nids = [101, 102, 103, 104, 105, 106] @@ -48,6 +50,12 @@ def test_bolt_nx_1(self): bolt = model.add_bolt_nx(bolt_id, element_type, eids=eids, csid=None, idir=None) str(bolt) + scale = 2.0 + scale_factors = [3.] + bolt_id = 10 + bolt_ids = [1.] + model.boltld.add(bolt_id, scale, scale_factors, bolt_ids, comment='') + #SID Bolt preload set identification number (Integer; No default) #S_NOi Sequence order number for the BOLTLD, BOLTFOR, and BOLTFRC IDs to be applied. (Integer; No default) #B_IDi SID of BOLTLD, BOLTFOR, or BOLTFRC bulk entries defining a boltpreload. (Integer; No default) @@ -83,7 +91,7 @@ def test_bolt_nx_1(self): G = None nu = 0.3 model.add_mat1(mid, E, G, nu) - model2 = save_load_deck(model, xref='standard', punch=True, run_remove_unused=True, run_convert=True, run_renumber=False, + model2 = save_load_deck(model, xref='standard', punch=True, run_remove_unused=False, run_convert=True, run_renumber=False, run_mirror=True, run_save_load=True, run_quality=True, write_saves=True, run_save_load_hdf5=True, run_mass_properties=True, run_loads=True, run_test_bdf=True, run_op2_writer=True, run_op2_reader=True, remove_disabled_cards=True, nastran_format='nx', op2_log_level='warning') diff --git a/pyNastran/dev/bdf_vectorized3/cards/test/test_vector_dynamic.py b/pyNastran/dev/bdf_vectorized3/cards/test/test_vector_dynamic.py index 58ccbac1b..1e36a75cb 100644 --- a/pyNastran/dev/bdf_vectorized3/cards/test/test_vector_dynamic.py +++ b/pyNastran/dev/bdf_vectorized3/cards/test/test_vector_dynamic.py @@ -572,9 +572,13 @@ def test_rotorg(self): model = BDF(debug=False) rotorg = model.rotorg card_lines = ['ROTORG', '10', '1', '2'] + model.add_card(card_lines, 'ROTORG', comment='rotorg') card_lines = ['ROTORG', '10', '10', ' THRU', '20'] model.add_card(card_lines, 'ROTORG', comment='rotorg') + nids = [10, 'thru', 15] + model.add_rotorg(11, nids, comment='') + model.add_grid(1, [1., 0., 0.]) model.add_grid(2, [2., 0., 0.]) for nid in range(10, 21): diff --git a/pyNastran/dev/bdf_vectorized3/cards/test/test_vector_materials.py b/pyNastran/dev/bdf_vectorized3/cards/test/test_vector_materials.py index 0df8df5e5..b47075256 100644 --- a/pyNastran/dev/bdf_vectorized3/cards/test/test_vector_materials.py +++ b/pyNastran/dev/bdf_vectorized3/cards/test/test_vector_materials.py @@ -834,8 +834,8 @@ def test_mat10c(self): mid = 10 model.add_mat10c(mid, form='REAL', rho_real=0.0, rho_imag=0.0, c_real=0.0, c_imag=0.0, comment='') model.setup() - print(model.mat10c.write()) - save_load_deck(model) + model.mat10c.write() + save_load_deck(model, run_remove_unused=False) def test_matort(self): log = get_logger(level='warning') @@ -853,10 +853,10 @@ def test_matort(self): model.add_matort(mid, E1, E2, E3, nu12, nu23, nu31, G12, G23, G31, rho=0.0, alpha1=0.0, alpha2=0.0, alpha3=0.0, tref=0.0, ge=0.0, comment='') model.setup() - print(model.mathort.write()) + print(model.matort.write()) save_load_deck(model) - def test_matort(self): + def test_mathp(self): log = get_logger(level='warning') model = BDF(log=log) mid = 10 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 9ed36454e..e0ec0896a 100644 --- a/pyNastran/dev/bdf_vectorized3/cards/test/test_vector_shells.py +++ b/pyNastran/dev/bdf_vectorized3/cards/test/test_vector_shells.py @@ -25,7 +25,43 @@ class TestAcoustic(unittest.TestCase): - def test_caabsf(self): + def test_chacbr_pacbar(self): + log = get_logger(level='warning') + model = BDF(log=log) + chacbr = model.chacbr + pacbar = model.pacbar + + eid = 2 + pid = 10 + nodes = [1, 2, 3, 4, 5, 6, 7, 8] + idi = model.add_chacbr(eid, pid, nodes, comment='caabsf') # solid + + mback = 1.0 + mseptm = 2. + freson = 3. + kreson = 4. + model.add_pacbar(pid, mback, mseptm, freson, kreson, comment='') + model.add_grid(1, [0., 0., 0.]) + model.add_grid(2, [1., 0., 0.]) + model.add_grid(3, [1., 1., 0.]) + model.add_grid(4, [0., 1., 0.]) + + model.add_grid(5, [0., 0., 0.]) + model.add_grid(6, [1., 0., 0.]) + model.add_grid(7, [1., 1., 0.]) + model.add_grid(8, [0., 1., 0.]) + #model.add_paabsf(pid, table_reactance_real=None, table_reactance_imag=None, + #s=1.0, a=1.0, b=0.0, k=0.0, rhoc=1.0, comment='') + model.setup() + + assert len(chacbr.write(size=8)) > 0 + assert len(chacbr.write(size=16)) > 0 + assert len(pacbar.write(size=8)) > 0 + assert len(pacbar.write(size=16)) > 0 + + save_load_deck(model, run_mass_properties=False, run_equivalence=False) + + def test_caabsf_paabsf(self): log = get_logger(level='warning') model = BDF(log=log) caabsf = model.caabsf @@ -1751,6 +1787,54 @@ def test_pshln2(self): model.pshln2.write() save_load_deck(model) + def test_cplsts3(self): + model = BDF(debug=False) + cplsts3 = model.cplsts3 + cplsts4 = model.cplsts4 + model.add_grid(1, [0., 0., 0.]) + model.add_grid(2, [1., 0., 0.]) + model.add_grid(3, [1., 1., 0.]) + model.add_grid(4, [0., 1., 0.]) + expected_tri_area = 0.5 + expected_quad_area = 1.0 + + eid = 10 + pid = 11 + mid = 12 + nids = [1, 2, 3] + model.add_cplsts3(eid, pid, nids, theta=0.0, comment='') + + eid += 1 + nids = [1, 2, 3, 4] + model.add_cplsts4(eid, pid, nids, theta=0.0, comment='') + + t = 0.31 + rho = 0.13 + model.add_pplane(pid, mid, t=t, nsm=0.0, formulation_option=0, comment='') + E = 3.0e7 + G = None + nu = 0.3 + model.add_mat1(mid, E, G, nu, rho=rho) + model.setup() + assert len(cplsts3) == 1, cplsts3 + assert len(cplsts4) == 1, cplsts4 + + expected_tri_mass = t * expected_tri_area * rho + expected_quad_mass = t * expected_quad_area * rho + + areai = cplsts3.area() + massi = cplsts3.mass() + assert np.allclose(areai, expected_tri_area), (areai, expected_tri_area) + assert np.allclose(massi, expected_tri_mass), (massi, expected_tri_mass) + + areai = cplsts4.area() + massi = cplsts4.mass() + assert np.allclose(areai, expected_quad_area), (areai, expected_quad_area) + assert np.allclose(massi, expected_quad_mass), (massi, expected_quad_mass) + + save_load_deck(model, run_remove_unused=False, run_mass_properties=False) + x = 1 + def test_tri_volume(self): log = get_logger(level='warning') model = BDF(log=log) diff --git a/pyNastran/dev/bdf_vectorized3/mesh_utils/bdf_equivalence.py b/pyNastran/dev/bdf_vectorized3/mesh_utils/bdf_equivalence.py index 5f2eb9a21..8d6356ca0 100644 --- a/pyNastran/dev/bdf_vectorized3/mesh_utils/bdf_equivalence.py +++ b/pyNastran/dev/bdf_vectorized3/mesh_utils/bdf_equivalence.py @@ -365,6 +365,8 @@ def update_cards(model: BDF, # contact 'BSURF', 'BSURFS', 'BCPROP', 'BCPROPS', 'BCTSET', 'BGADD', 'BCTADD', 'BFRIC', 'BCONP', + # bolt + 'BOLTLD', } skip_cards = { 'GRID', 'SPOINT', 'EPOINT', diff --git a/pyNastran/dev/bdf_vectorized3/mesh_utils/remove_unused.py b/pyNastran/dev/bdf_vectorized3/mesh_utils/remove_unused.py index 2644574e6..76c221043 100644 --- a/pyNastran/dev/bdf_vectorized3/mesh_utils/remove_unused.py +++ b/pyNastran/dev/bdf_vectorized3/mesh_utils/remove_unused.py @@ -44,6 +44,7 @@ def remove_unused(model: BDF, inplace: bool=False) -> BDF: 'glue_id': [], # BGADD -> BGSET 'contact_id': [], # BGSET/BCTSET -> BSURF/BSURFS 'bfric_id': [], # BCONP -> BFRIC + 'bolt_id': [], } #for card in model._cards_to_setup: #print(card)