UQLink Module - DIANA FEA

Dear UQlab Support Community

Is with great enthusiasm that I am writing to you.
Having now discovered some of the valuable features of UQlab, I am trying to create a wrapper between DIANA FEA and UQlab trough UQLink. Unfortunately, so far I have failed in my attempts.
I have seen the examples provided by you, regarding Abaqus and OpenSees. Thus, I was wondering if there is any similar example you are working on for DIANA FEA or any relevant source, other than the manuals, that you could share with me for additional support.

Looking forward to hearing from you.

Thank you very much for providing UQLab
Best wishes,
Neryvaldo Galvão

Hi @Neryvaldo_Galvao,

Welcome to UQWorld! :smile:

I don’t think there has been a specific example here that connects UQLab with DIANA FEA .

But perhaps you could be more concrete with your question:

  • What did you try so far?
  • Where or how did your attempts fail? (error messages?)

This way, maybe people would be able to help you better :smiley:

Hi @damarginal,

Thank you for your reply and the warm welcome :smiley:

First I must say this is my first week working with UQLab.

Right now, I am trying to connect UQlab with DIANA FEA based on the examples provided for OpenSees, with the following script lines:

ModelOpts.Command = ‘diana output_1 GeomDef.dat Analysis.dcf filosfile.ff’
ModelOpts.ExecutablePath = ‘C:\Program Files\Diana 10.4\bin’
MoptsOpts.ExecutionPath = ‘C:\Users\neryv\OneDrive - Universidade do Minho\Documentos\Docs UM\2 - PhD\Case Study\UQlab\Test_Diana’
ModelOpts.Template = {‘GeomDef.dat.tpl’,‘Analysis.dcf.tpl’}
ModelOpts.Output.FileName = ‘output_1.tb’;
ModelOpts.Output.Parser = ‘output_tb3’

I have also defined InputOpts.Marginals.

Nevertheless, DIANA is not providing me with the requested output file causing UQlink failure when trying to read the output file through ModelOpts.Output.Parser. The analysis starts but ends right away. I have tried to run the analysis with a batch file I have previously used to run some analysis from Matlab and it works perfectly with the files generated by the UQlink.

Maybe the answer to the problem is in the batch file I used, once DIANA support suggested me to use this batch file when calling DIANA from Matlab. Additionally, I have used the batch file in ModelOpts.Command and the analysis ran as expected. The only problem is that the input files required by DIANA are not updated in the last line written in the batch file, causing the analysis to be executed always over the same initial input files.

The batch file is written as follows.

rem === Diana Environment Setup ===
call “C:\Users\neryv\OneDrive - Universidade do Minho\Documentos\Docs UM\2 - PhD\Case Study\UQlab\Test_Diana\dialogin.bat”
rem Unset the symbols added by MATLAB
set KMP_STACKSIZE=
set KMP_HANDLE_SIGNALS=
set KMP_BLOCKTIME=
rem start the diana job
diana -m output_1 GeomDef000001.dat Analysis000001.dcf filosfile.ff

Looking forward to hearing from the community

Thank you for providing UQLab
Regards,
Neryvaldo Galvão

Hi @Neryvaldo_Galvao,

Thank you very much for a detailed description of your problem!

From what I see in the batch file, it seems the last line is not parametrized.
Assuming that the batch file is called dianaBatch.bat, such that the ModelOpts would be:

...
ModelOpts.Command = 'dianaBatch.bat output_1 GeomDef.dat Analysis.dcf'
...

Now, because UQLink will change the command line arguments according to different inputs, you need to modify the last line of the batch file as follows:

...
diana -m %1 %2 %3 filosfile.ff

where %1, %2, and %3 are the positional command line parameters to DIANA, following the ones you put in the ModelOpts.Command. That is,

  • %1 (the first) the output file
  • %2 (the second): the geometry definition file (I assume)
  • %3 (the third): The analysis specification file

Because filosfile.ff is not changed, it should be kept as is in the batch file, and not in the ModelOpts.Command.

A couple additional things to note:

  • when using the batch file make sure that the following executable path is still valid:
    ModelOpts.ExecutablePath = 'C:\Program Files\Diana 10.4\bin'
    
    Because by using the batch file, the executable in ModelOpts.Command now refers to the batch file and the above option should be configured to the location of the batch file. If the batch file is also located there then there’s no change.
  • the batch file calls the executable diana assuming that the executable is in Windows PATH (you can call diana from any folder). If this is not the case, then you need to prepend "C:\Program Files\Diana 10.4\bin" to diana in the last line of the batch file (don’t forget the double quotations because there are spaces in the path).

I hope this helps!
Let me now if it does or doesn’t work :slight_smile:

Hi @damarginal

Thanks for sharing such a complete and straightforward answer to my problem.
I must say everything worked fine in my first attempt. :smiley: :smiley:

Apologies for my late reply.

Looking forward to using additional features of UQlab. Keep the great work. :+1:

Regards,
Neryvaldo