本文整理汇总了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()