Executing abaqus job using python script

In summary, the conversation is about a script that allows the modification of mesh size for individual parts in Abaqus and executing a job on those parts. The question is how to change the mesh size for multiple parts, and the provided script shows the steps for deleting the old mesh, setting mesh controls, and generating a new mesh for each part.
  • #1
Eastonc2
20
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
  • #2
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).
 

1. How do I import necessary modules to run Abaqus job using python script?

To execute Abaqus job using python script, you will need to import the necessary modules such as abaqus, abaqusConstants, part, assembly, and job from the abaqus package. You can do this by using the 'import' statement followed by the name of the module, for example:

from abaqus import *

2. What is the process for creating a new Abaqus job using python script?

To create a new Abaqus job using python script, you will need to first create a model using the Model() function and then create a job using the Job() function. You will also need to specify the analysis type and other parameters for the job. Once the job is created, you can define the steps and output requests before submitting the job for execution.

3. How can I define boundary conditions and loads in my Abaqus job using python script?

To define boundary conditions and loads in your Abaqus job using python script, you can use the boundaryConditions() and loads() functions respectively. These functions allow you to specify the type of boundary condition or load, the affected region, and the magnitude or direction of the condition or load.

4. Is it possible to run multiple Abaqus jobs using a single python script?

Yes, it is possible to run multiple Abaqus jobs using a single python script. You can do this by creating a loop that iterates through a list of jobs and executes them one by one. You can also use the submit() function to submit all the jobs at once.

5. How can I check the progress and status of an Abaqus job running through python script?

To check the progress and status of an Abaqus job running through python script, you can use the jobStatus() function. This function returns a dictionary with information about the current status of the job, including the current step, time increment, and job completion status. You can also use the wait() function to pause the execution of the script until the job is completed.

Similar threads

  • Programming and Computer Science
Replies
5
Views
2K
  • Programming and Computer Science
Replies
1
Views
1K
  • Programming and Computer Science
Replies
7
Views
2K
  • Programming and Computer Science
Replies
2
Views
2K
Replies
2
Views
6K
Replies
1
Views
1K
  • STEM Career Guidance
Replies
4
Views
1K
  • STEM Academic Advising
Replies
13
Views
2K
  • STEM Career Guidance
Replies
1
Views
3K
Back
Top