×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Abaqus Script: SET definition

Abaqus Script: SET definition

Abaqus Script: SET definition

(OP)
Hi,
I'm working on an Abaqus script (obviously in Python language) to do a parametric model. I just wrote some strings of code to create a solid model, but now I want to define a SET of faces of my model. I cannot do it, because there are some mistakes in the definition of the sting code. Here below there is the script I'm using. The wrong row is the last one. Can someone corrects it?

#################################     PROGRAMMA
#
from abaqus import *
import testUtils
testUtils.setBackwardCompatibility()
from abaqusConstants import *
import sketch
import part
import section
import regionToolset
import displayGroupMdbToolset as dgm
import part
import material
import assembly
import step  
import interaction
import load
import mesh
import job
import sketch
import visualization
import xyPlot
import displayGroupOdbToolset as dgo
import connectorBehavior
#
#                PARAMETRI DA INSERIRE
thick = 22.9       #Spessore lastra in (mm)
L1 = 0.5              #Lunghezza prima parte in(mm)
L2 = 1
L3 = 1
L4 = 1200-(L1+L2+L3)
Ltot = 1200
length= 25         #Semi lunghezza del difetto (mm)
a= 6                  #Altezza del difetto (mm)
n= 30                #Numero si strati (30 consigliato)
#
#
myModel = mdb.Model(name='Model-1')
mySketch = myModel.Sketch(name='sezione',sheetSize=200.0)
#
mySketch.Line(point1=(0.0, 0.0), point2=(0.0, thick))
mySketch.Line(point1=(0.0, thick), point2=(628.0, thick))
mySketch.Line(point1=(628.0, thick), point2=(628.0, 0.0))
mySketch.Line(point1=(628.0, 0.0), point2=(0.0, 0.0))
#
myPart = myModel.Part('Lastra', dimensionality=THREE_D, type=DEFORMABLE_BODY)
#
myPart.BaseSolidExtrude(sketch=mySketch, depth=Ltot)
#
face1center=(314,(thick/2),0)
face1=myPart.faces.findAt(face1center)
sezion=myPart.Set(face=face1, name='Sezione1')

RE: Abaqus Script: SET definition

What is the error that you are getting?

RE: Abaqus Script: SET definition

Hi,

the findAt()-method returns a face object.
The argument for the Set()-method is a sequence,
in your case a sequence of faces containing
one face. I think this could be the error.
Try something like:

face1=myPart.faces.findAt(face1center)
i = face1.index
set = myMdb.assembly.Set(name='test', faces=myPart.faces[i:i+1])  

Hope this works

Marco

RE: Abaqus Script: SET definition

(OP)
Hi,

iwb your solution is right, thanks.
However again, now I don't know how to apply this solution for more surfaces.
I have the reference scripting user manual of Abaqus, but I didn't find in it the string commands that I need. Also it isn't so easy to read and understand.
Where I can download an other manual or something like this?

Thanks in advance.

Valerio

RE: Abaqus Script: SET definition

Hi Valerio,

unluckily I don't know any further source
of python scripting than the manuals.
A good starting point is to try things in
CAE and figure out from the rpy-file how it
was realized in python.

You can find the faces as mentioned above
getting myPart.faces[i:i+1] for the ith face.
Define

set_seq = myPart.faces[i:i+1]

an then add the subsequent faces maybe in a loop
with

set_seq += myPart.faces[j:j+1].

After all faces are added to the sequence, you can
assign the set again with

set = myMdb.assembly.Set(name='test', faces=set_seq)

Maybe there is an easier solution but this should work
at least.

Good luck
Marco
 

RE: Abaqus Script: SET definition

(OP)
Hi,

iwb you was right again.
In real I wrote my script watching the .py Abaqus macro obtained from the CAE, but sometimes I cannot get clear information, especially when I select objects (cells, faces, points etc.) during the operation. For example when I create a set of face in CAE, the relative rows in the script are:

p = mdb.models['Model-1'].parts['Lastra']
f = p.faces
faces = f.getSequenceFromMask(mask=('[#12 ]', ), )
p.Set(faces=faces, name='io')

In this case, what means 'mask=('[#12]',)??

Thanks
Valerio

RE: Abaqus Script: SET definition

Hi,

as far as i know, f.getSequenceFromMask(...) is a CAE intern
representation of some .findAT(...) commands. I was not
able to use this command properly but you can expose the
explicit commands in the rpy-file by typing

session.journalOptions.setValues(replayGeometry=COORDINATE,
recoverGeometry=COORDINATE)

in the python command line.

Have fun

Marco

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources