• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python field_writer_double.print_card_double函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: write_card

    def write_card(self, size=8, is_double=False):
        msg = '\n$' + '-' * 80
        msg += '\n$ %s Matrix %s\n' % ('DMI', self.name)
        list_fields = ['DMI', self.name, 0, self.form, self.tin,
                       self.tout, None, self.nRows, self.nCols]
        if size == 8:
            msg += print_card_8(list_fields)
        #elif is_double:
            #msg += print_card_double(list_fields)
        else:
            msg += print_card_16(list_fields)
        #msg += self.print_card(list_fields,size=16,isD=False)

        if self.is_complex():
            for (gci, gcj, reali, imagi) in zip(self.GCi, self.GCj, self.Real, self.Complex):
                list_fields = ['DMI', self.name, gcj, gci, reali, imagi]
                if size == 8:
                    msg += print_card_8(list_fields)
                elif is_double:
                    msg += print_card_double(list_fields)
                else:
                    msg += print_card_16(list_fields)
        else:
            for (gci, gcj, reali) in zip(self.GCi, self.GCj, self.Real):
                list_fields = ['DMI', self.name, gcj, gci, reali]
                if size == 8:
                    msg += print_card_8(list_fields)
                elif is_double:
                    msg += print_card_double(list_fields)
                else:
                    msg += print_card_16(list_fields)
        return msg
开发者ID:ClaesFredo,项目名称:pyNastran,代码行数:32,代码来源:dmig.py


示例2: write_card

    def write_card(self, size=8, is_double=False):
        """
        .. todo:: support double precision
        """
        msg = '\n$' + '-' * 80
        msg += '\n$ %s Matrix %s\n' % (self.type, self.name)
        list_fields = [self.type, self.name, 0, self.ifo, self.tin,
                       self.tout, self.polar, None, self.ncols]
        if size == 8:
            msg += print_card_8(list_fields)
        else:
            msg += print_card_16(list_fields)

        if self.is_complex():
            if self.is_polar():
                for (GCi, GCj, reali, complexi) in zip(self.GCi, self.GCj, self.Real, self.Complex):
                    magi = sqrt(reali**2 + complexi**2)
                    if reali == 0.0:
                        phasei = 0.0
                    else:
                        phasei = degrees(atan2(complexi, reali))
                    list_fields = [self.type, self.name, GCj[0], GCj[1],
                                   None, GCi[0], GCi[1], magi, phasei]
                    if size == 8:
                        msg += print_card_8(list_fields)
                    elif is_double:
                        msg += print_card_double(list_fields)
                    else:
                        msg += print_card_16(list_fields)
            else:
                for (GCi, GCj, reali, complexi) in zip(self.GCi, self.GCj, self.Real, self.Complex):
                    list_fields = [self.type, self.name, GCj[0], GCj[1],
                                   None, GCi[0], GCi[1], reali, complexi]
                    if size == 8:
                        msg += print_card_8(list_fields)
                    elif is_double:
                        msg += print_card_double(list_fields)
                    else:
                        msg += print_card_16(list_fields)
        else:
            for (GCi, GCj, reali) in zip(self.GCi, self.GCj, self.Real):
                list_fields = [self.type, self.name, GCj[0], GCj[1],
                               None, GCi[0], GCi[1], reali, None]
                if size == 8:
                    msg += print_card_8(list_fields)
                elif is_double:
                    msg += print_card_double(list_fields)
                else:
                    msg += print_card_16(list_fields)
        return msg
开发者ID:FrankNaets,项目名称:pyNastran,代码行数:50,代码来源:dmig.py


示例3: write_card

 def write_card(self, size=8, is_double=False):
     card = self.raw_fields()
     if size == 8:
         return self.comment + print_card_8(card)
     if is_double:
         return self.comment + print_card_double(card)
     return self.comment + print_card_16(card)
