Create Part in ABAQUS/CAE from .txt file(containing coordinates)

This blog  describes how to create 2D sketch (then the part) from .txt file that contains coordinates.  Make sure that the given .txt file is available in the set working directory.The commands are in pink and comments are in blue.

This script is adapted from the example script given in the Scripting User’s Manual

The text file for the coordinates were generated from MATLAB® for my problem

# import commands to get library file stored in abaqus
from abaqus import *
from abaqusConstants import *
backwardCompatibility.setValues(includeDeprecated=True,
                                reportDeprecated=False)
import sketch
import part
# creating variables by calling the constructors 
myModel = mdb.Model(name='Model A')

mySketch = myModel.ConstrainedSketch(name='Sketch A',
                                     sheetSize=200.0)

lines = open('redmodel.txt', 'r').readlines()                 # give your text file here

# readlines() function reads all lines from the given .txt file

pointList = []                                    # Creating empty array

for line in lines:                                # reading line by line and performing action    
    pointList.append( eval( '(%s)' % line.strip() ) )
# strip() func removes all the white spaces from a line. eval() function which evaluates
# a string as though it were an expression and returns a result and append adds each 
# coordinate as last element of array  
for i in range(len(pointList)-1):
    mySketch.Line(point1=pointList[i],
        point2=pointList[i+1])

# Above for loop will help in connecting the coordinates in the sequence  

myPart = myModel.Part(name='Part A', dimensionality=THREE_D,
    type=DEFORMABLE_BODY)

myPart.BaseSolidExtrude(sketch=mySketch, depth=20.0)

myViewport = session.Viewport(name='Viewport for Model A',
    origin=(10, 10), width=150, height=100)

myViewport.setValues(displayedObject=myPart)

Pilot Studies before Full Fledged Analysis

If you are dealing with complicated problems, simplified analyses with simplified models and limited analysis goals would be always helpful. Such simple analyses as your pilot study would provide you with the following benefits:

  • Provide a preview to the structural behavior, with less input data (i.e reduced effort)
  • Provide insight into what computational options would be appropriate
  • Help to plan better on what output to request from full scale analysis, since there would be only less output to examine in the simplified analysis of pilot study.

Pilot studies are helpful in answering “what if” questions in modelling or to test the software and to see if it behaves as expected.

 

Source: Concepts and Applications of Finite Element Analysis by R. D. Cook et al

A Quick Start to Abaqus

For those of you, who are not lucky to have any colleagues/lab mates/seniors to introduce you to Abaqus and would like to have a jump-start on this FE package- here is the simplest way. Abaqus documentation is one of the best among its competitors and this comes in handy.

The Appendix B of Getting Started with Abaqus: Interactive Edition provides a quick step by step walk through the different modules in Abaqus and gives the basic steps to create and submit a model for FE analysis. You can find it in this online Abaqus documentation or you can download a pdf copy of the same here.

 

To further grow in your expertise of Abaqus, go through the Getting Started Manual from the beginning. It starts by explaining how the Abaqus package works and takes you through different elements available in Abaqus, illustrating them with help of simple examples.