[英]Abaqus/Python suppress warning
这是 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')
不要使用“p.InterestingPoint”命令。 如果直接用作顶点 ID 会更好。 您当前收到警告,这意味着相关兴趣点没有顶点。 您可以尝试创建一个平面然后将其切断。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.