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


Python FFI.rebuild方法代码示例

本文整理汇总了Python中ffi.FFI.rebuild方法的典型用法代码示例。如果您正苦于以下问题:Python FFI.rebuild方法的具体用法?Python FFI.rebuild怎么用?Python FFI.rebuild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ffi.FFI的用法示例。


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

示例1: ImpConf

# 需要导入模块: from ffi import FFI [as 别名]
# 或者: from ffi.FFI import rebuild [as 别名]

#.........这里部分代码省略.........
        """Adds Fiber Fraction Imperfection (FFI)

        There can be only one of these, so calling this function overrides the
        previous imperfection, if any.

        Parameters
        ----------
        nominal_vf : float
            Nominal fiber volume fraction of the material
        E_matrix : float
            Young's modulus of the matrix material
        nu_matrix : float
            Poisson's ratio of the matrix material
        use_ti : bool
            If ``True``, create varying material properties according to the
            thickness imperfection data (if present).
        global_sf : float or ``None``
            Global scaling factor to apply to the material thickness.
            Set to ``None`` to disable. The global scaling may be overridden
            by a thickness imperfection, if ``use_ti`` (see above) is ``True``.

        Returns
        -------
        ffi : :class:`.FFI` object.

        """
        if self.ffi is not None:
            warn('FFI object already set, overriding...')
        self.ffi = FFI(nominal_vf, E_matrix, nu_matrix, use_ti, global_sf)
        self.ffi.impconf = self
        return self.ffi


    def rebuild(self):
        # TODO: Reduce the amount of code duplication?
        self.imperfections = []
        i = -1
        # uneven bottom edge
        ube = self.uneven_bottom_edge
        i += 1
        ube.index = i
        ube.rebuild()
        self.imperfections.append(ube)
        # uneven top edge
        ute = self.uneven_top_edge
        i += 1
        ute.index = i
        ute.rebuild()
        self.imperfections.append(ute)
        # ploads
        for pload in self.ploads:
            i += 1
            pload.index = i
            pload.rebuild()
            self.imperfections.append(pload)
        # dimples
        for sb in self.dimples:
            i += 1
            sb.index = i
            sb.rebuild()
            self.imperfections.append(sb)
        # axisymmetrics
        for ax in self.axisymmetrics:
            i += 1
            ax.index = i
            ax.rebuild()
开发者ID:saullocastro,项目名称:desicos,代码行数:70,代码来源:impconf.py


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