Example #1
0
    def build(self):
        cards = self._cards
        ncards = len(cards)

        self.n = ncards
        if ncards:
            float_fmt = self.model.float
            self.element_id = zeros(ncards, 'int32')
            self.property_id = zeros(ncards, 'int32')
            self.node_ids = zeros((ncards, 20), 'int32')

            comments = {}
            for i, card in enumerate(cards):
                comment = self._comments[i]
                if comment:
                    self.comments[eid] = comment

                #: Element ID
                self.element_id[i] = integer(card, 1, 'element_id')
                #: Property ID
                self.property_id[i] = integer(card, 2, 'property_id')
                #: Node IDs
                self.node_ids[i, :] = fields(integer,
                                             card,
                                             'node_ids',
                                             i=3,
                                             j=23)
                assert len(card) == 23, 'len(CHEXA20 card) = %i' % len(card)

            i = self.element_id.argsort()
            self.element_id = self.element_id[i]
            self.property_id = self.property_id[i]
            self.node_ids = self.node_ids[i, :]
            self._cards = []
            self._comments = []
Example #2
0
    def __init__(self, card=None, data=None, comment=''):
        Property.__init__(self, card, data)
        if comment:
            self._comment = comment
        if card:
            #: Property ID
            self.pid = integer(card, 1, 'pid')
            #: Material ID
            self.mid1 = integer_or_blank(card, 2, 'mid1', 0)
            self.t1 = double_or_blank(card, 3, 't1')

            self.mid2 = integer_or_blank(card, 4, 'mid2', 0)
            if self.mid2 > 0:
                self.i = double(card, 5, 'i')
                assert self.i > 0.0
            else:
                self.i = blank(card, 5, 'i')

            self.mid3 = integer(card, 6, 0)
            if self.mid3 > 0:
                self.t2 = double(card, 7, 't3')
                assert self.t2 > 0.0
            else:
                self.t2 = blank(card, 7, 't3')

            self.nsm = double(card, 8, 'nsm')
            self.z1 = double(card, 9, 'z1')
            self.z2 = double(card, 10, 'z2')
            self.phi = fields(double, card, 'phi', i=11, j=len(card))
        else:
            raise NotImplementedError(data)
Example #3
0
    def __init__(self, card=None, data=None, comment=''):
        ThermalLoad.__init__(self, card, data)
        if comment:
            self._comment = comment
        if card:
            #: Load set identification number. (Integer > 0)
            self.sid = integer(card, 1, 'eid')

            self.flag = string(card, 2, 'flag')
            assert self.flag in ['POINT', 'LINE', 'REV', 'AREA3', 'AREA4',
                                 'AREA6', 'AREA8']

            #: Magnitude of thermal flux into face. Q0 is positive for heat
            #: into the surface. (Real)
            self.Q0 = double(card, 3, 'Q0')

            #: Area factor depends on type. (Real > 0.0 or blank)
            self.af = double_or_blank(card, 4, 'af')
            nfields = card.nFields()

            #: grids
            self.grids = fields(integer, card, 'grid', i=5, j=nfields)

            #: Grid point identification of connected grid points.
            #: (Integer > 0 or blank)
            self.grids = expand_thru_by(self.grids)
        else:
            self.sid = data[0]
            self.flag = data[1]
            self.Q0 = data[2]
            self.af = data[3]
            self.grids = data[4:]
Example #4
0
    def __init__(self, card=None, data=None, comment=''):
        if comment:
            self._comment = comment
        if card:
            #: Load set identification number (Integer>0)
            self.sid = integer(card, 1, 'sid')

            #: Coordinate system identification number. (Integer>0: Default=0)
            self.cid = integer_or_blank(card, 2, 'cid', 0)

            #: Acceleration vector scale factor. (Real)
            self.scale = double(card, 3, 'scale')

            #: Components of the acceleration vector measured in coordinate system
            #: CID. (Real; at least one Ni != 0)
            self.N = array([double_or_blank(card, 4, 'N1', 0.0),
                            double_or_blank(card, 5, 'N2', 0.0),
                            double_or_blank(card, 6, 'N3', 0.0)])
            assert max(abs(self.N)) > 0.

            nodes = fields(integer_or_string, card, 'node', i=9, j=len(card))
        else:
            raise NotImplementedError(data)

        #: nodes to apply the acceleration to
        self.nodes = expand_thru_by(nodes)
Example #5
0
    def __init__(self, card=None, data=None, comment=''):
        ThermalBC.__init__(self, card, data)
        if comment:
            self._comment = comment

        if card:
            #: NODAMB Ambient point for radiation exchange. (Integer > 0)
            self.nodamb = integer(card, 1, 'nodamb')
            assert self.nodamb > 0

            #: Radiation view factor between the face and the ambient point.
            #: (Real > 0.0)
            self.famb = double(card, 2, 'famb')
            assert self.famb > 0.0

            #: Control point for thermal flux load. (Integer > 0; Default = 0)
            self.cntrlnd = integer_or_blank(card, 3, 'cntrlnd', 0)
            assert self.cntrlnd >= 0

            nfields = card.nFields()
            eids = fields(integer_or_string, card, 'eid', i=4, j=nfields)
            #: CHBDYi element identification number
            self.eids = expand_thru_by(eids)
        else:
            raise NotImplementedError(data)

        min_eid = min(self.eids)
        if min_eid < 1:
            msg = 'min(eids)=%i' % min_eid
            raise ValueError(msg)
Example #6
0
    def __init__(self, card=None, data=None, comment=""):
        ThermalBC.__init__(self, card, data)
        if comment:
            self._comment = comment

        if card:
            #: NODAMB Ambient point for radiation exchange. (Integer > 0)
            self.nodamb = integer(card, 1, "nodamb")
            assert self.nodamb > 0

            #: Radiation view factor between the face and the ambient point.
            #: (Real > 0.0)
            self.famb = double(card, 2, "famb")
            assert self.famb > 0.0

            #: Control point for thermal flux load. (Integer > 0; Default = 0)
            self.cntrlnd = integer_or_blank(card, 3, "cntrlnd", 0)
            assert self.cntrlnd >= 0

            nfields = card.nfields
            eids = fields(integer_or_string, card, "eid", i=4, j=nfields)
            #: CHBDYi element identification number
            self.eids = expand_thru_by(eids)
        else:
            raise NotImplementedError(data)

        min_eid = min(self.eids)
        if min_eid < 1:
            msg = "min(eids)=%i" % min_eid
            raise ValueError(msg)
Example #7
0
    def build(self):
        cards = self._cards
        ncards = len(cards)

        self.n = ncards
        if ncards:
            float_fmt = self.model.float
            self.element_id = zeros(ncards, 'int32')
            self.property_id = zeros(ncards, 'int32')
            self.node_ids = zeros((ncards, 20), 'int32')

            comments = {}
            for i, card in enumerate(cards):
                comment = self._comments[i]
                if comment:
                    self.comments[eid] = comment

                #: Element ID
                self.element_id[i] = integer(card, 1, 'element_id')
                #: Property ID
                self.property_id[i] = integer(card, 2, 'property_id')
                #: Node IDs
                self.node_ids[i, :] = fields(integer, card, 'node_ids', i=3, j=23)
                assert len(card) == 23, 'len(CHEXA20 card) = %i' % len(card)

            i = self.element_id.argsort()
            self.element_id = self.element_id[i]
            self.property_id = self.property_id[i]
            self.node_ids = self.node_ids[i, :]
            self._cards = []
            self._comments = []
Example #8
0
    def __init__(self, card=None, data=None, comment=''):
        Property.__init__(self, card, data)
        if comment:
            self._comment = comment
        if card:
            #: Property ID
            self.pid = integer(card, 1, 'pid')
            #: Material ID
            self.mid1 = integer_or_blank(card, 2, 'mid1', 0)
            self.t1 = double_or_blank(card, 3, 't1')

            self.mid2 = integer(card, 4, 'mid2', 0)
            if self.mid2 > 0:
                self.i = double(card, 5, 'i')
                assert self.i > 0.0
            else:
                self.i = blank(card, 5, 'i')

            self.mid3 = integer(card, 6, 0)
            if self.mid3 > 0:
                self.t2 = double(card, 7, 't3')
                assert self.t2 > 0.0
            else:
                self.t2 = blank(card, 7, 't3')

            self.nsm = double(card, 8, 'nsm')
            self.z1 = double(card, 9, 'z1')
            self.z2 = double(card, 10, 'z2')
            self.phi = fields(double, card, 'phi', i=11, j=len(card))
        else:
            raise NotImplementedError(data)