开发者ID:saullocastro,项目名称:pyNastran,代码行数:7,代码来源:loads.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: print_card

def print_card(fields, size=8, is_double=False):
    """
    Prints a card in 8-character of 16-character Nastran format.

    Parameters
    ----------
    fields : List[int/float/str/None]
        all the fields in the BDF card (no trailing Nones)
    size : int; default=8
        the size of the field (8/16)
    is_double : bool; default=False
        is the card double precision?
        Double precision applies to specific cards and turns
        1.234E+5 into 1.234D+5.  Applies to GRID, CORDx only?

    Returns
    -------
    card : str
        string representation of the card

    .. note:: be careful of using is_double on cards that aren't
              GRID or CORDx
    """
    if size == 8:
        return print_card_8(fields)
    elif is_double:
        return print_card_double(fields)
    return print_card_16(fields)
开发者ID:EmanueleCannizzaro,项目名称:pyNastran,代码行数:28,代码来源:field_writer.py


示例6: 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


示例7: test_card_double

    def test_card_double(self):
        card = print_card_double(['GRID', 1, None, 120.322,-4.82872,1.13362])
        card_expected = 'GRID*                  1                1.2032200000D+02-4.828720000D+00\n'
        card_expected += '*       1.1336200000D+00\n'
        self.assertEqual(card, card_expected)

        #card = print_card_double(['CHEXA', 1, 2, 2, 3, 4, 1, 8, 5,
                                           #6, 7])
        #card_expected = ''
        #card_expected += 'CHEXA*                 1               2               2               3\n'
        #card_expected +='*                      4               1               8               5\n'
        #card_expected +='*                      6               7\n'
        #card_expected += '*       1.1336200000D+00\n'

        #card = print_card_double(['CTETRA',6437,1,14533,5598,1577,9976,42364,5599,42365,42363,30022,12904])
        #card_expected = ''

        #card_expected += 'CTETRA*             6437               1           14533            5598\n'
        #card_expected += '*                   1577            9976           42364            5599\n'
        #card_expected += '*                  42365           42363           30022           12904\n'
        #card_expected += '*       \n'

        #card_expected +='CTETRA*  6437            1               14533           5598\n'
        #card_expected +='*        1577            9976            42364           5599\n'
        #card_expected +='*        42365           42363           30022           12904\n'
        #card_expected +='*       \n'
        #self.assertEqual(card, card_expected)

        #=============================
        #                            mid   E1      E2      nu12 G12      G1z      G2z      rho
        card = print_card_8(['MAT8', 6,    1.7e+7, 1.7e+7, .98, 340000., 180000., 180000., .0001712,
        #                            a1    a2    TRef
                                     None, 71.33])
        card_expected = ''
        card_expected += 'MAT8           6   1.7+7   1.7+7     .98 340000. 180000. 180000..0001712\n'
        card_expected += '                   71.33\n'
        self.assertEqual(card, card_expected)


        card = print_card_16(['MAT8', 6,    1.7e+7, 1.7e+7, .98, 340000., 180000., 180000., .0001712,
        #                            a1    a2    TRef
                                     None, 71.33])

        card_expected = ''
        card_expected += 'MAT8*                  6       17000000.       17000000.             .98\n'
        card_expected += '*                340000.         180000.         180000.        .0001712\n'
        card_expected += '*                                  71.33\n'
        card_expected += '*\n'
        # bad
        self.assertEqual(card, card_expected)
开发者ID:sukhbinder,项目名称:cyNastran,代码行数:50,代码来源:test_field_writer.py


示例8: write_card

    def write_card(self, size=8, is_double=False):
        """
        The writer method used by BDF.write_card

        Parameters
        ----------
        size : int
            the size of the card (8/16)
        """
        card = self.repr_fields()
        if size == 8:
            return self.comment + print_card_8(card)
        if is_double:
            return self.comment + print_card_double(card)
        return self.comment + print_card_16(card)
