Skip to content

Commit

Permalink
adding skip_aero flag
Browse files Browse the repository at this point in the history
redoing grid overwriting
  • Loading branch information
Steve Doyle committed Nov 26, 2024
1 parent e127236 commit 763f6e2
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 11 deletions.
22 changes: 14 additions & 8 deletions pyNastran/bdf/bdf_interface/add_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand Down
3 changes: 2 additions & 1 deletion pyNastran/bdf/cards/bdf_sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions pyNastran/bdf/cards/elements/rigid.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 6 additions & 0 deletions pyNastran/bdf/test/test_bdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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']:
Expand Down Expand Up @@ -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'],
Expand Down Expand Up @@ -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'],
Expand Down

0 comments on commit 763f6e2

Please sign in to comment.