Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

DIANA TNO FEA - Python - MATLAB 2

Status
Not open for further replies.

lisandrojim

Civil/Environmental
Dec 10, 2015
5
Hello!

I have a model in DIANA TNO, and I was wondering if perhaps exist a way to execute the software from Python (more information click here) or MATLAB?

The final idea is to be able to create projects / create and run analysis / process the results from MATLAB and/or Python.

Honestly I haven't found helpful information about it, any contribution will be welcome.

Thanks in advance!
 
Replies continue below

Recommended for you

I don't understand how you think that's going to be anyway practical. DIANA is a purpose built FEA program, while both Python and Matlab are not only general purpose math environments, they're both interpreters. Both of these features, which are great for what these programs do, will cause absurdly long run times, assuming you even had the solver written. While both CAN do FEA, there's no generalized code for running DIANA input files, nor is there likely any existing code that provides the features one might expect from DIANA. Did I mention absurdly long run times?

TTFN
I can do absolutely anything. I'm an expert!
faq731-376 forum1529
 
I imagine the question is asking about generating input in Python/Matlab, running the analysis in DIANA, then processing the results back in Python/Matlab. I don't know if you can do that in DIANA, but you certainly can in other packages, through an Application Programming Interface (API), and the process works well and can save a huge amount of time.

I doubt that the intention was actually to do the analysis in Python or Matlab, but if it was, the Python Scipy package has compiled solvers that are very fast, so slow performance of interpreted code is not an issue, at least in Python.

That said, I don't know if DIANA has an API. A quick search didn't come up with anything.

Doug Jenkins
Interactive Design Services
 
I've done this with a bunch of solvers in Python. Use the subprocess module to call the command line application with whatever arguments you want. Unless I made a typo somewhere, it should look like this:

[pre]
import subprocess
job = subprocess.Popen("<insert diana command here>", stdout=subprocess.PIPE, stderr=subprocess.PIPE)
output, err = job.communicate()
[/pre]

Matlab can use an OS command with "system(<command>)" and I think "!<insert command here>" (you'll have to read the docs, my matlab is rusty). As for pre/post processing inputs and outputs you'll have to write your own code to read or write files. If you want to take it a step further, you can pretty easily write your own global optimization code with the Scipy stack.
 
Thanks to all of you for your positive and gentile replays. I want to offer my apologies if maybe I wasn't clear with my first post. I'll try to be more clear this time:

1. DIANA TNO is a software for perform finite element analysis. The model, the analysis settings and the results can be saved in many type of files like: .txt .dat .dcf, etc. Files that could be manipulated by an external software (MATLAB/Python).

2. In the documentation that I've found in DIANA's manual, I found that it's possible to use script commands with Python scripting language. And even though I'm not an expert in Python, I know that it could be possible to run some few specific commands just for execute the analysis, and obtain the results (in a .txt file).

3. Due I know how to use MATLAB, I pretend to make the post-processing with it, and just using Python for execute the analysis if I don't manage to do everything from MATLAB, otherwise I wouldn't use Python in all this process.

As you can see, MATLAB (and just if is necessary, Python) will be use for manipulate the Input and Output of DIANA TNO.

Many thanks in advance for your gentile reply and any type of contribution will be welcome, I'm sure that I'll help a lot in this process.

L
 
Hello again!

I found the answer, it is presented here.

Best,

L
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor