Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Python scripting for inserting Cohesive seam in ABAQUS

HN150

Civil/Environmental
Joined
Feb 22, 2024
Messages
2
Location
JP
Hi,

I have been trying to add cohesive seam between two sections using python scripting.
After looking at the .rpy file I understood the process of adding the cohesive seam, creating the sets out of it and applying the section, as shown below:

Python:
p = mdb.models['PolygonsModel'].parts['Base']
s = p.edges
side1Edges = s.findAt(((0.205721, 0.058512, 0.0), ), ((0.204451, 0.063173,
    0.0), ), ((0.206197, 0.066779, 0.0), ), ((0.210843, 0.064586, 0.0), ), ((
    0.214843, 0.058891, 0.0), ), ((0.211022, 0.054718, 0.0), ), ((0.207876,
    0.055601, 0.0), ), ((0.206621, 0.05664, 0.0), ))
pickedEdges = regionToolset.Region(side1Edges=side1Edges)
p.insertElements(edges=pickedEdges)
#: Inserted 8 cohesive pore pressure elements by addition of 14 new nodes, of which 7 are midside nodes
p = mdb.models['PolygonsModel'].parts['Base']
e = p.elements
elements = e[2077:2085]
p.Set(elements=elements, name='CohesiveSeam-6-Elements')
p = mdb.models['PolygonsModel'].parts['Base']
f = p.elements
face3Elements = f[2077:2085]
p.Surface(face3Elements=face3Elements, name='CohesiveSeam-6-TopSurf')
p = mdb.models['PolygonsModel'].parts['Base']
f = p.elements
face1Elements = f[2077:2085]
p.Surface(face1Elements=face1Elements, name='CohesiveSeam-6-BottomSurf')
p = mdb.models['PolygonsModel'].parts['Base']
n = p.nodes
nodes = n[45:54]+n[2147:2154]
p.Set(nodes=nodes, name='CohesiveSeam-6-TopNodes')
p = mdb.models['PolygonsModel'].parts['Base']
n = p.nodes
nodes = n[45:54]+n[2147:2154]
p.Set(nodes=nodes, name='CohesiveSeam-6-BottomNodes')
p = mdb.models['PolygonsModel'].parts['Base']
n = p.nodes
nodes = n[51:53]+n[2154:2161]
p.Set(nodes=nodes, name='CohesiveSeam-6-MidNodes')
session.viewports['Viewport: 1'].partDisplay.setValues(sectionAssignments=ON,
    engineeringFeatures=ON, mesh=OFF)
session.viewports['Viewport: 1'].partDisplay.meshOptions.setValues(
    meshTechnique=OFF)
p = mdb.models['PolygonsModel'].parts['Base']
e = p.elements
elements = e[2077:2085]
region = regionToolset.Region(elements=elements)
p = mdb.models['PolygonsModel'].parts['Base']
p.SectionAssignment(region=region, sectionName='Section-MAT-ITZ', offset=0.0,
    offsetType=MIDDLE_SURFACE, offsetField='',
    thicknessAssignment=FROM_SECTION)




But while scripting, how do I get these element and node indexes to create set and then assign the section? Some times the number of elements inserted is not equal to the number of edges selected.

Can somebody help me to generalize this code or with some simple solutions?
Thanks
 

Part and Inventory Search

Sponsor

Back
Top