簡體   English   中英

Abaqus/Python 禁止警告

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM