当前位置: 首页>>代码示例>>Python>>正文


Python fieldWriter16.print_card_16函数代码示例

本文整理汇总了Python中pyNastran.bdf.fieldWriter16.print_card_16函数的典型用法代码示例。如果您正苦于以下问题:Python print_card_16函数的具体用法?Python print_card_16怎么用?Python print_card_16使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了print_card_16函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: write_bdf

 def write_bdf(self, size=8, is_double=False):
     card = self.reprFields()
     if size == 8:
         return self.comment() + print_card_8(card)
     elif is_double:
         return self.comment() + print_card_double(card)
     return self.comment() + print_card_16(card)
开发者ID:umvarma,项目名称:pynastran,代码行数:7,代码来源:coordinateSystems.py

示例2: write_bdf

 def write_bdf(self, f, size=8):
     card = ['SPCADD', self.spc_id] + self.spc_ids
     #print "card = ", card
     if size == 8:
         f.write(print_card_8(card))
     else:
         f.write(print_card_16(card))
开发者ID:umvarma,项目名称:pynastran,代码行数:7,代码来源:spcadd.py

示例3: write_bdf

    def write_bdf(self, f, size=8, property_id=None):
        #print('PBARL.n = %s' % self.n)
        if self.n:
            if property_id is None:
                i = arange(self.n)
            else:
                i = searchsorted(self.property_id, property_id)
            #print('i = %s' % i)
            #cid = [cid if cid != 0 else '' for cid in self.coord_id]

            #group = set_blank_if_default(self.group, 'MSCBMLO')
            #list_fields = ['PBARL', self.pid, self.Mid(), group, self.Type, None,
                           #None, None, None] + self.dim + [self.nsm]

            #self.model.log.debug('*pbarl write pids=%s' % self.property_id)
            for (j, pid, mid, group, Type, nsm) in zip(count(), self.property_id[i], self.material_id[i],
                        self.group[i], self.Type[i], self.nsm[i]):
                dim = self.dim[j]
                sgroup = set_blank_if_default(group, 'MSCBMLO')

                list_fields = ['PBARL', pid, mid, group, Type, None,
                               None, None, None] + dim + [nsm]
                if size == 8:
                    f.write(print_card_8(list_fields))
                else:
                    f.write(print_card_16(list_fields))
开发者ID:umvarma,项目名称:pynastran,代码行数:26,代码来源:pbarl.py

示例4: write_bdf

    def write_bdf(self, f, size, is_double, coord_id=None):
        assert size in [8, 16], size
        assert is_double in [True, False], is_double

        if self.n:
            #if coord_id is None:
            i = arange(self.n)
            #else:
                #assert len(unique(coord_id))==len(coord_id), unique(coord_id)
                #i = searchsorted(self.coord_id, coord_id)

            if size == 8:
                for cid, coord in iteritems(self.coords):
                    if cid > 0:
                        list_fields = [coord.type, cid, coord.rid] + list(coord.e1) + list(coord.e2) + list(coord.e3)
                        f.write(print_card_8(list_fields))
            else:
                if is_double:
                    for cid, coord in iteritems(self.coords):
                        if cid > 0:
                            list_fields = [coord.type, cid, coord.rid] + list(coord.e1) + list(coord.e2) + list(coord.e3)
                            f.write(print_card_16(list_fields))
                else:
                    for cid, coord in iteritems(self.coords):
                        if cid > 0:
                            list_fields = [coord.type, cid, coord.rid] + list(coord.e1) + list(coord.e2) + list(coord.e3)
                            f.write(print_card_double(list_fields))
开发者ID:umvarma,项目名称:pynastran,代码行数:27,代码来源:coord.py

示例5: write_bdf

    def write_bdf(self, f, size=8, element_ids=None):
        if self.n:
            if element_ids is None:
                i = arange(self.n)
            else:
                i = searchsorted(self.element_id, self.element_id)

            for (eid, pid, n, is_g0, g0, x, offt, pin, wa, wb) in zip(
                self.element_id[i], self.property_id[i], self.node_ids[i],
                self.is_g0[i], self.g0[i], self.x[i],
                self.offt[i],
                self.pin_flags[i], self.wa[i], self.wb[i]):

                pa = set_blank_if_default(pin[0], 0)
                pb = set_blank_if_default(pin[1], 0)

                w1a = set_blank_if_default(wa[0], 0.0)
                w2a = set_blank_if_default(wa[1], 0.0)
                w3a = set_blank_if_default(wa[2], 0.0)
                w1b = set_blank_if_default(wb[0], 0.0)
                w2b = set_blank_if_default(wb[1], 0.0)
                w3b = set_blank_if_default(wb[2], 0.0)
                x1 = g0 if is_g0 else x[0]
                x2 = 0 if is_g0 else x[1]
                x3 = 0 if is_g0 else x[2]

                offt = set_string8_blank_if_default(offt, 'GGG')
                card = ['CBAR', eid, pid, n[0], n[1], x1, x2, x3, offt,
                        pa, pb, w1a, w2a, w3a, w1b, w2b, w3b]
                if size == 8:
                    f.write(print_card_8(card))
                else:
                    f.write(print_card_16(card))
