diff --git a/pyNastran/bdf/bdf_interface/add_methods.py b/pyNastran/bdf/bdf_interface/add_methods.py index 979abdede..c827ec97c 100644 --- a/pyNastran/bdf/bdf_interface/add_methods.py +++ b/pyNastran/bdf/bdf_interface/add_methods.py @@ -246,16 +246,22 @@ def _add_node_object(self, node: GRID, allow_overwrites: bool=False) -> None: """adds a GRID card""" key = node.nid model = self.model - if key in model.nodes and not allow_overwrites: - if not node == model.nodes[key]: - assert node.nid not in model.nodes, 'nid=%s\nold_node=\n%snew_node=\n%s' % (node.nid, model.nodes[key], node) - else: - #print('GRID was duplicated...nid=%s; node=\n%s' % (key, node)) - pass - else: - assert key > 0, 'nid=%s node=%s' % (key, node) + #allow_overwrites = True + + assert key > 0, 'nid=%s node=%s' % (key, node) + if key not in model.nodes: model.nodes[key] = node model._type_to_id_map[node.type].append(key) + elif node == model.nodes[key]: + pass + elif allow_overwrites: + model.log.warning(f'replacing node:\n{model.nodes[key]}with:\n{node}') + model.nodes[key] = node + + # already handled + #model._type_to_id_map[node.type].append(key) + else: + raise RuntimeError('nid=%s\nold_node=\n%snew_node=\n%s' % (node.nid, model.nodes[key], node)) def _add_gridb_object(self, node: GRIDB, allow_overwrites: bool=False) -> None: """adds a GRIDB card""" diff --git a/pyNastran/bdf/cards/bdf_sets.py b/pyNastran/bdf/cards/bdf_sets.py index 991a4e6b7..7c3714b18 100644 --- a/pyNastran/bdf/cards/bdf_sets.py +++ b/pyNastran/bdf/cards/bdf_sets.py @@ -1133,7 +1133,8 @@ def cross_reference_set(self, model, xref_type, msg='', allow_empty_nodes=False) raise NotImplementedError("xref_type=%r and must be ['Node', 'Point']" % xref_type) self.xref_type = xref_type - def safe_cross_reference(self, model: BDF, xref_type, msg='', allow_empty_nodes=False): + def safe_cross_reference(self, model: BDF, xref_type, msg='', + allow_empty_nodes=False): """ Cross links the card so referenced cards can be extracted directly diff --git a/pyNastran/bdf/cards/elements/rigid.py b/pyNastran/bdf/cards/elements/rigid.py index 9178534dc..6102e7f59 100644 --- a/pyNastran/bdf/cards/elements/rigid.py +++ b/pyNastran/bdf/cards/elements/rigid.py @@ -1572,8 +1572,8 @@ def safe_cross_reference(self, model: BDF, debug: bool=True) -> int: self.Gijs_ref = [] for Gij in self.Gijs: nodes, msgi = model.safe_empty_nodes(Gij, msg=msg) - if msgi: - model.log.warning(msgi) + #if msgi: + #model.log.warning(msgi) self.Gijs_ref.append(nodes) def uncross_reference(self) -> None: diff --git a/pyNastran/bdf/test/test_bdf.py b/pyNastran/bdf/test/test_bdf.py index 22f1bb1a1..ab36ede2c 100644 --- a/pyNastran/bdf/test/test_bdf.py +++ b/pyNastran/bdf/test/test_bdf.py @@ -2130,6 +2130,8 @@ def test_bdf_argparse(argv=None): help='skip loads calcuations (default=False)') parent_parser.add_argument('--skip_mass', action='store_true', help='skip mass calcuations (default=False)') + parent_parser.add_argument('--skip_aero', action='store_true', + help='skip the processing of the caero mesh (default=False)') parent_parser.add_argument('--lax', action='store_true', help='use the lax card parser (default=False)') parent_parser.add_argument('-q', '--quiet', action='store_true', @@ -2290,6 +2292,7 @@ def get_test_bdf_usage_args_examples(encoding): ' --mystran Assume Mystran\n' ' --skip_loads skip the loads summation calculations (default=False)\n' ' --skip_mass skip the mass properties calculations (default=False)\n' + ' --skip_aero skip the processing of the caero mesh (default=False)\n' '\n' 'Info:\n' ' -h, --help show this help message and exit\n' @@ -2320,6 +2323,7 @@ def main(argv=None): #data['run_nominal'] = not data['skip_nominal'] data['run_loads'] = not data['skip_loads'] data['run_mass'] = not data['skip_mass'] + data['run_export_caero'] = not data['skip_aero'] is_double = False if data['double']: @@ -2358,6 +2362,7 @@ def main(argv=None): #run_nominal=data['run_nominal'], #run_loads=data['run_loads'], run_mass=data['run_mass'], + run_export_caero=data['run_export_caero'], run_extract_bodies=False, is_lax_parser=data['lax'], @@ -2408,6 +2413,7 @@ def main(argv=None): is_double=is_double, sum_load=data['run_loads'], run_mass=data['run_mass'], + run_export_caero=data['run_export_caero'], run_extract_bodies=False, is_lax_parser=data['lax'],