更改Abaqus中的默认元素类型



Abaqus选择的默认元素是C3D8R,我想将其更改为C3D8I。我知道如何在CAE中更改元素类型,甚至递归地使用Python,但不知道默认值。

问题是,当我分区并重新网格时,我以前的选择会被覆盖,并生成默认的C3D8R。

谢谢,

R。

编辑:多亏了Simulia社区的Fernando C.,可以使用以下调整。尽管如此,仍在寻找更好的解决方案!

Remy,

我认为默认元素是硬编码的,所以我们没有可以更改的设置。

但不要绝望。您可以使用methodCallback在创建零件/实例后自动更改它。

你可以把它放在一个abaqus_v6.env文件中,这样它就会一直这样做。

import methodCallback
from abaqus import *
from abaqusConstants import *
def changeDefaultElementType(callingObject, arguments, keywordArguments, userData):
print 'Changing the default element type'
p = getMethodReturnValue()
p.setElementType(
elemTypes=(
ElemType(elemCode=C3D8I, elemLibrary=STANDARD, secondOrderAccuracy=OFF, distortionControl=DEFAULT),
ElemType(elemCode=C3D6, elemLibrary=STANDARD),
ElemType(elemCode=C3D4, elemLibrary=STANDARD)
),
regions=(p.cells.getSequenceFromMask(('[#1 ]', ), ), )
)
methodCallback.addCallback(ModelType, 'Part', changeDefaultElementType, callAfter=True)

这个例子有点粗糙,你可能想把它打磨一下更多(例如,仅更改三维零件的元素类型等)。

更改默认元素类型将在Abaqus/CAE 2018中提供。

同时,以下函数可以添加到custom_v6.env中。(C:\Program Files\Dassault Systemes\SimulationServices\V6R2017x\Abaqus\win_b64\SMA\site\custom_v6.env)

def onCaeStartup():
import methodCallback
from mesh import ElemType
from job import ModelJobType
## Function to be called when an input file is written
def checkElementType(callingObject, arguments, keywordArguments, userData):
print 'Checking element types in the model'
# Get the name of the job from the command
a = str(callingObject).split("jobs['")[1]
job = a.split("']")[0]
model = mdb.jobs[job].model
ra    = mdb.models[model].rootAssembly
# Query the Element Types in the assembly and display them
elemType=[]
for instance in ra.instances.keys():    
for cell in ra.instances[instance].cells:
if ra.getElementType(region=cell,elemShape=HEX).elemCode not in elemType:
elemType.append(ra.getElementType(region=cell,elemShape=HEX).elemCode)
print 'INSTANCE: '+instance +' = '+ ra.getElementType(region=cell,elemShape=HEX).elemCode
# Define the callback. When the writeInput method is called on a ModelJobType object, the function checkElementType is executed.                
methodCallback.addCallback(ModelJobType, 'writeInput', checkElementType)

相关内容

最新更新