Abaqus/Python抑制警告

Abaqus/Python抑制警告,python,warnings,abaqus,Python,Warnings,Abaqus,下面是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.rec

下面是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脚本文档中没有看到关于警告控件的任何内容。在这里,我认为可以安全地忽略警告,因为正常意义不应该影响分区。当然,如果确实让您感到不舒服,您可以使用不同的分区方法。