Example #9
0
    def getGE(self, card, iStart):
        # Flag indicating that the next fields, 1 through 6 are structural
        # damping constants. See Remark 7. (Character)
        #self.ge = string(card, iStart, 'ge')

        #: Nominal structural damping constant in directions 1 through 6. See
        #: Remarks 2. and 3. (Real; Default = 0.0)
        self.GEi = fields(double_or_blank, card, 'GEi', iStart + 1, iStart + 7)
        self.vars.append('GE')
Example #10
0
    def getGE(self, card, iStart):
        # Flag indicating that the next fields, 1 through 6 are structural
        # damping constants. See Remark 7. (Character)
        #self.ge = string(card, iStart, 'ge')

        #: Nominal structural damping constant in directions 1 through 6. See
        #: Remarks 2. and 3. (Real; Default = 0.0)
        self.GEi = fields(double_or_blank, card, 'GEi', iStart + 1, iStart + 7)
        self.vars.append('GE')
Example #11
0
    def __init__(self, card=None, data=None, comment=''):
        Set.__init__(self, card, data)
        if comment:
            self._comment = comment

        #:  Identifiers of grids points. (Integer > 0)
        self.IDs = []
        self.components = components(card, 1, 'components')
        IDs = fields(integer_or_string, card, i=2, j=len(card))
        self.IDs = expand_thru(IDs)
Example #12
0
    def getB(self, card, iStart):
        # Flag indicating that the next 1 to 6 fields are force-per-velocity
        # damping.
        #self.b = string(card, iStart, 'b')

        #: Force per unit velocity (Real)
        #: Nominal damping coefficients in direction 1 through 6 in units of
        #: force per unit velocity. See Remarks 2, 3, and 9. (Real; Default=0.)
        self.Bi = fields(double_or_blank, card, 'Bi', iStart + 1, iStart + 7)
        self.vars.append('B')
Example #13
0
    def __init__(self, card=None, data=None, comment=''):
        Set.__init__(self, card, data)
        if comment:
            self._comment = comment

        #:  Identifiers of grids points. (Integer > 0)
        self.IDs = []
        self.components = components(card, 1, 'components')
        IDs = fields(integer_or_string, card, i=2, j=len(card))
        self.IDs = expand_thru(IDs)
Example #14
0
    def getK(self, card, iStart):
        # Flag indicating that the next 1 to 6 fields are stiffness values in
        # the element coordinate system.
        #self.k = string(card, iStart, 'k')

        #: Nominal stiffness values in directions 1 through 6.
        #: See Remarks 2 and 3. (Real; Default = 0.0)
        self.Ki = fields(double_or_blank, card, 'Ki', iStart + 1, iStart + 7)
        #print "Ki = ",self.Ki
        self.vars.append('K')
Example #15
0
    def getB(self, card, iStart):
        # Flag indicating that the next 1 to 6 fields are force-per-velocity
        # damping.
        #self.b = string(card, iStart, 'b')

        #: Force per unit velocity (Real)
        #: Nominal damping coefficients in direction 1 through 6 in units of
        #: force per unit velocity. See Remarks 2, 3, and 9. (Real; Default=0.)
        self.Bi = fields(double_or_blank, card, 'Bi', iStart + 1, iStart + 7)
        self.vars.append('B')
Example #16
0
    def getK(self, card, iStart):
        # Flag indicating that the next 1 to 6 fields are stiffness values in
        # the element coordinate system.
        #self.k = string(card, iStart, 'k')

        #: Nominal stiffness values in directions 1 through 6.
        #: See Remarks 2 and 3. (Real; Default = 0.0)
        self.Ki = fields(double_or_blank, card, 'Ki', iStart + 1, iStart + 7)
        #print "Ki = ",self.Ki
        self.vars.append('K')
Example #17
0
    def __init__(self, card=None, data=None, comment=''):
        Set.__init__(self, card, data)
        if comment:
            self._comment = comment
        self.seid = integer(card, 1, 'seid')
        #: Grid or scalar point identification number.
        #: (0 < Integer < 1000000; G1 < G2)
        self.IDs = []

        IDs = fields(integer_or_string, card, 'ID', i=2, j=len(card))
        self.IDs = expand_thru(IDs)
        self.cleanIDs()