开发者ID:hurlei,项目名称:pyNastran,代码行数:15,代码来源:nodes.py


示例9: write_card

    def write_card(self, size=8, is_double=False):
        """
        The writer method used by BDF.write_card

        :param self:
          the GRID object pointer
        :param size:
          the size of the card (8/16)
        :type size:
          int
        """
        card = self.repr_fields()
        if size == 8:
            return self.comment + print_card_8(card)
        if is_double:
            return self.comment + print_card_double(card)
        return self.comment + print_card_16(card)
开发者ID:ClaesFredo,项目名称:pyNastran,代码行数:17,代码来源:nodes.py


示例10: print_card

def print_card(fields, size=8, is_double=False):
    """
    Prints a card in 8-character of 16-character Nastran format.

    :param fields:    all the fields in the BDF card (no trailing Nones)
    :param size:      8/16
    :param is_double: True/False
    :returns card: string representation of the card

    .. note:: be careful of using is_double on cards that aren't
              GRID or COORDx
    """
    if size == 8:
        return print_card_8(fields)
    elif is_double:
        return print_card_double(fields)
    return print_card_16(fields)
开发者ID:ClaesFredo,项目名称:pyNastran,代码行数:17,代码来源:fieldWriter.py


示例11: write_card

 def write_card(self, bdf_file, size=True, is_double=False):
     if self.n:
         if size == 8:
             for j, eid, alpha in zip(count(), self.element_id, self.alpha):
                 salpha = set_blank_if_default(alpha, 0.0)
                 list_fields = ["RBE2", eid] + [salpha]
                 bdf_file.write(print_card_8(list_fields))
         elif is_double:
             for j, eid, gn, cm, alpha in zip(count(), self.element_id, self.gn, self.cm, self.alpha):
                 gmi = self.gmi[j]
                 salpha = set_blank_if_default(alpha, 0.0)
                 list_fields = ["RBE2", eid, gn, cm] + gmi + [salpha]
                 bdf_file.write(print_card_16(list_fields))
         else:
             for j, eid, gn, cm, alpha in zip(count(), self.element_id, self.gn, self.cm, self.alpha):
                 gmi = self.gmi[j]
                 salpha = set_blank_if_default(alpha, 0.0)
                 list_fields = ["RBE2", eid, gn, cm] + gmi + [salpha]
                 bdf_file.write(print_card_double(list_fields))
开发者ID:hurlei,项目名称:pyNastran,代码行数:19,代码来源:rbe3.py


示例12: write_card

 def write_card(self, f, size, is_double):
     if self.n == 0:
         return
     if size == 8:
         for j, eid, gn, cm, alpha in zip(count(), self.element_id, self.gn, self.cm, self.alpha):
             gmi = self.gmi[j]
             salpha = set_blank_if_default(alpha, 0.)
             list_fields = ['RBE2', eid, gn, cm] + gmi + [salpha]
             f.write(print_card_8(list_fields))
     elif is_double:
         for j, eid, gn, cm, alpha in zip(count(), self.element_id, self.gn, self.cm, self.alpha):
             gmi = self.gmi[j]
             salpha = set_blank_if_default(alpha, 0.)
             list_fields = ['RBE2', eid, gn, cm] + gmi + [salpha]
             f.write(print_card_16(list_fields))
     else:
         for j, eid, gn, cm, alpha in zip(count(), self.element_id, self.gn, self.cm, self.alpha):
             gmi = self.gmi[j]
             salpha = set_blank_if_default(alpha, 0.)
             list_fields = ['RBE2', eid, gn, cm] + gmi + [salpha]
             f.write(print_card_double(list_fields))
开发者ID:marcinch18,项目名称:pyNastran,代码行数:21,代码来源:rbe2.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python f06_formatting._eigenvalue_header函数代码示例发布时间:2022-05-25
下一篇:
Python field_writer_8.set_blank_if_default函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap