首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >更改Abaqus中的默认元素类型

更改Abaqus中的默认元素类型
EN

Stack Overflow用户
提问于 2017-10-23 12:24:31
回答 1查看 836关注 0票数 1

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

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

谢谢,

R.

编辑:感谢费尔南多C.从Simulia社区,以下调整可以使用。仍然在寻找一个更好的解决方案!

雷米 我认为默认元素是硬编码的,因此我们没有可以更改的设置。 但不要绝望。您可以在创建部件/实例之后使用methodCallback自动更改它。 您可以将其放入abaqus_v6.env文件中,因此它总是这样做的。 从abaqus导入*从abaqusConstants导入* def changeDefaultElementType(callingObject,参数,keywordArguments,userData):打印‘更改默认元素类型’p=getMethodReturnValue( elemTypes=( ElemType(elemCode=C3D8I,elemLibrary=STANDARD,secondOrderAccuracy=OFF,distortionControl=DEFAULT),ElemType(elemCode=C3D6,elemLibrary=STANDARD),elemCode=C3D6(ElemType,en19#) ),((‘#1’),) methodCallback.addCallback(ModelType,'Part',changeDefaultElementType,callAfter=True) 这个例子有点粗糙,您可能需要对其进行更多的润色(例如,只为3d部件更改元素类型,等等)。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-10-24 09:33:35

可以在Abaqus/CAE 2018中更改默认元素类型。

同时,可以将以下函数添加到custom_v6.env中。(C:\程序文件\#en0# Systemes\SimulationServices\V6R2017x\Abaqus\win_b64\SMA\site\custom_v6.env)

代码语言:javascript
运行
复制
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)
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/46889296

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档