Example #18
0
    def __init__(self, card=None, data=None, comment=''):
        LineProperty.__init__(self, card, data)
        if comment:
            self._comment = comment
        if card:
            #: Property ID
            self.pid = integer(card, 1, 'pid')
            #: Material ID
            self.mid = integer(card, 2, 'mid')
            self.group = string_or_blank(card, 3, 'group', 'MSCBMLO')
            #: Section Type (e.g. 'ROD', 'TUBE', 'I', 'H')
            self.Type = string(card, 4, 'Type')

            ndim = self.validTypes[self.Type]
            j = 9 + ndim + 1

            #: dimension list
            self.dim = fields(double_or_blank, card, 'dim', i=9, j=j)

            #: non-structural mass
            self.nsm = double_or_blank(card, 9 + ndim + 1, 'nsm', 0.0)

            if ndim > 0:
                self.nsm = set_default_if_blank(self.dim.pop(), 0.0)
            else:
                self.nsm = 0.0

            assert isinstance(self.nsm, float), 'nsm=%r' % self.nsm
        else:
            self.pid = data[0]
            self.mid = data[1]
            self.group = data[2].strip()
            self.Type = data[3].strip()
            self.dim = list(data[4:-1])
            self.nsm = data[-1]
            #print("group = %r" % self.group)
            #print("Type  = %r" % self.Type)
            #print("dim = ",self.dim)
            #print(str(self))
            #print("*PBARL = ",data)
            #raise NotImplementedError('not finished...')
        if self.Type not in self.validTypes:
            msg = ('Invalid PBARL Type, Type=%s '
                   'validTypes=%s' % (self.Type, self.validTypes.keys()))
            raise RuntimeError(msg)

        if len(self.dim) != self.validTypes[self.Type]:
            msg = 'dim=%s len(dim)=%s Type=%s len(dimType)=%s' % (
                self.dim, len(self.dim), self.Type,
                self.validTypes[self.Type])
            raise RuntimeError(msg)

        assert None not in self.dim
Example #19
0
    def __init__(self, card=None, data=None, comment=''):
        Set.__init__(self, card, data)
        if comment:
            self._comment = comment
        self.seid = integer(card, 1, 'seid')
        #: Grid or scalar point identification number.
        #: (0 < Integer < 1000000; G1 < G2)
        self.IDs = []

        IDs = fields(integer_or_string, card, 'ID', i=2, j=len(card))
        self.IDs = expand_thru(IDs)
        self.cleanIDs()
Example #20
0
    def __init__(self, card=None, data=None, comment=''):
        Set.__init__(self, card, data)
        if comment:
            self._comment = comment

        #:  Identifiers of grids points. (Integer > 0)
        self.IDs = []
        if string_or_blank(card, 2, 'C') == 'ALL':
            self.components = '123456'
        else:
            self.components = components(card, 1, 'components')
            IDs = fields(integer_or_string, 'ID', i=2, j=len(card))
            self.IDs = expand_thru(IDs)
Example #21
0
    def __init__(self, card=None, data=None, comment=''):
        Set.__init__(self, card, data)
        if comment:
            self._comment = comment

        #:  Identifiers of grids points. (Integer > 0)
        self.IDs = []
        if string_or_blank(card, 2, 'C') == 'ALL':
            self.components = '123456'
        else:
            self.components = components(card, 1, 'components')
            IDs = fields(integer_or_string, 'ID', i=2, j=len(card))
            self.IDs = expand_thru(IDs)
Example #22
0
    def __init__(self, card=None, data=None, comment=''):
        SetSuper.__init__(self, card, data)
        if comment:
            self._comment = comment
        #: Identification number for secondary superelement. (Integer >= 0).
        self.ssid = integer(card, 1, 'ssid')
        #: Identification number for the primary superelement. (Integer >= 0).
        self.psid = integer(card, 2, 'psid')
        #: Exterior grid point identification numbers for the primary
        #: superelement. (Integer > 0)
        self.IDs = []

        IDs = fields(integer_or_string, card, i=3, j=len(card))
        self.IDs = expand_thru(IDs)
        self.cleanIDs()
