0

Recently, I learned that C++ codes runs faster than Python. We have post-processing Python script which takes huge time to run. So, I'm thinking of replacing them with C++ code. I know that C++ code can only be used for Post-processing, and that is fine for me.

I am not sure how to run the C++ code in Abaqus. I know that I need a compiler to compile the C++ code, like Visual Studio. But I don't know about integrating it with Abaqus and overall flow to compile and run the script. Any help will be much appreciated!

kaylum
  • 13,833
  • 2
  • 22
  • 31
Satish Thorat
  • 584
  • 1
  • 5
  • 13
  • *C++ codes runs faster than Python* sometimes. Depends a lot on how smart the code is and how well it takes advantage of what either language does well. – user4581301 Jul 20 '21 at 05:01
  • *C++ codes runs faster than Python* This I read in Abaqus Scripting User's Guide. Anyway, I have to confirm it. – Satish Thorat Jul 20 '21 at 05:10
  • `Visual Studio` is not C++ compiler but `IDE` which can run C++ compiler - but you still can download and install C++ compiler separatelly and run it in console without `Visual Studio`. – furas Jul 20 '21 at 07:36
  • you can always try write C++ library and wrap it with Python so you will run Python script which will run C++ library – furas Jul 20 '21 at 07:44
  • Thank for suggestion @furas. But, I think, as this is NOT a simple C++ code, but it has Abaqus related commands and hence, this must be integrated with Abaqus somehow. – Satish Thorat Jul 20 '21 at 09:52
  • 1
    did you search it? I used Google for `Abaqus C++` and I think I saw some answers on Stackoverflow. Something like [Reference Abaqus C++ API static libraries to read ODB files](https://stackoverflow.com/questions/54453524/reference-abaqus-c-api-static-libraries-to-read-odb-files) – furas Jul 20 '21 at 10:00
  • I searched for other keywords. But I completly missed searching that way. Thank you @furas. I will get some help from this links. – Satish Thorat Jul 20 '21 at 10:25
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/235121/discussion-between-satish-thorat-and-furas). – Satish Thorat Jul 21 '21 at 01:00

1 Answers1

-1

Recently, I have the same problem with you,if you want to use C++ you must use the script in command: abaqus make job=filename.cpp.Then abaqus will give you a file:filename.exe,I think that C++ is same as fortran,I couldn't link it to abaqus ,so I couldn't run the .exe file,if you can solve my problem I would appreciate that you could answer me.

  • Hi and welcome to Stackoverflow! In my opinion you should answer a question only if there's enough information to address the OP issue; but you are finishing with another question, and that is confusing. I think that this is more suitable for a comment, instead of a full answer as you posted. – Fer García Aug 04 '21 at 08:22