×
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

Controlling Abaqus within a C++ app

Controlling Abaqus within a C++ app

Controlling Abaqus within a C++ app

(OP)
Is it possible to control the Abaqus kernel directly from within a C++ application? The idea it to generate the object topology using a user-defined set of rules (whatever they might be) on the C++ side, then feed that topology into Abaqus, perform an FE analysis (whatever it might be), then feed the results back to C++ application for interrogation and display, preferably without ever seeing any Abaqus-related user interfaces.

I know it is possible to write custom scripts for Abaqus using Python. I also know that Python scripts can be executed from within a C++ application with some code 'massaging'. Therefore, in theory, one can generate Python scripts on the fly in C++ and have them executed. However, the sticking point seems to be the following statement from the Abaqus Scripting User's Manual: "If your script accesses the functionality of any of the Abaqus/CAE modules, the statements must be interpreted by the Abaqus/CAE kernel; you cannot run the script from the Python interpreter invoked from the system prompt. You must execute the script in Abaqus/CAE by selecting File Run Script from the main menu bar and selecting the file to execute". That seems to imply that there is no way to directly control Abaqus from one's C++ code. Is that correct?

Any feedback will be highly appreciated. Also, perhaps someone can suggest an alternative FEA package that would allow one to implement the aforementioned activity.

Thank you.
 

RE: Controlling Abaqus within a C++ app

I'm sure it is feasible to do with C++. I wrote a set of Matlab functions and a calling program that generates input files. The structures of interests were hexapod designs. The user was able to enter in a set of inputs to define the basic geometry of the structure, the code generates an abq .inp file (with a node and element matrix), the code also generates a .bat file for multi-job submission, and finally the code executes the batch file using the python driven abaqus kernel. If you want to know more of the details let me know, but if you are doing this with C++ I cannot help you.

RE: Controlling Abaqus within a C++ app

In actuality, the code actually read a text file that had columns for different variables and each row represented 1 particular structure.

RE: Controlling Abaqus within a C++ app

*The code actually read a text file that had columns for different input variables and each row represented 1 particular structure.

RE: Controlling Abaqus within a C++ app

(OP)
Thank you for your response.

That sounds precisely like the answer I was looking for. Despite the fact that your .inp and .bat files (and the custom .py script, I am guessing) were generated in Matlab, rather than C++, it sounds like you were able to do the thing I was mostly concerned with - starting the Abaqus kernel and submitting jobs to it directly from within your custom application (and retrieving the results, I am assuming), without using any Abaqus GUIs.

Any additional details on your approach will be very much appreciated (e.g., you were able to simply execute an "abaqus python some_scriptname.py" command prompt statement somewhere in your Matlab code, and that started the Abq kernel for you? In that case, I severely misunderstood the original statement in the scripting tutorial).

Thank you in advance.

RE: Controlling Abaqus within a C++ app

The basic theme of this approach plays with the fact that all information describing a particular FEA job is stored in the .inp file prior to submission. After the job is submitted and completed, all important information about the results is stored in the .dat file. In my particular case, I was looking at mass and natural frequency, which I post-processed (or as you say "retrieved the results") by a function from matlab that located the correct directory and searched withing the .dat file for that info. Basically you'll be using string searches, if you know what i mean.

RE: Controlling Abaqus within a C++ app

Hey mechfeeney,

I've been working on a simulation for a while now within .CAE and I have it working nearly 100% as I would like. I was just wondering do you think it would be handier for me to run batches of jobs (optimization) using an external Matlab script or some sort of python Abaqus kernal? Bearing in mind I have no knowledge of python and I am familiar with Matlab.
Your paper sounds interesting and I'd be interested in having a look if thats not a problem?

Thanks

RE: Controlling Abaqus within a C++ app

It's largely a function of how many parameters you are optimizing. For instance, if you are just changing a material parameter...say modulus of elasticity, it doesn't make sense to write a code to explore the behavior. On the other hand, if you are looking at many parameters (especially geometric variables), I found it helpful to write a MATLAB script to generate models with a given set of inputs. The inputs are received in through a text file (which can be easily created from an excel spreadsheet) and the code interprets the text file...in turn generating the .inp. The issue with MATLAB ...and SolidWorks for that matter, is that often times changing the geometry of individual instances or parts effects the structure assembly at large. ABAQUS is a pretty bad CAD utility, but it's FEA is great. I experienced many problems when trying to change the geometry of a particular instance (it would corrupt my constraints and bc's).

So the questions you need to ask:
1. Is it worth the time to make the code?
2. What type of structure am I analyzing? (wireframe, solid, shell?)
3. How many parameters are involved?
etc. etc.
 

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