フィルターのクリア

Creating an interface between MATLAB and MSC NASTRAN that is run on a server

32 ビュー (過去 30 日間)
Jeremy Auclair
Jeremy Auclair 2019 年 4 月 25 日
編集済み: Boby Alexander 2024 年 3 月 31 日
Hello everyone,
I am looking for a way to interface MATLAB with MSC NASTRAN that is run on a server. I need to find a way to run Monte Carlo simulations on a complex model, so building a MATLAB code that could talk to NASTRAN on that external server to launch a large number of simulations and save result files automatically would be an ideal solution. But I'm not sure if it's doable.
I don't have much info on the server where NASTRAN is being used, but basically it's a supercomputer with Linux as OS, I access it through my Windows computer through Putty to access the inferface (basic terminal window) and WinSCP to exange files. Through the terminal window I can run the model by launching a DAT file, the results are then saved as a .f06 file in the same directory (which I can access with WinSCP).
I'd like to know if it's possible to do something like that (and if it is how to do it) ? If it's not possible I'll have to quickly find an alternative so if someone has faced a similar problem before I'll gladly take some advice !
Thanks in advance,
Jeremy
  1 件のコメント
Roberto Rubinacci
Roberto Rubinacci 2020 年 3 月 23 日
Hi Jeremy. I have the same kind of problem, did you find a solution?

サインインしてコメントする。

回答 (1 件)

V San
V San 2020 年 8 月 26 日
編集済み: V San 2020 年 8 月 26 日
Hi Jeremy
This is a late reply, but leaving it for others checking for something similar. This is definitely doable. Load Matlab and Nastran modules through your job submission script for the cluster (More info on job submission script here and checking info about modules here). When you submit this script, all requested modules are loaded, so that whenever Nastran is called in the Matlab code, the remote node is ready to execute (i.e. the loaded Nastran module recognizes the .bdf file and proceeds to execute). The command in the job submission script should look something like this:
module purge
module load matlab/R2018a nastran/2014.1
NOTE: You would have to check with your HPC administrator about the job scheduler they are using on your cluster. The above examples and commands may be in a different job submission format. Usually they will provide you with a sample file and you would only need to edit in details like: required modules, time and resources, account name, etc. Also, make sure you are using the software version installed in your cluster.
If you already have the Nastran input file generated, you can directly use the command below in your Matlab code. For more info and debugging, check here and here.
call_NASTRAN_BDF=[nastran ' ' [file_name '.bdf'] ' memory=estimate' ' sdir=' run_directory_name];
system(call_NASTRAN_BDF);
But in complicated analysis, probably you would need to automatically generated Nastran input files with updated parameters. You can refer to my answer here to a previous question regarding this. Hope this helps!
  1 件のコメント
Boby Alexander
Boby Alexander 2024 年 3 月 26 日
編集済み: Boby Alexander 2024 年 3 月 31 日
Dear V San
I have same problem with Jeremy. Could you explain in details how to write the 'run_directory_name' in the matlab code.
I have nastran bdf file name as test_matlab.bdf and store it in D:\Boby_Folder\PATRAN\ .
And I follow your code above like this:
call_NASTRAN_BDF=[nastran ' ' [test_matlab '.bdf'] ' memory=estimate' ' sdir=' c:\MSC.Software\MSC_Nastran\20190\bin\nastran.exe];
system(call_NASTRAN_BDF);
But it said error in this part: ' sdir=' c:\MSC.Software\MSC_Nastran\20190\bin\nastran.exe];
Matlab said invalid use of operator. How to correct this problem. Please help me. Thank you.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by