# # Example Problems manual # 1.2.3 Buckling of a column with spot welds # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ from abaqus import * from abaqusConstants import * from connectorBehavior import * from mesh import * import mesh, regionToolset,connectorBehavior columnModel = mdb.Model('column') # Define Material # ~~~~~~~~~~~~~~~ columnModel.Material(name='STEEL') columnModel.materials['STEEL'].setValues(description='') columnModel.materials['STEEL'].Elastic(dependencies=0, moduli= LONG_TERM, noCompression=OFF, noTension=OFF, table=((206800000000.0, 0.3), ), temperatureDependency=OFF, type=ISOTROPIC) columnModel.materials['STEEL'].Density(dependencies=0, table=((7850.0, ), ), temperatureDependency=OFF) columnModel.materials['STEEL'].Plastic(dataType=HALF_CYCLE, dependencies=0, hardening=ISOTROPIC, numBackstresses=1, rate=OFF, strainRangeDependency=OFF, table=((170000000.0, 0.0), (180000000.0, 0.0017205942), (190000000.0, 0.0038296832), (200000000.0, 0.0063897874), ( 210000000.0, 0.0094694765), (220000000.0, 0.01314366), (230000000.0, 0.017493792), (240000000.0, 0.022608092), (250000000.0, 0.028581845), ( 260000000.0, 0.035517555), (270000000.0, 0.043525275), (280000000.0, 0.052722659), (290000000.0, 0.063235357), (300000000.0, 0.075197279), ( 310000000.0, 0.088750519), (320000000.0, 0.1040458), (330000000.0, 0.121243), (340000000.0, 0.1405106), (350000000.0, 0.1620263), ( 360000000.0, 0.1859779), (370000000.0, 0.212562), (380000000.0, 0.2419857), (390000000.0, 0.274466), (400000000.0, 0.3102303), (410000000.0, 0.349516), (420000000.0, 0.392572), (430000000.0, 0.4396578), (440000000.0, 0.4910434), (450000000.0, 0.5470111), (460000000.0, 0.6078544), ( 470000000.0, 0.6738777), (480000000.0, 0.7453985), (490000000.0, 0.8227461), (500000000.0, 0.906261), (510000000.0, 0.996298)), temperatureDependency=OFF) columnModel.materials['STEEL'].setValues(materialIdentifier='') # Define Sections for the pillars # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ columnModel.HomogeneousShellSection(idealization=NO_IDEALIZATION, integrationRule=GAUSS, material='STEEL', name='WPillar', nodalThicknessField='', numIntPts=3, poissonDefinition=DEFAULT, preIntegrate=OFF, temperature=GRADIENT, thickness=0.002, thicknessField='', thicknessModulus=None, thicknessType=UNIFORM, useDensity=OFF) columnModel.HomogeneousShellSection(idealization=NO_IDEALIZATION, integrationRule=GAUSS, material='STEEL', name='BoxPillar', nodalThicknessField='', numIntPts=3, poissonDefinition=DEFAULT, preIntegrate=OFF, temperature=GRADIENT, thickness=0.003, thicknessField='', thicknessModulus=None, thicknessType=UNIFORM, useDensity=OFF) # Define sweep path sketch # ~~~~~~~~~~~~~~~~~~~~~~~~ sweepSketch = columnModel.ConstrainedSketch(name='Sketch-1', sheetSize=200.0) sweepSketch.Arc3Points(point1=(0.025, 0.0), point2=(0.136255, 0.400407), point3=(0.055, 0.2)) sweepSketch.move(objectList=( columnModel.sketches['Sketch-1'].geometry[2], ), vector=( -0.025, 0.0)) # Box-Column pillar #~~~~~~~~~~~~~~~~~~ columnModel.ConstrainedSketch(name='__sweep__', sheetSize=200.0) columnModel.sketches['__sweep__'].sketchOptions.setValues(gridOrigin=( 0.0806274982169271, 0.200203493237495)) columnModel.sketches['__sweep__'].retrieveSketch(sketch= columnModel.sketches['Sketch-1']) boxSketch = columnModel.ConstrainedSketch(name='Box-sketch', sheetSize=1.0, transform=(0.999397579669656, -0.0347055867323171, 0.0, -0.0, 0.0, 1.0, -0.0347055867323171, -0.999397579669656, -0.0, 0.025, 2.08166817117217e-17, 0.0)) boxSketch.ConstructionLine(point1=(-0.5, 0.0) , point2=(0.5, 0.0)) boxSketch.ConstructionLine(point1=(0.0, -0.5) , point2=(0.0, 0.5)) boxSketch.Line(point1=(-0.06, 0.05), point2=( -0.06, 0.0595435723662376)) boxSketch.VerticalConstraint(entity= boxSketch.geometry[4]) boxSketch.Line(point1=(-0.06, 0.0595435723662376), point2=(0.0, 0.0595435723662376)) boxSketch.HorizontalConstraint(entity= boxSketch.geometry[5]) boxSketch.PerpendicularConstraint(entity1= boxSketch.geometry[4], entity2= boxSketch.geometry[5]) boxSketch.CoincidentConstraint(entity1= boxSketch.vertices[2], entity2= boxSketch.geometry[3]) boxSketch.Line(point1=(0.0, 0.0595435723662376), point2=(0.0, -0.0588174238801003)) boxSketch.VerticalConstraint(entity= boxSketch.geometry[6]) boxSketch.PerpendicularConstraint(entity1= boxSketch.geometry[5], entity2= boxSketch.geometry[6]) boxSketch.CoincidentConstraint(entity1= boxSketch.vertices[3], entity2= boxSketch.geometry[3]) boxSketch.Line(point1=(0.0, -0.0588174238801003), point2=(-0.06, -0.0588174238801003)) boxSketch.HorizontalConstraint(entity= boxSketch.geometry[7]) boxSketch.PerpendicularConstraint(entity1= boxSketch.geometry[6], entity2= boxSketch.geometry[7]) boxSketch.Line(point1=(-0.06, -0.0588174238801003), point2=(-0.06, -0.0449999999627471)) boxSketch.VerticalConstraint(entity= boxSketch.geometry[8]) boxSketch.PerpendicularConstraint(entity1= boxSketch.geometry[7], entity2= boxSketch.geometry[8]) boxSketch.EqualLengthConstraint(entity1= boxSketch.geometry[5], entity2= boxSketch.geometry[7]) boxSketch.EqualLengthConstraint(entity1= boxSketch.geometry[4], entity2= boxSketch.geometry[8]) boxSketch.autoDimension(objectList=( boxSketch.geometry[4], )) boxSketch.autoDimension(objectList=( boxSketch.geometry[7], )) boxSketch.VerticalDimension(textPoint=( 0.0503134206946239, 0.0540995076298714), value=0.122634847797454, vertex1= boxSketch.vertices[3], vertex2= boxSketch.vertices[2]) boxSketch.dimensions[0].setValues(value= 0.00475) boxSketch.dimensions[1].setValues(value= 0.022) boxSketch.dimensions[2].setValues(value= 0.019) geom, vert, dim = boxSketch.geometry, boxSketch.vertices, boxSketch.dimensions boxSketch.delete(objectList=(geom[3], )) boxSketch.ConstructionLine(point1=(-0.06, -0.0398174238801003), point2=(-0.038, -0.0588174238801003)) boxSketch.CoincidentConstraint(entity1=vert[1], entity2=geom[9]) boxSketch.CoincidentConstraint(entity1=vert[3], entity2=geom[9]) boxSketch.ConstructionLine(point1=(-0.038, -0.0398174238801003), point2=(-0.06, -0.0588174238801003)) boxSketch.CoincidentConstraint(entity1=vert[2], entity2=geom[10]) boxSketch.CoincidentConstraint(entity1=vert[4], entity2=geom[10]) boxSketch.Spot(point=(-0.049, -0.0493174238799838)) boxSketch.CoincidentConstraint(entity1=vert[6], entity2=geom[9]) boxSketch.move(vector=(0.049, 0.0493174238799838), objectList=(geom[7], geom[6], geom[5], geom[4], geom[8])) boxSketch.delete(objectList=(geom[9], geom[10], vert[6])) boxColumn = columnModel.Part(dimensionality=THREE_D, name='BoxColumn', type= DEFORMABLE_BODY) boxColumn.BaseShellSweep(path= sweepSketch, sketch=boxSketch) # W-shape pillar #~~~~~~~~~~~~~~~ wSketch = columnModel.ConstrainedSketch(name='w-shape', sheetSize=1.0) wSketch.Line(point1=(0.0, -0.08), point2=( 0.1, -0.08)) wSketch.HorizontalConstraint(entity= wSketch.geometry[2]) wSketch.Line(point1=(0.1, -0.08), point2=( 0.1, -0.02)) wSketch.VerticalConstraint(entity= wSketch.geometry[3]) wSketch.PerpendicularConstraint(entity1= wSketch.geometry[2], entity2= wSketch.geometry[3]) wSketch.Line(point1=(0.1, -0.02), point2=( 0.0, -0.02)) wSketch.HorizontalConstraint(entity= wSketch.geometry[4]) wSketch.PerpendicularConstraint(entity1= wSketch.geometry[3], entity2= wSketch.geometry[4]) wSketch.Line(point1=(0.0, -0.02), point2=( 0.0, 0.06)) wSketch.VerticalConstraint(entity= wSketch.geometry[5]) wSketch.PerpendicularConstraint(entity1= wSketch.geometry[4], entity2= wSketch.geometry[5]) wSketch.Line(point1=(0.0, 0.06), point2=( 0.1, 0.06)) wSketch.HorizontalConstraint(entity= wSketch.geometry[6]) wSketch.PerpendicularConstraint(entity1= wSketch.geometry[5], entity2= wSketch.geometry[6]) wSketch.Line(point1=(0.1, 0.06), point2=( 0.1, 0.12)) wSketch.VerticalConstraint(entity= wSketch.geometry[7]) wSketch.PerpendicularConstraint(entity1= wSketch.geometry[6], entity2= wSketch.geometry[7]) wSketch.Line(point1=(0.1, 0.12), point2=( 0.0, 0.12)) wSketch.HorizontalConstraint(entity= wSketch.geometry[8]) wSketch.PerpendicularConstraint(entity1= wSketch.geometry[7], entity2= wSketch.geometry[8]) wSketch.EqualLengthConstraint(entity1= wSketch.geometry[2], entity2= wSketch.geometry[4]) wSketch.EqualLengthConstraint(entity1= wSketch.geometry[4], entity2= wSketch.geometry[3]) wSketch.EqualLengthConstraint(entity1= wSketch.geometry[3], entity2= wSketch.geometry[6]) wSketch.EqualLengthConstraint(entity1= wSketch.geometry[6], entity2= wSketch.geometry[7]) wSketch.EqualLengthConstraint(entity1= wSketch.geometry[7], entity2= wSketch.geometry[8]) wSketch.autoDimension(objectList=( wSketch.geometry[3], )) wSketch.autoDimension(objectList=( wSketch.geometry[5], )) wSketch.dimensions[0].setValues(value=0.02) wSketch.dimensions[1].setValues(value=0.025) wSketch.sketchOptions.setValues( decimalPlaces=3) geom, vert, dim = wSketch.geometry, wSketch.vertices, wSketch.dimensions wSketch.ConstructionLine(point1=(0.08, 0.065), point2=(0.1, 0.0)) wSketch.CoincidentConstraint(entity1=vert[7], entity2=geom[9]) wSketch.CoincidentConstraint(entity1=vert[1], entity2=geom[9]) wSketch.ConstructionLine(point1=(0.1, 0.065), point2=(0.08, 0.0)) wSketch.CoincidentConstraint(entity1=vert[6], entity2=geom[10]) wSketch.CoincidentConstraint(entity1=vert[0], entity2=geom[10]) wSketch.Spot(point=(0.09, 0.0325000000029831)) wSketch.CoincidentConstraint(entity1=vert[8], entity2=geom[9]) wSketch.move(vector=(-0.09, -0.0325000000027251), objectList=(geom[2], geom[3], geom[4], geom[5], geom[6], geom[7], geom[8], geom[9], geom[10], vert[8])) wSketch.delete(objectList=(geom[9], geom[10], vert[8])) wColumn = columnModel.Part(dimensionality=THREE_D, name='Wcolumn', type= DEFORMABLE_BODY) wColumn.BaseShellSweep(path=sweepSketch, sketch=wSketch) # Create Rigid box # ~~~~~~~~~~~~~~~~ rigidBoxSketch = columnModel.ConstrainedSketch(name='rigidBoxSketch', sheetSize=1.0) rigidBoxSketch.sketchOptions.setValues( gridOrigin=(-0.0205099563193547, -0.045484090546767)) rigidBoxSketch.retrieveSketch(sketch= boxSketch) rigidRoofBox = columnModel.Part(dimensionality=THREE_D, name='RigidRoofBox', type= DISCRETE_RIGID_SURFACE) rigidRoofBox.BaseShellExtrude(depth=0.009073, sketch= rigidBoxSketch) rigidWSketch = columnModel.ConstrainedSketch(name='rigidWSketch', sheetSize=1.0) rigidWSketch.sketchOptions.setValues( gridOrigin=(0.0233333333333332, 0.0324999988079071)) rigidWSketch.retrieveSketch(sketch=columnModel.sketches['w-shape']) rigidRoofW = columnModel.Part(dimensionality=THREE_D, name='RigidRoofW', type= DISCRETE_RIGID_SURFACE) rigidRoofW.BaseShellExtrude(depth=0.009073,sketch=columnModel.sketches['rigidWSketch']) rigidRoofW.features['Shell extrude-1'].setValues(depth=0.009171) rigidRoofW.regenerate() # =========================================================================== # Adding this code to regenerate all the four parts # =========================================================================== # 1. Regenerate part BoxColumn p = mdb.models['column'].parts['BoxColumn'] session.viewports['Viewport: 1'].setValues(displayedObject=p) s = p.features['Shell sweep-1'].sketch mdb.models['column'].ConstrainedSketch(name='__edit__', objectToCopy=s) s2 = mdb.models['column'].sketches['__edit__'] g, v, d, c = s2.geometry, s2.vertices, s2.dimensions, s2.constraints s2.setPrimaryObject(option=SUPERIMPOSE) p.projectReferencesOntoSketch(sketch=s2, upToFeature=p.features['Shell sweep-1'], filter=COPLANAR_EDGES) s2.dragEntity(entity=v[1], points=((0.027, 0.0095), (-0.01, 0.01))) s2.unsetPrimaryObject() p = mdb.models['column'].parts['BoxColumn'] p.features['Shell sweep-1'].setValues(sketch=s2) del mdb.models['column'].sketches['__edit__'] p = mdb.models['column'].parts['BoxColumn'] p.regenerate() # =========================================================================== # 2. Regenerate part RigidRoofBox p = mdb.models['column'].parts['RigidRoofBox'] session.viewports['Viewport: 1'].setValues(displayedObject=p) s = p.features['Shell extrude-1'].sketch mdb.models['column'].ConstrainedSketch(name='__edit__', objectToCopy=s) s1 = mdb.models['column'].sketches['__edit__'] g, v, d, c = s1.geometry, s1.vertices, s1.dimensions, s1.constraints s1.setPrimaryObject(option=SUPERIMPOSE) p.projectReferencesOntoSketch(sketch=s1, upToFeature=p.features['Shell extrude-1'], filter=COPLANAR_EDGES) s1.dragEntity(entity=v[1], points=((0.027, 0.0095), (-0.0105099563193547, 0.009515909453233), (-0.0105099563193547, 0.009515909453233), (-0.0105099563193547, 0.009515909453233))) s1.unsetPrimaryObject() p = mdb.models['column'].parts['RigidRoofBox'] p.features['Shell extrude-1'].setValues(sketch=s1) del mdb.models['column'].sketches['__edit__'] p = mdb.models['column'].parts['RigidRoofBox'] p.regenerate() # =========================================================================== # 3. Regenerate part RigidRoofW p = mdb.models['column'].parts['RigidRoofW'] session.viewports['Viewport: 1'].setValues(displayedObject=p) s = p.features['Shell extrude-1'].sketch mdb.models['column'].ConstrainedSketch(name='__edit__', objectToCopy=s) s1 = mdb.models['column'].sketches['__edit__'] g, v, d, c = s1.geometry, s1.vertices, s1.dimensions, s1.constraints s1.setPrimaryObject(option=SUPERIMPOSE) p.projectReferencesOntoSketch(sketch=s1, upToFeature=p.features['Shell extrude-1'], filter=COPLANAR_EDGES) s1.dragEntity(entity=v[7], points=((-0.01, -0.00750000000272511), (-0.0066666666666668, 0.0324999988079071), (-0.0066666666666668, 0.0324999988079071), (-0.00999842118471861, 0.0324999988079071))) s1.unsetPrimaryObject() p = mdb.models['column'].parts['RigidRoofW'] p.features['Shell extrude-1'].setValues(sketch=s1) del mdb.models['column'].sketches['__edit__'] p = mdb.models['column'].parts['RigidRoofW'] p.regenerate() # =========================================================================== # 4. Regenerate part Wcolumn p = mdb.models['column'].parts['Wcolumn'] session.viewports['Viewport: 1'].setValues(displayedObject=p) s = p.features['Shell sweep-1'].sketch mdb.models['column'].ConstrainedSketch(name='__edit__', objectToCopy=s) s2 = mdb.models['column'].sketches['__edit__'] g, v, d, c = s2.geometry, s2.vertices, s2.dimensions, s2.constraints s2.setPrimaryObject(option=SUPERIMPOSE) p.projectReferencesOntoSketch(sketch=s2, upToFeature=p.features['Shell sweep-1'], filter=COPLANAR_EDGES) s2.dragEntity(entity=v[7], points=((-0.01, -0.00750000000272511), (-0.01, 0.032))) s2.unsetPrimaryObject() p = mdb.models['column'].parts['Wcolumn'] p.features['Shell sweep-1'].setValues(sketch=s2) del mdb.models['column'].sketches['__edit__'] p = mdb.models['column'].parts['Wcolumn'] p.regenerate() # =========================================================================== # Mesh the rigid box pillar # ~~~~~~~~~~~~~~~~~~~~~~~~~ rigidRoofBox.setElementType(elemTypes=(ElemType( elemCode=R3D4, elemLibrary=STANDARD), ElemType(elemCode=R3D3, elemLibrary=STANDARD)), regions=( rigidRoofBox.faces.getSequenceFromMask(( '[#1f ]', ), ), )) rigidRoofBox.setMeshControls(elemShape=QUAD, regions= rigidRoofBox.faces.getSequenceFromMask(( '[#7 ]', ), ), technique=STRUCTURED) rigidRoofBox.seedEdgeByNumber(edges= rigidRoofBox.edges.getSequenceFromMask(( '[#91 ]', ), ), number=4) rigidRoofBox.seedEdgeByNumber(edges= rigidRoofBox.edges.getSequenceFromMask(( '[#2 ]', ), ), number=1) rigidRoofBox.seedEdgeByNumber(edges= rigidRoofBox.edges.getSequenceFromMask(( '[#2 ]', ), ), number=1) rigidRoofBox.seedEdgeByNumber(edges= rigidRoofBox.edges.getSequenceFromMask(( '[#20 ]', ), ), number=1) rigidRoofBox.generateMesh() # Mesh rigidW pillar # ~~~~~~~~~~~~~~~~~~ rigidRoofW.setElementType(elemTypes=(ElemType( elemCode=R3D4, elemLibrary=STANDARD), ElemType(elemCode=R3D3, elemLibrary=STANDARD)), regions=( rigidRoofW.faces.getSequenceFromMask(( '[#7f ]', ), ), )) rigidRoofW.setMeshControls(elemShape=QUAD, regions=rigidRoofW.faces.getSequenceFromMask( ('[#7f ]', ), ), technique=STRUCTURED) rigidRoofW.seedEdgeByNumber(edges= rigidRoofW.edges.getSequenceFromMask(( '[#3fffff ]', ), ), number=4) rigidRoofW.seedEdgeByNumber(edges= rigidRoofW.edges.getSequenceFromMask(( '[#12492a ]', ), ), number=1) rigidRoofW.generateMesh() # Mesh Box-column pillar # ~~~~~~~~~~~~~~~~~~~~~~ boxColumn.setMeshControls(elemShape=QUAD, regions=boxColumn.faces.getSequenceFromMask(( '[#1f ]', ), ), technique=STRUCTURED) boxColumn.setElementType(elemTypes=(ElemType( elemCode=S4R, elemLibrary=STANDARD, secondOrderAccuracy=OFF, hourglassControl=DEFAULT), ElemType(elemCode=S3, elemLibrary=STANDARD)), regions=(boxColumn.faces.getSequenceFromMask( ('[#1f ]', ), ), )) e = boxColumn.edges pickedEdges = e.getSequenceFromMask(mask=('[#492a ]', ), ) boxColumn.seedEdgeByNumber(edges=pickedEdges, number=50) boxColumn.seedEdgeByNumber(edges= boxColumn.edges.getSequenceFromMask(( '[#400 ]', ), ), number=4) boxColumn.seedEdgeByNumber(edges= boxColumn.edges.getSequenceFromMask(( '[#10 ]', ), ), number=4) boxColumn.seedEdgeByNumber(edges= boxColumn.edges.getSequenceFromMask(( '[#1040 ]', ), ), number=4) boxColumn.seedEdgeByNumber(edges= boxColumn.edges.getSequenceFromMask(( '[#a005 ]', ), ), number=1) boxColumn.seedEdgeByNumber(edges= boxColumn.edges.getSequenceFromMask(( '[#80 ]', ), ), number=4) boxColumn.seedEdgeByNumber(edges= boxColumn.edges.getSequenceFromMask(( '[#280 ]', ), ), number=4) boxColumn.generateMesh() # Mesh W-column pillar # ~~~~~~~~~~~~~~~~~~~~ wFaces = wColumn.faces wEdges = wColumn.edges pickedRegions = wFaces.getSequenceFromMask(mask=('[#7f ]', ), ) wColumn.setMeshControls(regions=pickedRegions, elemShape=QUAD, technique=STRUCTURED) pickedEdges = wEdges.getSequenceFromMask(mask=('[#12492a ]', ), ) wColumn.seedEdgeByNumber(edges=pickedEdges, number=50) pickedEdges = wEdges.getSequenceFromMask(mask=('[#2db6d5 ]', ), ) wColumn.seedEdgeByNumber(edges=pickedEdges, number=4) elemType1 = mesh.ElemType(elemCode=S4R, elemLibrary=STANDARD, secondOrderAccuracy=OFF, hourglassControl=DEFAULT) elemType2 = mesh.ElemType(elemCode=S3, elemLibrary=STANDARD) faces = wFaces.getSequenceFromMask(mask=('[#7f ]', ), ) pickedRegions =(faces, ) wColumn.setElementType(regions=pickedRegions, elemTypes=(elemType1, elemType2)) wColumn.generateMesh() # Assign sections to the parts # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ f = boxColumn.faces faces = f.getSequenceFromMask(mask=('[#1f ]', ), ) region = regionToolset.Region(faces=faces) boxColumn.SectionAssignment(region=region, sectionName='BoxPillar', offset=0.0, offsetType=MIDDLE_SURFACE, offsetField='') f = wColumn.faces faces = f.getSequenceFromMask(mask=('[#7f ]', ), ) region = regionToolset.Region(faces=faces) wColumn.SectionAssignment(region=region, sectionName='WPillar', offset=0.0, offsetType=MIDDLE_SURFACE, offsetField='') # Assembly # ~~~~~~~~ columnAssembly = columnModel.rootAssembly # Instance box pillar in the assembly # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ columnAssembly.Instance(dependent=ON, name='BoxColumn-1',part=boxColumn) # Instance W-pillar in the assembly # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ columnAssembly.Instance(dependent=ON, name='Wcolumn-1',part=wColumn) # Instance rigid Box and W pillars # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ columnAssembly.Instance(dependent=ON, name='RigidRoofW-1', part=rigidRoofW) columnAssembly.Instance(dependent=ON, name='RigidRoofBox-1', part=rigidRoofBox) # Position the instances in assembly # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ f1 = columnAssembly.instances['BoxColumn-1'].faces f2 = columnAssembly.instances['Wcolumn-1'].faces p1 = columnAssembly.instances['BoxColumn-1'] p1.translateTo(movableList=(f1[0], f1[4]), fixedList=(f2[3], ), direction=( 0.963502148612187, -0.267700596972997, 0.0), clearance=-0.003, vector=( 0.00385400689530869, -0.00107080191580087, 0.0)) # Position the rigid instances # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ f1 = columnAssembly.instances['RigidRoofW-1'].faces f2 = columnAssembly.instances['Wcolumn-1'].faces columnAssembly.ParallelFace(movablePlane=f1[6], fixedPlane=f2[6], flip=ON) e1 = columnAssembly.instances['RigidRoofW-1'].edges e2 = columnAssembly.instances['Wcolumn-1'].edges columnAssembly.EdgeToEdge(movableAxis=e1[21], fixedAxis=e2[21], flip=OFF) e1 = columnAssembly.instances['RigidRoofW-1'].edges e2 = columnAssembly.instances['Wcolumn-1'].edges columnAssembly.EdgeToEdge(movableAxis=e1[18], fixedAxis=e2[18], flip=OFF) f1 = columnAssembly.instances['RigidRoofBox-1'].faces f2 = columnAssembly.instances['Wcolumn-1'].faces columnAssembly.ParallelFace(movablePlane=f1[1], fixedPlane=f2[6], flip=OFF) e1 = columnAssembly.instances['RigidRoofBox-1'].edges e2 = columnAssembly.instances['BoxColumn-1'].edges columnAssembly.EdgeToEdge(movableAxis=e1[6], fixedAxis=e2[6], flip=OFF) columnAssembly.translate(instanceList=('RigidRoofBox-1', ), vector=(0.003714, -0.000129, 0.0)) a = mdb.models['column'].rootAssembly a.translate(instanceList=('RigidRoofBox-1', ), vector=(0.000511, -1.8e-05, 0.0)) # Merge Rigid instances # ~~~~~~~~~~~~~~~~~~~~~ columnAssembly.InstanceFromBooleanMerge(name='RigidPillars', instances=( columnAssembly.instances['RigidRoofW-1'], columnAssembly.instances['RigidRoofBox-1'], ), keepIntersections=ON, originalInstances=SUPPRESS, domain=GEOMETRY) rigidPillars = columnModel.parts['RigidPillars'] columnAssembly.translate(instanceList=('RigidPillars-1', ), vector=(0.112827, 0.414084, 0.0)) e1 = columnAssembly.instances['RigidPillars-1'].edges e2 = columnAssembly.instances['Wcolumn-1'].edges columnAssembly.EdgeToEdge(movableAxis=e1[0], fixedAxis=e2[0], flip=OFF) e1 = columnAssembly.instances['RigidPillars-1'].edges e2 = columnAssembly.instances['BoxColumn-1'].edges columnAssembly.EdgeToEdge(movableAxis=e1[29], fixedAxis=e2[7], flip=OFF) e1 = columnAssembly.instances['RigidPillars-1'].edges e2 = columnAssembly.instances['Wcolumn-1'].edges columnAssembly.EdgeToEdge(movableAxis=e1[4], fixedAxis=e2[4], flip=OFF) # Mesh the merged rigid part # ~~~~~~~~~~~~~~~~~~~~~~~~~~ e = rigidPillars.edges f = rigidPillars.faces elemType1 = mesh.ElemType(elemCode=R3D4, elemLibrary=STANDARD) elemType2 = mesh.ElemType(elemCode=R3D3, elemLibrary=STANDARD) faces = f.getSequenceFromMask(mask=('[#fff ]', ), ) pickedRegions =(faces, ) rigidPillars.setElementType(regions=pickedRegions, elemTypes=(elemType1, elemType2)) pickedRegions = f.getSequenceFromMask(mask=('[#fff ]', ), ) rigidPillars.setMeshControls(regions=pickedRegions, elemShape=QUAD) pickedRegions = f.getSequenceFromMask(mask=('[#fff ]', ), ) rigidPillars.setMeshControls(regions=pickedRegions, technique=STRUCTURED) pickedEdges = e.getSequenceFromMask(mask=('[#4a92492a #12 ]', ), ) rigidPillars.seedEdgeByNumber(edges=pickedEdges, number=1) pickedEdges = e.getSequenceFromMask(mask=('[#b42db6d5 #5 ]', ), ) rigidPillars.seedEdgeByNumber(edges=pickedEdges, number=4) rigidPillars.generateMesh() # Create Sets/Surfaces # ~~~~~~~~~~~~~~~~~~~~ columnAssembly.Set(edges= columnAssembly.instances['Wcolumn-1'].edges.getSequenceFromMask( mask=('[#249244 ]', ), )+\ columnAssembly.instances['BoxColumn-1'].edges.getSequenceFromMask( mask=('[#9244 ]', ), ), name='Base') columnAssembly.Set(faces= columnAssembly.instances['BoxColumn-1'].faces.getSequenceFromMask( ('[#1b ]', ), ), name='BPIL') columnAssembly.Set(faces= columnAssembly.instances['Wcolumn-1'].faces.getSequenceFromMask( ('[#14 ]', ), ), name='WPIL') columnAssembly.Surface(name='BPIL', side1Faces= columnAssembly.instances['BoxColumn-1'].faces.getSequenceFromMask( ('[#1b ]', ), )) columnAssembly.Surface(name='WPIL', side1Faces= columnAssembly.instances['Wcolumn-1'].faces.getSequenceFromMask( ('[#1c ]', ), )) columnAssembly.Surface(name='WPIL', side2Faces= columnAssembly.instances['Wcolumn-1'].faces.getSequenceFromMask( ('[#1c ]', ), )) columnAssembly = columnAssembly e = rigidPillars.edges rigidPillars.DatumPointByMidPoint(point1=rigidPillars.InterestingPoint(edge=e[12], rule=MIDDLE), point2=rigidPillars.InterestingPoint(edge=e[31], rule=MIDDLE)) datumPt1id = rigidPillars.features['Datum pt-1'].id rigidPillars.ReferencePoint(point=rigidPillars.datums[datumPt1id]) r1 = columnAssembly.instances['RigidPillars-1'].referencePoints refPoints1 = (r1[8], ) columnAssembly.Set(referencePoints=refPoints1, name='Rigid') region = regionToolset.Region(referencePoints=refPoints1) columnAssembly.engineeringFeatures.PointMassInertia( name='Inertia-1', region=region, mass=0.001, alpha=0.0, composite=0.0) columnAssembly.SetFromNodeLabels(name='SpotWeldNode6_W',nodeLabels=(('Wcolumn-1', (6,)),)) columnAssembly.SetFromNodeLabels(name='SpotWeldNode21_Box',nodeLabels=(('BoxColumn-1', (21,)),)) # Create Step # ~~~~~~~~~~~ columnModel.StaticStep(initialInc=0.0003, maxInc=1.0, maxNumInc=200, minInc=1e-05, name='Step-1', nlgeom=ON, previous='Initial', timePeriod=1.0) columnModel.FieldOutputRequest(createStepName='Step-1', frequency=5, name='F-Output-2', variables=('S', 'PE')) columnModel.fieldOutputRequests['F-Output-1'].setValues(variables=( 'S', 'PE', 'U')) # Create Load/BC # ~~~~~~~~~~~~~~ columnModel.EncastreBC(createStepName='Initial', name='BC-1', region= columnAssembly.sets['Base']) columnModel.DisplacementBC(amplitude=UNSET, createStepName='Step-1', distributionType=UNIFORM, fieldName='', fixed=OFF, localCsys=None, name= 'BC-2', region=columnAssembly.sets['Rigid'], u1=0.0, u2= -0.25, u3=-0.02, ur1=-0.07, ur2=0.0, ur3=-0.785) # Create Interaction property # ~~~~~~~~~~~~~~~~~~~~~~~~~~~ contProp=columnModel.ContactProperty('IntProp-1') contProp.NormalBehavior(constraintEnforcementMethod=PENALTY) # Define Contact Interaction # ~~~~~~~~~~~~~~~~~~~~~~~~~~ regionMaster=columnAssembly.surfaces['WPIL'] regionSlave=columnAssembly.surfaces['BPIL'] columnModel.SurfaceToSurfaceContactStd(name='Int-1', createStepName='Step-1', master=regionMaster, slave=regionSlave, sliding=FINITE, interactionProperty='IntProp-1', adjustMethod=NONE, enforcement=SURFACE_TO_SURFACE, thickness=OFF, initialClearance=OMIT, datumAxis=None, clearanceRegion=None) # Create Connector sections # # Create attachments points first # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ rp1 = columnAssembly.ReferencePoint(point=(0.0063, 0.040801, 0.0095)) rp2 = columnAssembly.ReferencePoint(point=(0.017108, 0.123964, 0.0095)) rp3 = columnAssembly.ReferencePoint(point=(0.035716, 0.205736, 0.0095)) rp4 = columnAssembly.ReferencePoint(point=(0.06196, 0.285387, 0.0095)) rp5 = columnAssembly.ReferencePoint(point=(0.095603, 0.362205, 0.0095)) r1 = columnAssembly.referencePoints # Now create attachment lines # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ f1 = columnAssembly.instances['BoxColumn-1'].faces faces1 = f1.getSequenceFromMask(mask=('[#8 ]', ), ) srcFaces=faces1 f1 = columnAssembly.instances['Wcolumn-1'].faces faces1 = f1.getSequenceFromMask(mask=('[#4 ]', ), ) tgtFaces=faces1 columnAssembly.AttachmentLines(sourceFaces=srcFaces, targetFaces=tgtFaces, name='Attachment Lines-1', points=(r1[rp1.id], r1[rp2.id], r1[rp3.id], r1[rp4.id], r1[rp5.id]), numProjections=1) # Store these lines created as a set # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ e1 = columnAssembly.edges edges1 = e1.getSequenceFromMask(mask=('[#1f ]', ), ) columnAssembly.Set(edges=edges1, name='Attachment Lines-1-Set-1') e1 = columnAssembly.instances['RigidPillars-1'].edges f1 = columnAssembly.instances['BoxColumn-1'].faces faces1 = f1.getSequenceFromMask(mask=('[#2 ]', ), ) projFaces=faces1 columnAssembly.AttachmentPointsAlongDirection(startPoint=r1[rp1.id], direction=e1[12], projectOnFaces=projFaces, name='Attachment Points-1', spacing=1.0, numPtsAlongDir=1, pointCreationMethod=NUM_PTS_ALONG_DIR) columnAssembly.AttachmentPointsAlongDirection(startPoint=r1[rp2.id], direction=e1[12], projectOnFaces=projFaces, name='Attachment Points-2', spacing=1.0, numPtsAlongDir=1, pointCreationMethod=NUM_PTS_ALONG_DIR) columnAssembly.AttachmentPointsAlongDirection(startPoint=r1[rp3.id], direction=e1[12], projectOnFaces=projFaces, name='Attachment Points-3', spacing=1.0, numPtsAlongDir=1, pointCreationMethod=NUM_PTS_ALONG_DIR) e1 = columnAssembly.instances['BoxColumn-1'].edges columnAssembly.AttachmentPointsAlongDirection(startPoint=r1[rp4.id], direction=e1[13], projectOnFaces=projFaces, name='Attachment Points-4', spacing=1.0, numPtsAlongDir=1, pointCreationMethod=NUM_PTS_ALONG_DIR) columnAssembly.AttachmentPointsAlongDirection(startPoint=r1[rp5.id], direction=e1[13], projectOnFaces=projFaces, name='Attachment Points-5', spacing=1.0, numPtsAlongDir=1, pointCreationMethod=NUM_PTS_ALONG_DIR) # Create another set of attachment lines from these projected attachment points # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ v1 = columnAssembly.vertices ##pt1 = columnAssembly.features['Attachment Points-1'].id ##pt2 = columnAssembly.features['Attachment Points-2'].id ##pt3 = columnAssembly.features['Attachment Points-3'].id ##pt4 = columnAssembly.features['Attachment Points-4'].id ##pt5 = columnAssembly.features['Attachment Points-5'].id #v1 = columnAssembly.featuresById f1 = columnAssembly.instances['BoxColumn-1'].faces faces1 = f1.getSequenceFromMask(mask=('[#2 ]', ), ) srcFaces=faces1 f1 = columnAssembly.instances['Wcolumn-1'].faces faces1 = f1.getSequenceFromMask(mask=('[#10 ]', ), ) tgtFaces=faces1 columnAssembly.AttachmentLines(sourceFaces=srcFaces, targetFaces=tgtFaces, name='Attachment Lines-2', points=(v1[1], v1[2], v1[4], v1[6], v1[8]), numProjections=1) e1 = columnAssembly.edges edges1 = e1.getSequenceFromMask(mask=('[#1f ]', ), ) columnAssembly.Set(edges=edges1, name='Attachment Lines-2-Set-1') # Create Connector section properties # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ columnModel.ConnectorSection(name='ConnSect-1', translationalType=CARTESIAN, rotationalType=CARDAN) elastic_0 = connectorBehavior.ConnectorElasticity(components=(1, 2, 3, 4, 5, 6), table=((200000000000.0, 200000000000.0, 200000000000.0, 200000000000.0, 200000000000.0, 200000000000.0), )) elastic_0.ConnectorOptions() columnModel.sections['ConnSect-1'].setValues(behaviorOptions =( elastic_0, ) ) # Assign connector sections to these attachment lines # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ datumCsys1 = columnAssembly.DatumCsysByThreePoints(name='Datum csys-1', coordSysType=CARTESIAN, origin=( 0.0, 0.0, 0.0), line1=(1.0, 0.0, 0.0), line2=(0.0, 1.0, 0.0)) csa = columnAssembly.SectionAssignment(sectionName='ConnSect-1', region=columnAssembly.sets['Attachment Lines-1-Set-1']) columnAssembly.ConnectorOrientation(region=csa.getSet(), localCsys1=columnAssembly.datums[datumCsys1.id]) csa = columnAssembly.SectionAssignment(sectionName='ConnSect-1', region=columnAssembly.sets['Attachment Lines-2-Set-1']) columnAssembly.ConnectorOrientation(region=csa.getSet(), localCsys1=columnAssembly.datums[datumCsys1.id]) # Create discrete Fasteners # ~~~~~~~~~~~~~~~~~~~~~~~~~ region=columnAssembly.sets['Attachment Lines-1-Set-1'] mdb.models['column'].rootAssembly.engineeringFeatures.DiscreteFastener( name='Fasteners-1', region=region, influenceRadius=2.23e-3) region=columnAssembly.sets['Attachment Lines-2-Set-1'] mdb.models['column'].rootAssembly.engineeringFeatures.DiscreteFastener( name='Fasteners-2', region=region, influenceRadius=2.23e-3) # Create history output in conectors for CTF # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ columnModel.HistoryOutputRequest(createStepName='Step-1', frequency=1, name='H-Output-2', rebar=EXCLUDE, region= columnModel.rootAssembly.sets['Attachment Lines-1-Set-1'], sectionPoints=DEFAULT, variables=('CTF1', 'CTF2', 'CTF3', 'CTM1', 'CTM2', 'CTM3')) columnModel.HistoryOutputRequest(createStepName='Step-1', frequency=1, name='H-Output-3', rebar=EXCLUDE, region= columnModel.rootAssembly.sets['Attachment Lines-2-Set-1'], sectionPoints=DEFAULT, variables=('CTF1', 'CTF2', 'CTF3', 'CTM1', 'CTM2', 'CTM3')) regionDef = columnAssembly.sets['SpotWeldNode21_Box'] mdb.models['column'].HistoryOutputRequest(name='H-Output-4', createStepName='Step-1', variables=('RF',),frequency=5, region=regionDef, sectionPoints=DEFAULT, rebar=EXCLUDE) # Tie-constraint rigid support and pillars # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ e1 = columnAssembly.instances['RigidPillars-1'].edges edges1 = e1.getSequenceFromMask(mask=('[#92491 ]', ), ) columnAssembly.Set(edges=edges1, name='rigidTieW') e1 = columnAssembly.instances['RigidPillars-1'].edges edges1 = e1.getSequenceFromMask(mask=('[#24400000 #9 ]', ), ) columnAssembly.Set(edges=edges1, name='rigidTieBox') e1 = columnAssembly.instances['BoxColumn-1'].edges edges1 = e1.getSequenceFromMask(mask=('[#2491 ]', ), ) columnAssembly.Set(edges=edges1, name='BoxTie') e1 = columnAssembly.instances['Wcolumn-1'].edges edges1 = e1.getSequenceFromMask(mask=('[#92491 ]', ), ) columnAssembly.Set(edges=edges1, name='WTie') columnModel.Tie(name='Constraint-1', master=columnAssembly.sets['rigidTieBox'], slave=columnAssembly.sets['BoxTie'], positionToleranceMethod=COMPUTED, adjust=ON, tieRotations=ON, thickness=ON, constraintEnforcement=NODE_TO_SURFACE) columnModel.Tie(name='Constraint-2', master=columnAssembly.sets['rigidTieW'], slave=columnAssembly.sets['WTie'], positionToleranceMethod=COMPUTED, adjust=ON, tieRotations=ON, thickness=ON,constraintEnforcement=NODE_TO_SURFACE) # Create Job and write input file # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ mdb.Job(name='Column', model='column', type=ANALYSIS, explicitPrecision=SINGLE, nodalOutputPrecision=SINGLE, description='Buckling of a column with spot welds', parallelizationMethodExplicit=DOMAIN, multiprocessingMode=DEFAULT, numDomains=1, userSubroutine='', numCpus=1, memory=90, memoryUnits=PERCENTAGE, scratch='', echoPrint=OFF, modelPrint=OFF, contactPrint=OFF, historyPrint=OFF) mdb.jobs['Column'].writeInput(consistencyChecking=OFF)