|
23 | 23 | string_or_blank, |
24 | 24 | ) |
25 | 25 | if TYPE_CHECKING: # pragma: no cover |
26 | | - from pyNastran.bdf.bdf import BDF |
| 26 | + from pyNastran.bdf.bdf import BDF, SUPORT, SUPORT1, AESURF, AEPARM, AELINK |
27 | 27 | from pyNastran.bdf.bdf_interface.bdf_card import BDFCard |
28 | 28 |
|
29 | 29 |
|
@@ -656,7 +656,7 @@ class TRIM(BaseCard): |
656 | 656 | 1: 'sid', 2: 'mach', 3: 'q', 8: 'aeqr', |
657 | 657 | } |
658 | 658 |
|
659 | | - def _get_field_helper(self, n): |
| 659 | + def _get_field_helper(self, n: int): |
660 | 660 | """ |
661 | 661 | Gets complicated parameters on the TRIM card |
662 | 662 |
|
@@ -781,9 +781,13 @@ def validate(self): |
781 | 781 | len(self.labels), len(self.uxs), str(self.labels), str(self.uxs)) |
782 | 782 | raise RuntimeError(msg) |
783 | 783 |
|
784 | | - def verify_trim(self, suport, suport1, |
785 | | - aestats, aeparms, aelinks, |
786 | | - aesurf, xref=True): |
| 784 | + def verify_trim(self, |
| 785 | + suport: list[SUPORT], |
| 786 | + suport1: SUPORT1, |
| 787 | + aestats: dict[int, AESTAT], |
| 788 | + aeparms: dict[str, AEPARM], |
| 789 | + aelinks: dict[int, AELINK], |
| 790 | + aesurf: dict[str, AESURF], xref=True): |
787 | 791 | """ |
788 | 792 | Magic function that makes TRIM cards not frustrating. |
789 | 793 |
|
@@ -938,39 +942,39 @@ def verify_trim(self, suport, suport1, |
938 | 942 | raise RuntimeError(msg) |
939 | 943 |
|
940 | 944 | # TODO: this doesn't work for multiple subcases |
941 | | - #ntotal_suport_dofs = nsuport_dofs, nsuport1_dofs |
942 | | - #ndelta = ntrim - nsuport_dofs - nsuport1_dofs - naesurf |
943 | | - #if ndelta != 0: |
944 | | - #msg = 'ntrim - nsuport_dofs - nsuport1_dofs - naesurf = ndelta = %s; ndelta != 0\n' % ndelta |
945 | | - #msg += 'ntrim=%s nsuport_dofs=%s nsuport1_dofs=%s naesurfs=%s' % ( |
946 | | - #ntrim, nsuport_dofs, nsuport1_dofs, naesurf) |
947 | | - #raise RuntimeError(msg) |
948 | | - |
949 | | - #ndelta = (naestat + naesurf + naeparm + ntrim_aesurf) - (ntrim + naelink + nsuport_dofs + nsuport1_dofs) |
950 | | - #if ndelta != 0: |
951 | | - #msg = ( |
952 | | - #'(naestat + naesurf + naeparm + ntrim_aesurf) - ' |
953 | | - #'(ntrim + naelink + nsuport_dofs + nsuport1_dofs) = ndelta = %s; ndelta != 0\n' |
954 | | - #'naestat=%s naesurf=%s naeparm=%s ntrim_aesurfs=%s\n' |
955 | | - #'ntrim=%s naelink=%s nsuport_dofs=%s nsuport1_dofs=%s' % ( |
956 | | - #ndelta, |
957 | | - #naestat, naesurf, naeparms, ntrim_aesurf, |
958 | | - #ntrim, naelink, nsuport_dofs, nsuport1_dofs)) |
| 945 | + # ntotal_suport_dofs = nsuport_dofs, nsuport1_dofs |
| 946 | + # ndelta = ntrim - nsuport_dofs - nsuport1_dofs - naesurf |
| 947 | + # if ndelta != 0: |
| 948 | + # msg = 'ntrim - nsuport_dofs - nsuport1_dofs - naesurf = ndelta = %s; ndelta != 0\n' % ndelta |
| 949 | + # msg += 'ntrim=%s nsuport_dofs=%s nsuport1_dofs=%s naesurfs=%s' % ( |
| 950 | + # ntrim, nsuport_dofs, nsuport1_dofs, naesurf) |
| 951 | + # raise RuntimeError(msg) |
| 952 | + # |
| 953 | + # ndelta = (naestat + naesurf + naeparm + ntrim_aesurf) - (ntrim + naelink + nsuport_dofs + nsuport1_dofs) |
| 954 | + # if ndelta != 0: |
| 955 | + # msg = ( |
| 956 | + # '(naestat + naesurf + naeparm + ntrim_aesurf) - ' |
| 957 | + # '(ntrim + naelink + nsuport_dofs + nsuport1_dofs) = ndelta = %s; ndelta != 0\n' |
| 958 | + # 'naestat=%s naesurf=%s naeparm=%s ntrim_aesurfs=%s\n' |
| 959 | + # 'ntrim=%s naelink=%s nsuport_dofs=%s nsuport1_dofs=%s' % ( |
| 960 | + # ndelta, |
| 961 | + # naestat, naesurf, naeparms, ntrim_aesurf, |
| 962 | + # ntrim, naelink, nsuport_dofs, nsuport1_dofs)) |
959 | 963 |
|
960 | 964 | nplus = (naestat + naesurf + naeparm) |
961 | 965 | nminus = ntrim + naelink + nsuport_dofs + nsuport1_dofs |
962 | 966 |
|
963 | 967 | ndelta = nplus - nminus + 0*2*ntrim_aesurfs |
964 | 968 | if ndelta != 0: |
965 | | - #msg = ( |
966 | | - #'(naestat + naesurf + naeparm) - (ntrim + ntrim_aesurf? + naelink + ' |
967 | | - #'nsuport_dofs + nsuport1_dofs) = ndelta = %s; ndelta != 0\n' |
968 | | - #'naestat=%s naesurf=%s naeparm=%s ntrim=%s ntrim_aesurf=%s ' |
969 | | - #'naelink=%s nsuport_dofs=%s nsuport1_dofs=%s\n' % ( |
970 | | - #ndelta, |
971 | | - #naestat, naesurf, naeparm, ntrim, ntrim_aesurf, |
972 | | - #naelink, nsuport_dofs, nsuport1_dofs) |
973 | | - #) |
| 969 | + # msg = ( |
| 970 | + # '(naestat + naesurf + naeparm) - (ntrim + ntrim_aesurf? + naelink + ' |
| 971 | + # 'nsuport_dofs + nsuport1_dofs) = ndelta = %s; ndelta != 0\n' |
| 972 | + # 'naestat=%s naesurf=%s naeparm=%s ntrim=%s ntrim_aesurf=%s ' |
| 973 | + # 'naelink=%s nsuport_dofs=%s nsuport1_dofs=%s\n' % ( |
| 974 | + # ndelta, |
| 975 | + # naestat, naesurf, naeparm, ntrim, ntrim_aesurf, |
| 976 | + # naelink, nsuport_dofs, nsuport1_dofs) |
| 977 | + # ) |
974 | 978 | msg = ( |
975 | 979 | 'Invalid trim state (ndelta != 0):\n' |
976 | 980 | f' (naestat + naesurf + naeparm + 0*2*ntrim_aesurf?) = ({naestat} + {naesurf} + {naeparm} + 0*2*{ntrim_aesurf}) = {nplus}\n' |
@@ -1193,6 +1197,7 @@ class UXVEC(BaseCard): |
1193 | 1197 | """ |
1194 | 1198 | type = 'UXVEC' |
1195 | 1199 | _field_map = {1: 'sid', } |
| 1200 | + |
1196 | 1201 | def __init__(self, sid: int, labels: list[str], uxs: list[float], |
1197 | 1202 | comment: str=''): |
1198 | 1203 | BaseCard.__init__(self) |
|
0 commit comments