Like nastranwrapper, has anyone developed a wrapper for abaqus ? If not, can anybody suggest me a few hints to run abaqus python scripts through openmdao environment ? I know only moderate levels of python programming.

asked 21 Jul '14, 05:02

A_kashyap's gravatar image

A_kashyap
713718


I put the code in a github repo . The user who contributed the code, Thibaut Brosse, warns:

"it doesn’t work with the last version of OpenMDAO (0.10.0). Maybe it is not a big deal to fix that but I tried yesterday and I got an error about the command to launch the bat file…"

I asked him what the errors were but he hasn't replied yet. I know he is in the process of moving so it might be a while before he has time.

Hope this helps!

link

answered 25 Jul '14, 09:55

Herb's gravatar image

Herb ♦
2492

Thank you very much indeed. I will look it.

(29 Jul '14, 23:50) A_kashyap A_kashyap's gravatar image

Hi Herb,

I tried to run a job. But, the code is failing without any error as well.. Just running without effect.. No error message. It looks like the code is idly running without bothering with batch commands.. My Abaqus script is just fine. I checked it thoroughly by running it independently. Then, I tried to run the wrapper stage by stage. I removed the parsing, input file generator etc and tried to run just the batch file command. I feel thats where some problem is. The python script didnt launch the launcher batch. Apparently, the launcher is not taken by file metadata or ExternalCode.. I am running 0.8.0 version by the way. What could be the problem ?

Thanks -Abhi

(08 Aug '14, 07:09) A_kashyap A_kashyap's gravatar image

I've never used Abaqus, but from the online scripting user's manual, it looks like you would create an Abaqus component that extended ExternalCode. During execute, that component would have to generate a Python script to perform any Abaqus model updates (call it update.py for example), then run:

abaqus cae noGUI=update.py

as the ExternalCode command line to execute. Then to get the results, create another Python script(call it results.py for example), then run:

abaqus cae noGUI=results.py

as another ExternalCode command line to execute.

The update.py script would have values based on your Abaqus component's inputs. The results.py script would need to get values for your component's outputs from Abaqus and write them to an output file. Finally, your component would read this file and update the component output values.

This dynamic script generation is likely to be pretty problem-specific, but there may be some code that would be common to anything needing to run Abaqus. You could probably deal with different Abaqus models by supplying template update.py and results.py files and then generate the real files to send to Abaqus using the file generation utilities in OpenMDAO.

link

answered 21 Jul '14, 14:08

setowns1's gravatar image

setowns1
6986

Thank you ! Right.. I get the tip. I will work it and I might come back here if there need be.

and yes.. This could probably be problem specific. But, since abaqus scripting is in python and there is a way to generate python script from the existing problem that is done via graphical interface, I feel that this might turn out to be something pretty handy for me. Templates.. and file generation utilities...

Thank you.

-- Abhi_Kashyap

(22 Jul '14, 06:42) A_kashyap A_kashyap's gravatar image
1

Hi Abhi,

We know of a user who wrapped Abaqus. I just sent him an email asking if he is OK with me sending you his code. Stay tuned...

(24 Jul '14, 09:14) Herb ♦ Herb's gravatar image

Thank you very much! Waiting.

(25 Jul '14, 00:11) A_kashyap A_kashyap's gravatar image
1

Hi Abhi,

Could you send Abaqus files that I can use to test this? I can get some too and try it. Also, what version of Abaqus are you using? I don't know if that makes a difference ( I doubt it ) but it would be good to know.

Thanks

(08 Aug '14, 08:14) Herb ♦ Herb's gravatar image

Pedro,

I just noticed that Thibaut was also having as problem like this. I sent him an email with a recommended fix. Can you try this ?

From: "Schilling, Herbert W. Subject: Re: Question about your OpenMDAO bug with CSV recorder Date: August 14, 2014 8:21:01 AM EDT To:

Hi,

Just letting you know I think I know the problem.

Instead of doing something like this

    self.command= ['C:\\openmdao-0.8.0\\launcher.bat']

try this

    self.command= ['cmd.exe', '/c',  'C:\\openmdao-0.8.0\\launcher.bat']
link

answered 24 Feb '15, 10:57

Herb's gravatar image

Herb ♦
2492

edited 24 Feb '15, 11:35

kmarstel's gravatar image

kmarstel ♦♦
434119

Hello Herb,

your solution works perfectly. I have forked the project and editted it.

Thank you very much.

(25 Feb '15, 13:44) Leal26 Leal26's gravatar image

Hello,

I am also an Abaqus user and I was fortunate enough to work with Thibaut Brosse, who developed the code shared by Herb. I have been using the code for my research and I can attest that it does indeed work for versions of OpenMDAO before v0.10. The error we get with higher versions is annexed below. It does not recognize the .bat file although it is in the directory. Any ideas of how to solve this?

Thanks, Pedro

(openmdao-0.10.3.2) C:\Users\Pedro\.openmdao\gui\projects\Cruise_Optimization>python doe.py
Traceback (most recent call last):
File "doe.py", line 72, in <module> opt_problem.run()
File "C:\OpenMDAO\openmdao-0.10.3.2\lib\site-packages\openmdao.main-0.10.3.2-py2.7.egg\openmdao\main\component.py", line 557, in run self.execute()
File "C:\OpenMDAO\openmdao-0.10.3.2\lib\site-packages\openmdao.main-0.10.3.2-py2.7.egg\openmdao\main\assembly.py", line 769, in execute self.driver.run(ffd_order=self.ffd_order, case_uuid=self._case_uuid)
File "C:\OpenMDAO\openmdao-0.10.3.2\lib\site-packages\openmdao.main-0.10.3.2-py2.7.egg\openmdao\main\driver.py", line 312, in run super(Driver, self).run(ffd_order, case_uuid)
File "C:\OpenMDAO\openmdao-0.10.3.2\lib\site-packages\openmdao.main-0.10.3.2-py2.7.egg\openmdao\main\component.py", line 557, in run self.execute()
File "C:\OpenMDAO\openmdao-0.10.3.2\lib\site-packages\openmdao.lib-0.10.3.2-py2.7.egg\openmdao\lib\drivers\doedriver.py", line 88, in execute super(DOEdriver, self).execute()
File "C:\OpenMDAO\openmdao-0.10.3.2\lib\site-packages\openmdao.lib-0.10.3.2-py2.7.egg\openmdao\lib\drivers\caseiterdriver.py", line 855, in _model_execute self.workflow.run(case_uuid=server.case.uuid)
File "C:\OpenMDAO\openmdao-0.10.3.2\lib\site-packages\openmdao.main-0.10.3.2-py2.7.egg\openmdao\main\workflow.py", line 141, in run comp.run(ffd_order=ffd_order, case_uuid=case_uuid)
File "C:\OpenMDAO\openmdao-0.10.3.2\lib\site-packages\openmdao.main-0.10.3.2-py2.7.egg\openmdao\main\component.py", line 557, in run self.execute()
File "C:\Users\Pedro\.openmdao\gui\projects\Cruise_Optimization\wrapabaqus_airfoil.py", line 110, in execute super(WrapAbaqus_airfoil, self).execute()
File "C:\OpenMDAO\openmdao-0.10.3.2\lib\site-packages\openmdao.lib-0.10.3.2-py2.7.egg\openmdao\lib\components\external_code.py", line 153, in execute return_code, error_msg = self._execute_local()
File "C:\OpenMDAO\openmdao-0.10.3.2\lib\site-packages\openmdao.lib-0.10.3.2-py2.7.egg\openmdao\lib\components\external_code.py", line 255, in _execute_local ValueError)
File "C:\OpenMDAO\openmdao-0.10.3.2\lib\site-packages\openmdao.main-0.10.3.2-py2.7.egg\openmdao\main\container.py", line 1451, in raise_exception raise exception_class(full_msg)
ValueError: wrapabaqus_airfoil (1-wrapabaqus_airfoil): The command to be executed, 'launch_cmd.bat', cannot be found
link

answered 19 Feb '15, 13:23

Leal26's gravatar image

Leal26
124

Hello Pedro,

I can take a look

(24 Feb '15, 10:10) Herb ♦ Herb's gravatar image

Hurray! Glad it worked.

link

answered 25 Feb '15, 13:52

Herb's gravatar image

Herb ♦
2492

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×39
×11

Asked: 21 Jul '14, 05:02

Seen: 17,257 times

Last updated: 31 Jul '15, 15:43

powered by OSQA