Пример #1
0
    def test_bdf_01_hdf5(self):
        """checks solid_bending.dat"""
        bdf_filename = os.path.join(MODEL_PATH, 'solid_bending',
                                    'solid_bending.bdf')
        model = BDF(debug=False)
        cards = model._read_bdf_cards(bdf_filename,
                                      punch=False,
                                      read_includes=True,
                                      encoding=None)
        assert len(cards) == 9, len(cards)

        etype_to_eids_pids_nids = model.get_elements_properties_nodes_by_element_type(
        )
        assert len(etype_to_eids_pids_nids) == 1, list(
            etype_to_eids_pids_nids.keys())
        #etype_to_eids_pids_nids[etype] : [eids, pids, nids]
        unused_eids, pids, unused_node_ids = etype_to_eids_pids_nids['CTETRA4']
        assert pids.min() == 1, pids.min()
        assert pids.max() == 1, pids.max()

        out = model.get_elements_nodes_by_property_type(
            dtype='int32', save_element_types=False)
        etype_pid_to_eids_nids, _etype_to_eids_pids_nids = out
        #etype_pid_to_eids_nids[(etype, pid)] : [eids, nids]
        assert _etype_to_eids_pids_nids is None, _etype_to_eids_pids_nids
        assert len(etype_pid_to_eids_nids) == 1, list(
            etype_pid_to_eids_nids.keys())
Пример #2
0
 def test_bdf_01_hdf5(self):
     """checks solid_bending.dat"""
     bdf_filename = os.path.join(MODEL_PATH, 'solid_bending',
                                 'solid_bending.bdf')
     model = BDF(debug=False)
     cards = model._read_bdf_cards(bdf_filename,
                                   validate=True,
                                   xref=False,
                                   punch=False,
                                   read_includes=True,
                                   encoding=None)
     assert len(cards) == 9, len(cards)