Example #23
0
    def __init__(self, card=None, data=None, comment=''):
        SetSuper.__init__(self, card, data)
        if comment:
            self._comment = comment
        #: Identification number for secondary superelement. (Integer >= 0).
        self.ssid = integer(card, 1, 'ssid')
        #: Identification number for the primary superelement. (Integer >= 0).
        self.psid = integer(card, 2, 'psid')
        #: Exterior grid point identification numbers for the primary
        #: superelement. (Integer > 0)
        self.IDs = []

        IDs = fields(integer_or_string, card, i=3, j=len(card))
        self.IDs = expand_thru(IDs)
        self.cleanIDs()
Example #24
0
    def __init__(self, card=None, data=None, comment=''):
        """
        ::

          RBE2 EID GN CM GM1 GM2 GM3 GM4 GM5
          GM6 GM7 GM8 -etc.- ALPHA
        """
        RigidElement.__init__(self, card, data)
        if comment:
            self._comment = comment
        if card:
            #: Element identification number
            self.eid = integer(card, 1, 'eid')

            #: Identification number of grid point to which all six independent
            #: degrees-of-freedom for the element are assigned. (Integer > 0)
            self.gn = integer(card, 2, 'gn')

            #: Component numbers of the dependent degrees-of-freedom in the
            #: global coordinate system at grid points GMi. (Integers 1 through
            #: 6 with no embedded blanks.)
            self.cm = components_or_blank(card, 3, 'cm')

            #: Grid point identification numbers at which dependent
            #: degrees-of-freedom are assigned. (Integer > 0)
            self.Gmi = fields(integer, card, 'Gm', i=4, j=len(card))
            if len(self.Gmi) > 0 and isinstance(self.Gmi[-1], float):
                #: Thermal expansion coefficient. See Remark 11.
                #: (Real > 0.0 or blank)
                self.alpha = self.Gmi.pop()  # the last field is not part of
                                             # Gmi
            else:
                self.alpha = 0.0
        else:
            self.eid = data[0]
            self.gn = data[1]
            self.cm = data[2]
            self.Gmi = data[3]
            self.alpha = data[4]
            print("eid=%s gn=%s cm=%s Gmi=%s alpha=%s"
                  % (self.eid, self.gn, self.cm, self.Gmi, self.alpha))
            raise NotImplementedError('RBE2 data...')

        assert self.gn is not None, 'gm=%s' % self.gm
        assert self.cm is not None, 'cm=%s' % self.cm
        self.gn = str(self.gn)
        self.cm = str(self.cm)
Example #25
0
    def __init__(self, card=None, data=None, comment=''):
        """
        ::

          RBE2 EID GN CM GM1 GM2 GM3 GM4 GM5
          GM6 GM7 GM8 -etc.- ALPHA
        """
        RigidElement.__init__(self, card, data)
        if comment:
            self._comment = comment
        if card:
            #: Element identification number
            self.eid = integer(card, 1, 'eid')

            #: Identification number of grid point to which all six independent
            #: degrees-of-freedom for the element are assigned. (Integer > 0)
            self.gn = integer(card, 2, 'gn')

            #: Component numbers of the dependent degrees-of-freedom in the
            #: global coordinate system at grid points GMi. (Integers 1 through
            #: 6 with no embedded blanks.)
            self.cm = components_or_blank(card, 3, 'cm')

            #: Grid point identification numbers at which dependent
            #: degrees-of-freedom are assigned. (Integer > 0)
            self.Gmi = fields(integer, card, 'Gm', i=4, j=len(card))
            if len(self.Gmi) > 0 and isinstance(self.Gmi[-1], float):
                #: Thermal expansion coefficient. See Remark 11.
                #: (Real > 0.0 or blank)
                self.alpha = self.Gmi.pop()  # the last field is not part of
                # Gmi
            else:
                self.alpha = 0.0
        else:
            self.eid = data[0]
            self.gn = data[1]
            self.cm = data[2]
            self.Gmi = data[3]
            self.alpha = data[4]
            print("eid=%s gn=%s cm=%s Gmi=%s alpha=%s" %
                  (self.eid, self.gn, self.cm, self.Gmi, self.alpha))
            raise NotImplementedError('RBE2 data...')

        assert self.gn is not None, 'gm=%s' % self.gm
        assert self.cm is not None, 'cm=%s' % self.cm
        self.gn = str(self.gn)
        self.cm = str(self.cm)
