Executing abaqus job using python script

  • Context: Python 
  • Thread starter Thread starter Eastonc2
  • Start date Start date
  • Tags Tags
    Abaqus Job Python
Click For Summary
SUMMARY

This discussion focuses on executing an Abaqus job using a Python script to modify the mesh size of multiple parts within a model. The provided script demonstrates how to open a model database, delete existing meshes, and generate new meshes with specified sizes. A loop structure is suggested for applying mesh modifications across multiple parts, enhancing efficiency. The script is designed for use with Abaqus CAE and is applicable to users needing to automate mesh adjustments in finite element analysis.

PREREQUISITES
  • Familiarity with Abaqus CAE and its scripting interface
  • Basic understanding of Python programming
  • Knowledge of finite element analysis concepts
  • Experience with mesh generation and control in Abaqus
NEXT STEPS
  • Research "Abaqus Python scripting for batch processing" to automate multiple job submissions.
  • Learn "Abaqus mesh controls and parameters" for advanced mesh optimization techniques.
  • Explore "Abaqus scripting for model modifications" to enhance automation capabilities.
  • Investigate "Abaqus job management and monitoring" for effective job execution and error handling.
USEFUL FOR

Engineers, researchers, and developers involved in finite element analysis using Abaqus, particularly those looking to automate mesh modifications and job executions.

Eastonc2
Messages
19
Reaction score
0
I'm not 100% sure where this belongs, but, I have a script that will allow me to modify the mesh size of an individual part in abaqus, and then execute a job on that part. my question is How do I go about changing the mesh size for multiple parts?

*edit* removed first part of question, wasn't thinking straight.

script I already have is below."""
script.py

this script changes mesh size of existing model and then runs job

"""
from abaqus import *
from abaqusConstants import *
#import part
#import mesh
#from mesh import S4, S8R, STANDARD, STRUCTURED
#import job# Open the model database.
# This opens ALL features in the model tree
# assigns the CAE model data base to the variable 'mdb'
mdb=openMdb('Model.cae')

#case sensitive !
model = mdb.models['Model-1']
part = model.parts['Part-1]

#first we delete the old mesh before we create a new one
part.deleteMesh()

#all mesh controls are already set in this MDB, so no need to adjust
#only needed: size:
part.seedPart(size=1, deviationFactor=0.1)

#create
part.generateMesh()

jobName = 'modifiedMesh'

myJob = mdb.Job(name=jobName, model=model,
description='Deflection_analysis')
myJob.submit()
myJob.waitForCompletion()
 
Last edited:
Technology news on Phys.org
For future ref if nothing else ... If you've multiple parts, you can for example make a list of them (if don't want to refer explicitly by name), followed by a for-loop which contains the part, seed and meshing specification. Something along the lines of:
Code:
for part in model.parts:
[INDENT]part.deleteMesh()[/INDENT]
[INDENT]part.seedPart(size=1, deviationFactor=0.1)[/INDENT]
[INDENT]part.generateMesh()[/INDENT]
and you'll need to specify what size you wish for a specific part (another list for example).
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 0 ·
Replies
0
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
2
Views
7K
  • · Replies 1 ·
Replies
1
Views
3K