Skip to content

Commit 25eb2c1

Browse files
committed
cleanup
1 parent e468c08 commit 25eb2c1

File tree

3 files changed

+6
-10
lines changed

3 files changed

+6
-10
lines changed

pyNastran/bdf/bdf_interface/add_card.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3807,7 +3807,7 @@ def add_mathp(self, mid: int,
38073807
return mat
38083808

38093809
def add_mats1(self, mid: int, nl_type: str,
3810-
h, hr, yf, limit1, limit2, strmeas: str | None = None,
3810+
h, hr, yf, limit1, limit2, strmeas: str | None=None,
38113811
tid: int=0, comment: str='') -> MATS1:
38123812
"""Creates a MATS1 card"""
38133813
mat = MATS1(mid, nl_type, h, hr, yf, limit1, limit2, strmeas,
@@ -7197,11 +7197,10 @@ def add_pplane(self, pid: int, mid: int, t: float=0.0, nsm: float=0.0,
71977197
return prop
71987198

71997199
def add_pgplsn(self, pid: int, mid: int, cgid: int, t: float,
7200-
kn: float | int = 0., kr1: float | int = 0., kr2: float | int = 0.,
7200+
kn: float | int=0., kr1: float | int=0., kr2: float | int=0.,
72017201
comment: str='') -> PGPLSN:
72027202
"""Creates a PGPLSN card"""
72037203
prop = PGPLSN(pid, mid, cgid=cgid, t=t, kn=kn, kr1=kr1, kr2=kr2, comment=comment)
7204-
72057204
self._add_methods.add_property_object(prop)
72067205
return prop
72077206

pyNastran/bdf/cards/material_deps.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class MATS1(MaterialDependence):
102102
def __init__(self, mid: int, nl_type: Optional[str],
103103
h: float, hr: float, yf: float,
104104
limit1: Optional[float], limit2: Optional[float],
105-
strmeas: Optional[str] = None,
105+
strmeas: Optional[str]=None,
106106
tid: int=0, comment: str=''):
107107
MaterialDependence.__init__(self)
108108
if comment:
@@ -215,10 +215,7 @@ def add_card(cls, card: BDFCard, comment: str=''):
215215
#limit2 = blank(card, 8, 'limit2')
216216
limit2 = None
217217

218-
if len(card) > 9:
219-
strmeas = string_or_blank(card, 9, 'strmeas')
220-
else:
221-
strmeas = None
218+
strmeas = string_or_blank(card, 9, 'strmeas')
222219

223220
assert len(card) <= 10, f'len(MATS1 card) = {len(card):d}\ncard={card}'
224221
return MATS1(mid, nl_type, h, hr, yf, limit1, limit2, strmeas, tid=tid, comment=comment)
@@ -261,7 +258,7 @@ def add_op2_data(cls, data, comment: str=''):
261258
raise RuntimeError(f'Invalid Type: mid={mid}; Type={nl_type_int}; must be 1=NLELAST, '
262259
'2=PLASTIC, or 3=PLSTRN')
263260

264-
return MATS1(mid, nl_type, h, hr, yf, limit1, limit2, strmeas, tid=tid, comment=comment)
261+
return MATS1(mid, nl_type, h, hr, yf, limit1, limit2, strmeas=strmeas, tid=tid, comment=comment)
265262

266263
def Yf(self) -> str:
267264
d = {1: 'VonMises', 2: 'Tresca', 3: 'MohrCoulomb', 4: 'Drucker-Prager'}

pyNastran/op2/writer/mpt_writer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ def write_mats1(model: BDF, name, mids, nmaterials,
470470
"""writes the MATS1"""
471471

472472
# check if strmeas entry should be written
473-
# strategy: check random MATS1 card. if STRMEAS field is blank, do not write it for backwards compatibility
473+
# strategy: check first MATS1 card. if STRMEAS field is blank, do not write it for backwards compatibility
474474
test_mat = model.MATS1[mids[0]]
475475
write_strmeas = False if test_mat.strmeas is None else True
476476

0 commit comments

Comments
 (0)