Example #26
0
 def __init__(self, card=None, data=None, comment=''):
     SolidElement.__init__(self, card, data)
     if comment:
         self._comment = comment
     if card:
         #: Element ID
         self.eid = integer(card, 1, 'eid')
         #: Property ID
         self.pid = integer(card, 2, 'pid')
         nids = fields(integer, card, 'nid', i=3, j=13)
         assert len(card) <= 13, 'len(CTETRA10 card) = %i' % len(card)
     else:
         self.eid = data[0]
         self.pid = data[1]
         nids = [d if d > 0 else None for d in data[2:]]
         assert len(data) == 12, 'len(data)=%s data=%s' % (len(data), data)
     self.prepareNodeIDs(nids, allowEmptyNodes=True)
     assert len(self.nodes) <= 10
Example #27
0
 def __init__(self, card=None, data=None, comment=''):
     SolidElement.__init__(self, card, data)
     if comment:
         self._comment = comment
     if card:
         #: Element ID
         self.eid = integer(card, 1, 'eid')
         #: Property ID
         self.pid = integer(card, 2, 'pid')
         nids = fields(integer, card, 'nid', i=3, j=7)
         assert len(card) == 7, 'len(CTETRA4 card) = %i' % len(card)
     else:
         self.eid = data[0]
         self.pid = data[1]
         nids = data[2:]
         assert len(data) == 6, 'len(data)=%s data=%s' % (len(data), data)
     self.prepareNodeIDs(nids)
     assert len(self.nodes) == 4
Example #28
0
 def __init__(self, card=None, data=None, comment=''):
     SolidElement.__init__(self, card, data)
     if comment:
         self._comment = comment
     if card:
         #: Element ID
         self.eid = integer(card, 1, 'eid')
         #: Property ID
         self.pid = integer(card, 2, 'pid')
         nids = fields(integer, card, 'nid', i=3, j=7)
         assert len(card) == 7, 'len(CTETRA4 card) = %i' % len(card)
     else:
         self.eid = data[0]
         self.pid = data[1]
         nids = data[2:]
         assert len(data) == 6, 'len(data)=%s data=%s' % (len(data), data)
     self.prepareNodeIDs(nids)
     assert len(self.nodes) == 4
Example #29
0
 def __init__(self, card=None, data=None, comment=''):
     SolidElement.__init__(self, card, data)
     if comment:
         self._comment = comment
     if card:
         #: Element ID
         self.eid = integer(card, 1, 'eid')
         #: Property ID
         self.pid = integer(card, 2, 'pid')
         nids = fields(integer, card, 'nid', i=3, j=13)
         assert len(card) <= 13, 'len(CTETRA10 card) = %i' % len(card)
     else:
         self.eid = data[0]
         self.pid = data[1]
         nids = [d if d > 0 else None for d in data[2:]]
         assert len(data) == 12, 'len(data)=%s data=%s' % (len(data), data)
     self.prepareNodeIDs(nids, allowEmptyNodes=True)
     assert len(self.nodes) <= 10
Example #30
0
 def __init__(self, card=None, data=None, comment=''):
     CrackElement.__init__(self, card, data)
     if comment:
         self._comment = comment
     if card:
         self.eid = integer(card, 1, 'eid')
         self.pid = integer(card, 2, 'pid')
         # required 1-10, 19-28
         # optional 11-18, 29-36, 37-64
         # all/none 37-46
         nids = fields(integer_or_blank, card, 'nid', 3, 67)  # cap at +3 = 67
         assert len(card) <= 67, 'len(CRAC3D card) = %i' % len(card)
     else:
         self.eid = data[0]
         self.pid = data[1]
         nids = data[2:]
     self.prepareNodeIDs(nids, allowEmptyNodes=True)
     assert len(self.nodes) == 64
Example #31
0
    def __init__(self, card=None, data=None, comment=''):
        Set.__init__(self, card, data)
        if comment:
            self._comment = comment
        #:  Unique identification number. (Integer > 0)
        self.sid = integer(card, 1, 'sid')

        #:  Set description (Character). Valid options are 'GRID', 'ELEM',
        #:  'POINT' and 'PROP'.
        self.desc = string(card, 2, 'desc')
        assert self.desc in ['GRID', 'POINT', 'ELEM', 'PROP']

        #:  Identifiers of grids points, elements, points or properties.
        #:  (Integer > 0)
        self.IDs = []

        IDs = fields(integer_or_string, card, 'ID', i=3, j=len(card))
        self.IDs = expand_thru(IDs)
        self.cleanIDs()
