Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
474 views
in Technique[技术] by (71.8m points)

transformation - How can I extract, edit and replot a data matrix in Abaqus?

Good afternoon,

We′ve been working on an animal model (skull) applying a series of forces and evaluating the resultant stresses in Abaqus. We got some of those beautiful and colourful (blue-to-red) contour-plots. Now, we′d like to obtain a similar image but coloured by a new matrix, which will be the result of some methematical transformations.

So, how can I extract the data matrix used to set those colour patterns (I guess with X-, Y-, Z-, and von Mises-values or so), apply my transformation, and replot the data to get a new (comparable) figure with the new values?

Thanks a lot and have a great day!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I've never done it myself but I know that this is possible. You can start with the documentation (e.g. here and here).

After experimenting using GUI you can check out the corresponding python code which should be automatically recorded in the abaqus.rpy file at your working directory (or at C:emp). Working it trhough you could get something like:

myodb = session.openOdb('my_fem.odb') # or alternatively `session.odbs['my_fem.odb']` if it is already loaded into the session

# Define a temporary step for accessing your transformed output
tempStep = myodb.Step(name='TempStep', description='', domain=TIME, timePeriod=1.0)

# Define a temporary frame to storeyour transformed output
tempFrame = tempStep.Frame(frameId=0, frameValue=0.0, description='TempFrame')

# Define a new field output
s1f2_S = myodb.steps['Step-1'].frames[2].fieldOutputs['S'] # Stress tensor at the second frame of the 'Step-1' step
s1f1_S = myodb.steps['Step-1'].frames[1].fieldOutputs['S'] # Stress tensor at the first frame of the 'Step-1' step
tmpField = s1f2_S - s1f1_S

userField = tempFrame.FieldOutput(
    name='Field-1', description='s1f2_S - s1f1_S', field=tmpField
)

Now, to display your new Field Output using python you can do the following:

session.viewports['Viewport: 1'].odbDisplay.setFrame(
    step='TempStep', frame=0
)

For more information on used methods and objects, you can consult with the documentation "Abaqus Scripting Reference Guide":

  • Step(): Odb commands -> OdbStep object -> Step();
  • Frame(): Odb commands -> OdbFrame object -> Frame();
  • FieldOutput object: Odb commands -> FieldOutput object;

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...