0

I am trying to print the connectivity matrix for specific element sets. I know how to do this using probe value in abaqus/viewer and probe value. Unfortunately, the probe value function does not record anything on the report file. Does any one know how to print connectivity matrix for specific element sets using writeFieldReport? I am looking for an out put like this

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

    309         310         198         197

Thanks

amirKabir
  • 143
  • 2
  • 15

2 Answers2

1

This script will export node connectivity info from an assembly level element set. Just set the user variables as indicated in the script below and it'll export a text file in the same directory as the 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")
DougR
  • 3,196
  • 1
  • 28
  • 29
1

This is the final script that worked for me very well:

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")   
amirKabir
  • 143
  • 2
  • 15