Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby-on-rails-4/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何使用writeFieldReport打印abaqus python矩阵中的连接性_Python_Abaqus - Fatal编程技术网

如何使用writeFieldReport打印abaqus python矩阵中的连接性

如何使用writeFieldReport打印abaqus python矩阵中的连接性,python,abaqus,Python,Abaqus,我正在尝试打印特定元素集的连接矩阵。 我知道如何使用abaqus/viewer中的探测值和探测值执行此操作。 不幸的是,probe value函数没有在报告文件中记录任何内容。 有人知道如何使用打印特定元素集的连接矩阵吗 书面报告? 我正在寻找一个像这样的出局 Part Instance Element ID Type Attached nodes ---------------------------------------------------------------

我正在尝试打印特定元素集的连接矩阵。 我知道如何使用abaqus/viewer中的探测值和探测值执行此操作。 不幸的是,probe value函数没有在报告文件中记录任何内容。 有人知道如何使用打印特定元素集的连接矩阵吗 书面报告? 我正在寻找一个像这样的出局

  Part Instance  Element ID        Type  Attached nodes
--------------------------------------------------------------------------------
    PART-1-1         167        C3D8        3309        3310        3198        3197 

    309         310         198         197

谢谢

此脚本将从程序集级元素集中导出节点连接信息。只需按照下面的脚本中所示设置用户变量,它就会在odb所在的目录中导出一个文本文件

from abaqusConstants import *
from viewerModules import *
import os

# User variables ------------------
elementSetName='fix'
outPutFileName='tmp.txt'
# ---------------------------------

currView=session.viewports[session.currentViewportName]
cOdbD=currView.odbDisplay
odb = session.odbs[cOdbD.name]
odbRootA=odb.rootAssembly

directory=os.path.split(odb.path)[0]

with open(os.path.join(directory,outPutFileName),"w") as f:  

    f.write("%s\n" % ('  Part Instance  Element ID        Type  Attached nodes'))
    f.write("%s\n" % ('--------------------------------------------------------------------------------'))   

    for element in odbRootA.elementSets[elementSetName.upper()].elements[0]: 

        f.write("%s" % ('    ' + element.instanceName + '         ' + str(element.label) + '        ' + element.type))

        nodeNum=0
        for node in element.connectivity:
            nodeNum+=1
            if nodeNum>4:
                f.write("\n%s\n" % (''))
                nodeNum=-4

            f.write("%s" % ('        ' + str(node)))
        f.write("\n")
        f.write("\n")

此脚本将从程序集级元素集中导出节点连接信息。只需按照下面的脚本中所示设置用户变量,它就会在odb所在的目录中导出一个文本文件

from abaqusConstants import *
from viewerModules import *
import os

# User variables ------------------
elementSetName='fix'
outPutFileName='tmp.txt'
# ---------------------------------

currView=session.viewports[session.currentViewportName]
cOdbD=currView.odbDisplay
odb = session.odbs[cOdbD.name]
odbRootA=odb.rootAssembly

directory=os.path.split(odb.path)[0]

with open(os.path.join(directory,outPutFileName),"w") as f:  

    f.write("%s\n" % ('  Part Instance  Element ID        Type  Attached nodes'))
    f.write("%s\n" % ('--------------------------------------------------------------------------------'))   

    for element in odbRootA.elementSets[elementSetName.upper()].elements[0]: 

        f.write("%s" % ('    ' + element.instanceName + '         ' + str(element.label) + '        ' + element.type))

        nodeNum=0
        for node in element.connectivity:
            nodeNum+=1
            if nodeNum>4:
                f.write("\n%s\n" % (''))
                nodeNum=-4

            f.write("%s" % ('        ' + str(node)))
        f.write("\n")
        f.write("\n")

这是对我非常有效的最后一个脚本:

from abaqusConstants import *
from viewerModules import *
import os

# User variables ------------------
elementSetName='fix'
outPutFileName='tmp.txt'
# ---------------------------------

odb = session.openOdb(name='job.odb')
odbRootA=odb.rootAssembly

directory=os.path.split(odb.path)[0]

with open(os.path.join(directory,outPutFileName),"w") as f:  

    f.write("%s\n" % ('Element ID        Type  Attached nodes'))
    f.write("%s\n" % ('--------------------------------------------------------------------------------'))   

    for element in odbRootA.instances['PART-1-1'].elementSets[elementSetName].elements: 

        f.write("%s" % (str(element.label) + '        ' + element.type+ '        ' ))
        f.write(str(element.connectivity))
        f.write("\n")   

这是对我非常有效的最后一个脚本:

from abaqusConstants import *
from viewerModules import *
import os

# User variables ------------------
elementSetName='fix'
outPutFileName='tmp.txt'
# ---------------------------------

odb = session.openOdb(name='job.odb')
odbRootA=odb.rootAssembly

directory=os.path.split(odb.path)[0]

with open(os.path.join(directory,outPutFileName),"w") as f:  

    f.write("%s\n" % ('Element ID        Type  Attached nodes'))
    f.write("%s\n" % ('--------------------------------------------------------------------------------'))   

    for element in odbRootA.instances['PART-1-1'].elementSets[elementSetName].elements: 

        f.write("%s" % (str(element.label) + '        ' + element.type+ '        ' ))
        f.write(str(element.connectivity))
        f.write("\n")