开发者ID:umvarma,项目名称:pynastran,代码行数:33,代码来源:cbar.py

示例6: write_bdf

 def write_bdf(self, f, size=8):
     card = ['NLPCI', self.nlpci_id, self.Type, self.minalr,
             self.maxalr, self.scale, None, self.desiter, self.mxinc]
     if size == 8:
         f.write(print_card_8(card))
     else:
         f.write(print_card_16(card))
开发者ID:umvarma,项目名称:pynastran,代码行数:7,代码来源:nlpci.py

示例7: write_bdf

 def write_bdf(self, f, size=8):
     for comp, nodes in iteritems(self.components):
         card = ['SPC1', self.constraint_id, comp] + list(nodes)
         if size == 8:
             f.write(print_card_8(card))
         else:
             f.write(print_card_16(card))
开发者ID:umvarma,项目名称:pynastran,代码行数:7,代码来源:spc1.py

示例8: write_bdf

 def write_bdf(self, f, size=8, is_double=False):
     if self.n:
         card = ['GRDSET', None, self.cp, None, None, None, self.cd, self.seid]
         if size == 8:
             f.write(print_card_8(card))
         else:
             f.write(print_card_16(card))
开发者ID:umvarma,项目名称:pynastran,代码行数:7,代码来源:grid.py

示例9: write_bdf

 def write_bdf(self, f, size=8, is_double=False):
     #..todo:: collapse the IDs
     if self.n:
         card = ['EPOINT'] + list(self.epoint)
         if size == 8:
             f.write(print_card_8(card))
         else:
             f.write(print_card_16(card))
开发者ID:umvarma,项目名称:pynastran,代码行数:8,代码来源:epoint.py

示例10: write_bdf

 def write_bdf(self, f, size=8):
     if self.n:
         n = 0
         for lid, t in zip(self.load_id, self.temperature_default):
             card = ['TEMPD', lid, t]
             if size == 8:
                 f.write(print_card_8(card))
             else:
                 f.write(print_card_16(card))
开发者ID:umvarma,项目名称:pynastran,代码行数:9,代码来源:temp.py

示例11: write_bdf

 def write_bdf(self, f, size=8):
     if self.n:
         for constraint in self.constraints:
             card = ['MPC', self.constraint_id]
             for (G, C, A) in constraint:
                 card += [G, C, A]
             if size == 8:
                 f.write(print_card_8(card))
             else:
                 f.write(print_card_16(card))
开发者ID:umvarma,项目名称:pynastran,代码行数:10,代码来源:mpc.py

示例12: write_bdf

    def write_bdf(self, f, size=8, lids=None):
        if self.n:
            for (lid, cid, scale, N, mb) in zip(
                 self.load_id, self.coord_id, self.scale, self.N, self.mb):

                card = ['GRAV', lid, cid, scale, N[0], N[1], n[2], mb]
                if size == 8:
                    f.write(print_card_8(card))
                else:
                    f.write(print_card_16(card))
开发者ID:umvarma,项目名称:pynastran,代码行数:10,代码来源:grav.py

示例13: write_bdf

    def write_bdf(self, f, size=8, lids=None):
        if self.n:
            for (lid, nid, cid, mag, xyz) in zip(
                 self.load_id, self.node_id, self.coord_id, self.mag, self.xyz):

                card = ['MOMENT', lid, nid, cid, mag, xyz[0], xyz[1], xyz[2] ]
                if size == 8:
                    f.write(print_card_8(card))
                else:
                    f.write(print_card_16(card))
开发者ID:umvarma,项目名称:pynastran,代码行数:10,代码来源:moment.py

示例14: write_bdf

 def write_bdf(self, f, size=8):
     if self.n:
         for dof, node_ids in sorted(iteritems(self.components)):
             card = ['SPC', self.constraint_id]
             for node_id in node_ids:
                 card += [node_id, dof, 0.0]
             if size == 8:
                 f.write(print_card_8(card))
             else:
                 f.write(print_card_16(card))
开发者ID:umvarma,项目名称:pynastran,代码行数:10,代码来源:spc.py

示例15: write_bdf

 def write_bdf(self, f, size=8, is_double=False, load_id=None):
     if load_id is None:
         load_id = self.load_id
     load_id = asarray(load_id)
     list_fields = ['LOAD', self.load_id, self.scale]
     for (scaleFactor, lid) in zip(self.scale_factors, self.load_ids):
         list_fields += [scaleFactor, lid]
         if size == 8:
             f.write(print_card_8(list_fields))
         else:
             f.write(print_card_16(list_fields))
开发者ID:umvarma,项目名称:pynastran,代码行数:11,代码来源:load.py


注:本文中的pyNastran.bdf.fieldWriter16.print_card_16函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。