【发布时间】:2018-03-03 22:19:51
【问题描述】:
这是 abaqus/python 的一个最小示例,它创建一个长方体和分区
from abaqus import *
from abaqusConstants import *
import __main__
model=mdb.models['Model-1']
# Sketch
s = model.ConstrainedSketch(name='__profile__', sheetSize=10.0)
s.setPrimaryObject(option=STANDALONE)
s.rectangle(point1=(0.0, 0.0), point2=(5.0, 5.0))
# Part
p = model.Part(name='Part-1', dimensionality=THREE_D, type=DEFORMABLE_BODY)
p.BaseSolidExtrude(sketch=s, depth=0.1)
s.unsetPrimaryObject()
session.viewports['Viewport: 1'].setValues(displayedObject=p)
del model.sketches['__profile__']
# Partition
c = p.cells
pickedCells = c.findAt(((0., 0., 0.), ))
e = p.edges
p.PartitionCellByPlanePointNormal(normal=e.findAt(coordinates=(2.5, 0.0,
0.0)), cells=pickedCells, point=p.InterestingPoint(edge=e.findAt(
coordinates=(2.5, 0.0, 0.0)), rule=MIDDLE))
p.PartitionCellByPlanePointNormal(normal=e.findAt(coordinates=(0.0, 2.5,
0.0)), cells=pickedCells, point=p.InterestingPoint(edge=e.findAt(
coordinates=(0.0, 2.5, 0.0)), rule=MIDDLE))
执行此操作时,每个分区都会出现以下警告:
警告:给定的边缘指示点位于边缘的中心。 对于某些特征操作,隐含的边缘感觉会很模糊。
我怎样才能抑制这个警告或让它只出现一次?都没有
import warnings
warnings.filterwarnings('once',
'.*The given edge indicative point is at the center of the edge.*',)
有效,也不
warnings.filterwarnings('ignore')
【问题讨论】:
-
不错,他们没有使用标准的 python 警告系统。我在 abaqus 脚本文档中没有看到任何内容:警告控制。在这里,我认为可以安全地忽略该警告,因为正常意义不应影响分区。如果它真的让你烦恼,你当然可以使用不同的分区方法。