def __init__(self, eid, pid, ga, gb, x, g0, is_offt, offt, bit, pa, pb, wa, wb, sa, sb, comment=''): LineElement.__init__(self) if comment: self._comment = comment self.eid = eid self.pid = pid self.ga = ga self.gb = gb self.x = x self.g0 = g0 self.is_offt = is_offt self.offt = offt self.bit = bit self.pa = pa self.pb = pb self.wa = wa self.wb = wb self.sa = sa self.sb = sb self._validate_input()
def __init__(self, eid, pid, nids, x, g0, offt='GGG', bit=None, pa=0, pb=0, wa=None, wb=None, sa=0, sb=0, comment=''): """ Adds a CBEAM card Parameters ---------- pid : int property id mid : int material id nids : List[int, int] node ids; connected grid points at ends A and B x : List[float, float, float] Components of orientation vector, from GA, in the displacement coordinate system at GA (default), or in the basic coordinate system g0 : int Alternate method to supply the orientation vector using grid point G0. Direction of is from GA to G0. is then transferred to End A offt : str; default='GGG' Offset vector interpretation flag None : bit is active bit : float; default=None Built-in twist of the cross-sectional axes about the beam axis at end B relative to end A. For beam p-elements ONLY! None : offt is active pa / pb : int; default=0 Pin Flag at End A/B. Releases the specified DOFs wa / wb : List[float, float, float] Components of offset vectors from the grid points to the end points of the axis of the shear center sa / sb : int; default=0 Scalar or grid point identification numbers for the ends A and B, respectively. The degrees-of-freedom at these points are the warping variables . SA and SB cannot be specified for beam p-elements comment : str; default='' a comment for the card offt/bit are MSC specific fields """ LineElement.__init__(self) if comment: self.comment = comment if wa is None: wa = np.zeros(3, dtype='float64') else: wa = np.asarray(wa) if wb is None: wb = np.zeros(3, dtype='float64') else: wb = np.asarray(wb) self.eid = eid self.pid = pid self.ga = nids[0] self.gb = nids[1] self.x = x self.g0 = g0 self.offt = offt self.bit = bit self.pa = pa self.pb = pb self.wa = wa self.wb = wb self.sa = sa self.sb = sb self.ga_ref = None self.gb_ref = None self.pid_ref = None self.g0_ref = None self.g0_vector = None if self.offt is not None: self.offt = self.offt.replace('E', 'O')
def __init__(self, card=None, data=None, comment=''): LineElement.__init__(self, card, data) if comment: self._comment = comment if card: self.eid = integer(card, 1, 'eid') self.pid = integer_or_blank(card, 2, 'pid', self.eid) self.ga = integer(card, 3, 'ga') self.gb = integer(card, 4, 'gb') self.initX_G0(card) self.initOfftBit(card) self.pa = integer_or_blank(card, 9, 'pa', 0) self.pb = integer_or_blank(card, 10, 'pb', 0) self.wa = array([double_or_blank(card, 11, 'w1a', 0.0), double_or_blank(card, 12, 'w2a', 0.0), double_or_blank(card, 13, 'w3a', 0.0)], 'float64') self.wb = array([double_or_blank(card, 14, 'w1b', 0.0), double_or_blank(card, 15, 'w2b', 0.0), double_or_blank(card, 16, 'w3b', 0.0)], 'float64') self.sa = integer_or_blank(card, 17, 'sa', 0) self.sb = integer_or_blank(card, 18, 'sb', 0) assert len(card) <= 19, 'len(CBEAM card) = %i' % len(card) else: #: .. todo:: verify #data = [[eid,pid,ga,gb,sa,sb, pa,pb,w1a,w2a,w3a,w1b,w2b,w3b], # [f,g0]] #data = [[eid,pid,ga,gb,sa,sb, pa,pb,w1a,w2a,w3a,w1b,w2b,w3b], # [f,x1,x2,x3]] main = data[0] flag = data[1][0] if flag in [0, 1]: self.g0 = None self.x = array([data[1][1], data[1][2], data[1][3]], dtype='float64') else: self.g0 = data[1][1] self.x = None self.eid = main[0] self.pid = main[1] self.ga = main[2] self.gb = main[3] self.sa = main[4] self.sb = main[5] self.isOfft = True #: .. todo:: is this correct??? #self.offt = str(data[6]) # GGG self.offt = 'GGG' #: .. todo:: is this correct??? self.pa = main[6] self.pb = main[7] self.wa = array([main[8], main[9], main[10]], 'float64') self.wb = array([main[11], main[12], main[13]], 'float64') if self.g0 in [self.ga, self.gb]: msg = 'G0=%s cannot be GA=%s or GB=%s' % (self.g0, self.ga, self.gb) raise RuntimeError(msg)
def __init__(self, eid, pid, ga, gb, x, g0, offt, bit, pa=0, pb=0, wa=None, wb=None, sa=0, sb=0, comment=''): """ Adds a CBEAM card Parameters ---------- pid : int property id mid : int material id ga / gb : int grid point at End A/B x : List[float, float, float] Components of orientation vector, from GA, in the displacement coordinate system at GA (default), or in the basic coordinate system g0 : int Alternate method to supply the orientation vector using grid point G0. Direction of is from GA to G0. is then transferred to End A offt : str; default='GGG' Offset vector interpretation flag None : bit is active bit : float; default=None Built-in twist of the cross-sectional axes about the beam axis at end B relative to end A. For beam p-elements ONLY! None : offt is active pa / pb : int; default=0 Pin Flag at End A/B. Releases the specified DOFs wa / wb : List[float, float, float] Components of offset vectors from the grid points to the end points of the axis of the shear center sa / sb : int; default=0 Scalar or grid point identification numbers for the ends A and B, respectively. The degrees-of-freedom at these points are the warping variables . SA and SB cannot be specified for beam p-elements comment : str; default='' a comment for the card offt/bit are MSC specific fields """ LineElement.__init__(self) if comment: self.comment = comment if wa is None: wa = np.zeros(3, dtype='float64') else: wa = np.asarray(wa) if wb is None: wb = np.zeros(3, dtype='float64') else: wb = np.asarray(wb) self.eid = eid self.pid = pid self.ga = ga self.gb = gb self.x = x self.g0 = g0 self.offt = offt self.bit = bit self.pa = pa self.pb = pb self.wa = wa self.wb = wb self.sa = sa self.sb = sb self._validate_input()