1

When executing a python script in Abaqus CAE, Errors, Warning and other messages are printed in the dedicated message window, and callback functions can further customise message behaviour.

During a noGui script execution, all messages are suppressed, even ones that would be really helpfull to see, such as "Keyword import not supported.", or "Job exited with error(s)."

The Job object has no return values to check for completion. If the job, or job import fails early enough there are no files generated to check for warning messages.

Callback functions are not supported:

Messaging commands are available only if Abaqus/CAE is run interactively using the GUI.

My main problem with the 'usual' way of just calling abaqus job=input is that I need to iterate on the model as it generates results, and am trying to keep everything in one instance of python (or rather, abaqus' python) so that i can move objects around and update the model easily without copnstantly re-reading 30000-line input files.

As it stands my main loop looks like this:

import os
import sys
import abaqus
import abaqusConstants as abqc

my_db = abaqus.Mdb(pathname='models.cae')
my_model = my_db.ModelFromInputFile('Model-1','./inpfiles/import_me.inp')

# do some checks on the model to see if all the keywords were imported
# manually read them in if not.

for i in [1]: # Future iteration loop

    my_job = my_db.Job(name='Job-1', model='Model-1', scratch='./work')
    my_job.submit()
    my_job.waitForCompletion()

    #check results, update model

Is there any way of gaining access to the abaqus messages that are usually relegated to the message dialog box?

Update:

After some trying around, simply stating sys.stdout = sys.__stdout__ does the trick for one layer of code, i.e. the warning messages delivered by the ModelFromInputFile function. However the output stream from the actual job submission is still not printed to screen... Partial success?

Using this anser on redirected output also did not brear fruit since sys.stdout as defined abaqus does not have a fileno attribute.

polymachine
  • 56
  • 1
  • 6

0 Answers0