|
26 | 26 | from pyNastran.bdf.cards.materials import get_mat_props_S |
27 | 27 | from pyNastran.bdf.bdf_interface.internal_get import coord_id, material_id |
28 | 28 | from pyNastran.bdf.bdf_interface.assign_type import ( |
29 | | - integer, integer_or_blank, double, double_or_blank, string_or_blank, |
| 29 | + integer, integer_or_blank, double, double_or_blank, string_or_blank, integer_double_or_blank |
30 | 30 | ) |
31 | 31 | from pyNastran.bdf.bdf_interface.assign_type_force import force_double_or_blank |
32 | 32 | from pyNastran.bdf.field_writer_8 import print_card_8 |
@@ -2018,6 +2018,136 @@ def write_card(self, size: int=8, is_double: bool=False) -> str: |
2018 | 2018 | return self.comment + print_card_8(card) |
2019 | 2019 |
|
2020 | 2020 |
|
| 2021 | +class PGPLSN(Property): |
| 2022 | + type = 'PGPLSN' |
| 2023 | + _field_map = {1: 'pid', |
| 2024 | + 2:'mid', |
| 2025 | + 3:'cgid', |
| 2026 | + 4:'t', |
| 2027 | + 5:'kn', |
| 2028 | + 6: 'kr1', |
| 2029 | + 7: 'kr2', |
| 2030 | + } |
| 2031 | + |
| 2032 | + @classmethod |
| 2033 | + def _init_from_empty(cls): |
| 2034 | + return PGPLSN(pid=1, mid=1, cgid=1, t=1.) |
| 2035 | + |
| 2036 | + def __init__(self, pid: int, mid: int, cgid: int, t: float, |
| 2037 | + kn: float | int = 0., kr1: float | int = 0., kr2: float | int = 0., |
| 2038 | + comment: str=''): |
| 2039 | + |
| 2040 | + """ |
| 2041 | + Generalized Plane Strain Element Property for SOL 401 (NX Nastran) |
| 2042 | + :param pid: Property identification number. (Integer > 0) |
| 2043 | + :param mid: Identification number of a MAT1 or MAT11 entry. (Integer > 0; No default) |
| 2044 | + :param cgid: Identification number of control grid point. (Integer > 0; No default) |
| 2045 | + :param t: Undeformed element thickness (Real > 0.0; No default) |
| 2046 | + :param kn: Optional user-specified additive normal stiffness relative to the planar area defined by the mesh of |
| 2047 | + generalized plane strain elements. (Real ≥ 0.0 or Integer > 0; Default = 0.0) |
| 2048 | + If real entry, value of stiffness at all times. |
| 2049 | + If integer entry, identification number of a TABLEDi entry that contains value of stiffness as a |
| 2050 | + function of time. |
| 2051 | + :param kr1, kr2: Optional user-specified additive rotational stiffness in the units moment/radian about the |
| 2052 | + ith-axis of the displacement coordinate system for the control grid point. See Remark 3. |
| 2053 | + (Real ≥ 0.0 or Integer > 0; Default = 0.0) |
| 2054 | + If real entry, value of stiffness at all times. |
| 2055 | + If integer entry, identification number of a TABLEDi entry that contains value of stiffness as a function of |
| 2056 | + time. |
| 2057 | + """ |
| 2058 | + |
| 2059 | + Property.__init__(self) |
| 2060 | + if comment: |
| 2061 | + self.comment = comment |
| 2062 | + |
| 2063 | + self.pid = pid |
| 2064 | + self.mid = mid |
| 2065 | + self.cgid = cgid |
| 2066 | + self.t = t |
| 2067 | + self.kn = kn |
| 2068 | + self.kr1, self.kr2 = kr1, kr2 |
| 2069 | + |
| 2070 | + self.mid_ref = None # for cross-referencing |
| 2071 | + |
| 2072 | + @classmethod |
| 2073 | + def add_card(cls, card, comment=''): |
| 2074 | + """ |
| 2075 | + Adds a PGPLSN card from ``BDF.add_card(...)`` |
| 2076 | +
|
| 2077 | + Parameters |
| 2078 | + ---------- |
| 2079 | + card : BDFCard() |
| 2080 | + a BDFCard object |
| 2081 | + comment : str; default='' |
| 2082 | + a comment for the card |
| 2083 | +
|
| 2084 | + """ |
| 2085 | + pid = integer(card, 1, 'pid') |
| 2086 | + mid = integer(card, 2, 'mid') # MAT1, MAT11 |
| 2087 | + cgid = integer(card, 3, 'cgid') |
| 2088 | + |
| 2089 | + t = double(card, 4, 't') |
| 2090 | + kn = integer_double_or_blank(card, 5, 'kn', default=0.) |
| 2091 | + kr1 = integer_double_or_blank(card, 6, 'kr1', default=0.) |
| 2092 | + kr2 = integer_double_or_blank(card, 7, 'kr2', default=0.) |
| 2093 | + |
| 2094 | + return PGPLSN(pid, mid, cgid=cgid, t=t, kn=kn, kr1=kr1, kr2=kr2, comment=comment) |
| 2095 | + |
| 2096 | + def cross_reference(self, model: BDF) -> None: |
| 2097 | + """ |
| 2098 | + Cross links the card so referenced cards can be extracted directly |
| 2099 | +
|
| 2100 | + Parameters |
| 2101 | + ---------- |
| 2102 | + model : BDF() |
| 2103 | + the BDF object |
| 2104 | +
|
| 2105 | + """ |
| 2106 | + msg = ', which is required by PGPLSN pid=%s' % self.pid |
| 2107 | + self.mid_ref = model.Material(self.mid, msg) |
| 2108 | + |
| 2109 | + def safe_cross_reference(self, model: BDF, xref_errors) -> None: |
| 2110 | + """ |
| 2111 | + Cross links the card so referenced cards can be extracted directly |
| 2112 | +
|
| 2113 | + Parameters |
| 2114 | + ---------- |
| 2115 | + model : BDF() |
| 2116 | + the BDF object |
| 2117 | +
|
| 2118 | + """ |
| 2119 | + msg = ', which is required by PGPLSN pid=%s' % self.pid |
| 2120 | + self.mid_ref = model.safe_material(self.mid, self.pid, xref_errors, msg) |
| 2121 | + |
| 2122 | + def uncross_reference(self) -> None: |
| 2123 | + """Removes cross-reference links""" |
| 2124 | + self.mid = self.Mid() |
| 2125 | + self.mid_ref = None |
| 2126 | + |
| 2127 | + def _verify(self, xref): |
| 2128 | + unused_pid = self.Pid() |
| 2129 | + unused_mid = self.Mid() |
| 2130 | + #stress_strain_output_location = self.stress_strain_output_location |
| 2131 | + if xref: |
| 2132 | + assert self.mid_ref.type in ['MAT1', 'MAT11'], 'PGPLSN: mid.type=%s' % self.mid_ref.type |
| 2133 | + |
| 2134 | + def Mid(self) -> int: |
| 2135 | + """returns the material id""" |
| 2136 | + return material_id(self.mid_ref, self.mid) |
| 2137 | + |
| 2138 | + def raw_fields(self) -> list: |
| 2139 | + list_fields = ['PGPLSN', self.pid, self.Mid(), self.cgid, self.t, self.kn, self.kr1, self.kr2] |
| 2140 | + return list_fields |
| 2141 | + |
| 2142 | + def repr_fields(self) -> list: |
| 2143 | + list_fields = ['PGPLSN', self.pid, self.Mid(), self.cgid, self.t, self.kn, self.kr1, self.kr2] |
| 2144 | + return list_fields |
| 2145 | + |
| 2146 | + def write_card(self, size: int=8, is_double: bool=False) -> str: |
| 2147 | + card = self.repr_fields() |
| 2148 | + return self.comment + print_card_8(card) |
| 2149 | + |
| 2150 | + |
2021 | 2151 | class PSHEAR(Property): |
2022 | 2152 | """ |
2023 | 2153 | Defines the properties of a shear panel (CSHEAR entry). |
|
0 commit comments