Example #32
0
    def __init__(self, card=None, data=None, comment=""):
        ThermalBC.__init__(self, card, data)
        if comment:
            self._comment = comment
        if card:
            #: Material identification number
            self.radmid = integer(card, 1, "radmid")
            assert self.radmid > 0

            self.absorb = double(card, 2, "absorb")
            assert 0.0 <= self.absorb <= 1.0

            nfields = card.nfields

            self.emissivity = fields(double, card, "emissivity", i=3, j=nfields)
        else:
            raise NotImplementedError(data)
        for e in self.emissivity:
            assert 0.0 <= e <= 1.0
Example #33
0
    def __init__(self, card=None, data=None, comment=''):
        Set.__init__(self, card, data)
        if comment:
            self._comment = comment
        #:  Unique identification number. (Integer > 0)
        self.sid = integer(card, 1, 'sid')

        #:  Set description (Character). Valid options are 'GRID', 'ELEM',
        #:  'POINT' and 'PROP'.
        self.desc = string(card, 2, 'desc')
        assert self.desc in ['GRID', 'POINT', 'ELEM', 'PROP']

        #:  Identifiers of grids points, elements, points or properties.
        #:  (Integer > 0)
        self.IDs = []

        IDs = fields(integer_or_string, card, 'ID', i=3, j=len(card))
        self.IDs = expand_thru(IDs)
        self.cleanIDs()
Example #34
0
    def __init__(self, card=None, data=None, comment=''):
        if comment:
            self._comment = comment
        if card:
            self.sid = integer(card, 1, 'sid')
            self.p = double(card, 2, 'p')

            if integer_string_or_blank(card, 4, 'THRU') == 'THRU':
                e1 = integer(card, 3, 'Element1')
                e2 = integer(card, 5, 'Element1')
                eids = [i for i in range(e1, e2 + 1)]
                assert len(card) == 6, 'len(PLOAD2 card) = %i' % len(card)
            else:
                eids = fields(integer, card, 'eid', i=3, j=len(card))
            self.eids = eids
        else:
            self.sid = data[0]
            self.p = data[1]
            self.eids = list(data[2:])
Example #35
0
 def __init__(self, card=None, data=None, comment=''):
     ThermalLoad.__init__(self, card, data)
     if comment:
         self._comment = comment
     if card:
         #: Load set identification number. (Integer > 0)
         self.sid = integer(card, 1, 'sid')
         #: Heat flux into element
         self.Q0 = double(card, 2, 'Q0')
         #: Control point for thermal flux load. (Integer > 0; Default = 0)
         self.cntrlnd = integer_or_blank(card, 3, 'cntrlnd', 0)
         
         nfields = card.nFields()
         eids = fields(integer_or_string, card, 'eid', i=4, j=nfields)
         #: CHBDYj element identification numbers
         self.eids = expand_thru_by(eids)
     else:
         self.sid = data[0]
         self.Q0 = data[1]
         self.cntrlnd = data[2]
         self.eids = list(data[3:])
Example #36
0
    def __init__(self, card=None, data=None, comment=''):
        Set.__init__(self, card, data)
        if comment:
            self._comment = comment
        #:  Unique identification number. (Integer > 0)
        self.sid = integer(card, 1, 'sid')

        self.IDs = []
        IDs = fields(integer_or_string, card, 'ID', i=2, j=len(card))

        self.isSkin = False
        i = 0
        if isinstance(IDs[0], string_types) and IDs[0] == 'SKIN':
            self.isSkin = True
            i += 1

        #:  List of structural grid point or element identification numbers.
        #:  (Integer > 0 or 'THRU'; for the 'THRU' option, ID1 < ID2 or 'SKIN';
        #:  in field 3)
        self.IDs = expand_thru(IDs[i:])
        self.clean_ids()
        self.xref_type = None
Example #37
0
    def __init__(self, card=None, data=None, comment=''):
        ThermalBC.__init__(self, card, data)
        if comment:
            self._comment = comment
        if card:
            #: Material identification number
            self.radmid = integer(card, 1, 'radmid')
            assert self.radmid > 0

            self.absorb = double(card, 2, 'absorb')
            assert 0. <= self.absorb <= 1.0

            nfields = card.nFields()

            self.emissivity = fields(double,
                                     card,
                                     'emissivity',
                                     i=3,
                                     j=nfields)
        else:
            raise NotImplementedError(data)
        for e in self.emissivity:
            assert 0. <= e <= 1.0
