在 Abaqus 中更改默认元素类型
Changing default element type in Abaqus
Abaqus 选择的默认元素是 C3D8R,我想将其更改为 C3D8I。 我知道如何在 CAE 中更改元素类型,甚至使用 Python 递归更改,但不知道默认值。
问题是当我分区和重新网格化时,我之前的选择被覆盖并生成默认的 C3D8R。
谢谢,
R.
编辑: 感谢来自 Simulia 社区的 Fernando C.,可以使用以下调整。仍在寻找更好的解决方案!
Remy,
I think the default element is hard-coded and so we don't have a setting that you can change.
But don't despair. You can use methodCallback to change it automatically after the part/instance is created.
You can put this in an abaqus_v6.env file so it is always doing that.
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)
The example is a little rough, you might want to polish it a little more (For example changing the element type only for 3d parts, etc).
更改默认元素类型将在 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)