Example #38
0
    def add(self, card, comment):
        i = self.i
        self.property_id[i] = integer(card, 1, 'property_id')
        self.material_id[i] = integer(card, 2, 'material_id')

        self.group[i] = string_or_blank(card, 3, 'group', 'MSCBMLO')
        Type = string(card, 4, 'Type')
        self.Type[i] = Type

        ndim = self.valid_types[Type]
        j = 9 + ndim + 1
        dim = fields(double_or_blank, card, 'dim', i=9, j=j)

        nsm = double_or_blank(card, 9 + ndim + 1, 'nsm', 0.0)

        if ndim > 0:
            nsm = set_default_if_blank(dim.pop(), 0.0)
        #else:
            #nsm = 0.0

        self.dim[i] = dim
        self.nsm[i] = nsm
        assert isinstance(nsm, float), 'nsm=%r' % nsm

        if Type not in self.valid_types:
            msg = ('Invalid PBARL Type, Type=%s '
                   'validTypes=%s' % (Type, self.valid_types.keys()))
            raise RuntimeError(msg)

        if len(dim) != self.valid_types[Type]:
            msg = 'dim=%s len(dim)=%s Type=%s len(dimType)=%s' % (
                dim, len(dim), Type,
                self.valid_types[Type])
            raise RuntimeError(msg)

        assert None not in dim
        self.i += 1
Example #39
0
    def __init__(self, card=None, data=None, comment=''):
        ThermalBC.__init__(self, card, data)
        if comment:
            self._comment = comment
        if card:
            #: NODAMB Ambient point for radiation exchange. (Integer > 0)
            self.nodamb = integer(card, 1, 'nodamb')
            assert self.nodamb > 0

            #: Radiation view factor between the face and the ambient point.
            #: (Real > 0.0)
            self.famb = double(card, 2, 'famb')
            assert self.famb > 0.0

            #: Control point for thermal flux load. (Integer > 0; Default = 0)
            self.cntrlnd = integer_or_blank(card, 3, 'cntrlnd', 0)
            assert self.cntrlnd >= 0

            nfields = card.nFields()
            eids = fields(integer_or_string, card, 'eid', i=4, j=nfields)
            #: CHBDYi element identification number
            self.eids = expand_thru_by(eids)
        else:
            raise NotImplementedError(data)
Example #40
0
    def add(self, card, comment):
        i = self.i
        self.property_id[i] = integer(card, 1, 'property_id')
        self.material_id[i] = integer(card, 2, 'material_id')

        self.group[i] = string_or_blank(card, 3, 'group', 'MSCBMLO')
        Type = string(card, 4, 'Type')
        self.Type[i] = Type

        ndim = self.valid_types[Type]
        j = 9 + ndim + 1
        dim = fields(double_or_blank, card, 'dim', i=9, j=j)

        nsm = double_or_blank(card, 9 + ndim + 1, 'nsm', 0.0)

        if ndim > 0:
            nsm = set_default_if_blank(dim.pop(), 0.0)
        #else:
        #nsm = 0.0

        self.dim[i] = dim
        self.nsm[i] = nsm
        assert isinstance(nsm, float), 'nsm=%r' % nsm

        if Type not in self.valid_types:
            msg = ('Invalid PBARL Type, Type=%s '
                   'validTypes=%s' % (Type, self.valid_types.keys()))
            raise RuntimeError(msg)

        if len(dim) != self.valid_types[Type]:
            msg = 'dim=%s len(dim)=%s Type=%s len(dimType)=%s' % (
                dim, len(dim), Type, self.valid_types[Type])
            raise RuntimeError(msg)

        assert None not in dim
        self.i += 1
Example #41
0
 def __init__(self, card=None, data=None, comment=''):
     if comment:
         self._comment = comment
     self.sid = integer(card, 1, 'sid')
     self.freqs = fields(double, card, 'freq', i=2, j=len(card))
     self.cleanFreqs()
Example #42
0
 def __init__(self, card=None, data=None, comment=''):
     if comment:
         self._comment = comment
     self.sid = integer(card, 1, 'sid')
     self.freqs = fields(double, card, 'freq', i=2, j=len(card))
     self.cleanFreqs()