Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

how to launch batch cases on NX Nastran?

Hi all,

 

I want to know how can I launch batch cases on NX Nastran. For example, if I have tree linear cases SOL101, just link these three cases on a batch file and launch all cases. When the first case finishes, starts the second case and when the second one finish starts the thirth and last case.

 

Thanks,

9 REPLIES

Re: how to launch batch cases on NX Nastran?

Hi Igor,

 

If you have 3 separate Nastran Input decks, you can easily start them sequentially by adding all commandlines to a batch file. Typically Nastran is configured to start the analysis in background - so you have to set the commandline flag "batch=no". Using this flag, Nastran will start in foreground - so the second job is started when the first is finished.

 

If you are working on windows, you have to generate a *.bat file, on Unix/Linux a Shell Script with the following content:

 

<path to Nastran Executable> job1.dat bat=no

<path to Nastran Executable> job2.dat bat=no

<path to Nastran Executable> job3.dat bat=no

 

Of course you can add additional commandline options (e.g. mem=..., parallel=...). The list of available Nastran commandline Options can be found in the documentation or by starting Nastran with the commandline option "help all".

 

If you are working with NX CAE, you can also add all Solutions to your NX CAE Sim File and then start all simulations from NX CAE using RMB on the SIM and select "Solve all Solutions".

 

Hope that helps

Boris

 

Re: how to launch batch cases on NX Nastran?

One clarification to Boris's note: The default behavior on Windows and Linux is different.

 

On Windows, the batch keyword is ignored and Nastran always runs in the foreground. A .bat file containing the following lines will run each of the 3 jobs sequentially:

 

<path to Nastran Executable> job1.dat

<path to Nastran Executable> job2.dat

<path to Nastran Executable> job3.dat

 

On Linux, the default is to run the process in the background (i.e. batch=yes), so the above commands would result in all 3 jobs running simultaneously. If you add bat=no as Boris indicates, then they will run sequentially.

 

Regards,

Jim

 

Re: how to launch batch cases on NX Nastran?

[ Edited ]

Hi Boris and Jim,

 

I have problems with the test of the .bat filet. The system can't locate the rute. I have includen on the .bacth file this jobs. I think that I have wrong some rute.

 

<C:\Users\rrrr\BATCH\> of0277-200-001_case_1.dat bat=no mem=4, parallel=4

<C:\Users\rrrr\BATCH\> of0277-200-001_case_2.dat bat=no mem=16, parallel=8

 

I have uploaded a .bat file as example. I want to know the .bat configuration for to scenarios.

1-scenario rapid cases 2-scenario night jobs.

 

Thanks in advance,

Solution
Solution
Accepted by topic author Igor
‎08-26-2015 04:32 AM

Re: how to launch batch cases on NX Nastran?

Hi Igor,

everything looks good in your script - you just have to remove the "<>" characters. I used them to mark the placeholder that has to be replaced by the path setting on your system. As you have blanks in the Nastran path, you will have to use quotes.

 

Your commandline in the script should look as follows:

 

"C:\Program Files\Siemens\NX 9.0\NXNASTRAN\bin\nastran64.exe" of0277-200-001_sldprt_sim1-caso_1.dat bat=no mem=4 parallel=2

 

Then you should be able to run the script.

 

Best regards

Boris

 

Re: how to launch batch cases on NX Nastran?

Hi,

 

I have a problem, actually I am trying to launch a batch file like this one,

 

The .bat file has the following code.

C:\Program Files\Siemens\NX 9.0\NXNASTRAN\bin\nastran.exe of0277-200-001_sldprt_sim1-caso_1.dat bat=no mem=4 parallel=2

 

C:\Program Files\Siemens\NX 9.0\NXNASTRAN\bin\nastran.exe of0277-200-001_sldprt_sim1-caso_2.dat bat=no mem=4 parallel=2

 

I have the following fatal error.

 

*** USER WARNING MESSAGE 333 (GETLIN)
     THE BEGIN BULK STATEMENT IS MISSING. A BEGIN BULK STATEMENT WILL BE INSERTED BY THE PROGRAM
1                                                                            AUGUST  12, 2014  NX NASTRAN  8/25/13   PAGE     1
                                                                                                                                    
0        N A S T R A N    F I L E    A N D    S Y S T E M    P A R A M E T E R    E C H O                                           
0                                                                                                                                   
                                                                                                                                    
                                                                                                                                    
     NASTRAN BUFFSIZE=8193 $(C:/PROGRAM FILES/SIEMENS/NX 9.0/NXNASTRAN/CONF/NAST9.RCF
     NASTRAN DIAGA=128 DIAGB=0 $(C:/PROGRAM FILES/SIEMENS/NX 9.0/NXNASTRAN/CONF/NAST9
     NASTRAN REAL=533200896 $(PROGRAM DEFAULT)                                       
1                                                                            AUGUST  12, 2014  NX NASTRAN  8/25/13   PAGE     2
                                                                                                                                    
0        N A S T R A N    E X E C U T I V E    C O N T R O L    E C H O                                                             
0                                                                                                                                   
                                                                                                                                    
                                                                                                                                    
     C:\PROGRAM FILES\SIEMENS\NX 9.0\NXNASTRAN\BIN\NASTRAN.EXE OF0277-200-001        _SLDPRT_
0*** DATA ERROR-UNANTICIPATED CHARACTER IN COLUMN  32
 *** USER FATAL MESSAGE 300 (CRCARD)
     THE MESSAGES ABOVE ARE FROM CRCARD.
     C:\PROGRAM FILES\SIEMENS\NX 9.0\NXNASTRAN\BIN\NASTRAN.EXE OF0277-200-001        _SLDPRT_
0*** DATA ERROR-UNANTICIPATED CHARACTER IN COLUMN  32
 *** USER FATAL MESSAGE 300 (CRCARD)
     THE MESSAGES ABOVE ARE FROM CRCARD.
     CEND       $ GENERATED BY GETLIN                                                        
1                                        * * * END OF JOB * * *
 
 
 *** USER WARNING MESSAGE 1153 (XCLNUP)
     THE NDDL FOR THIS DATA BASE HAS NEITHER BEEN CREATED NOR OBTAINED FROM THE DELIVERY DATA BASE.
     USER INFORMATION: THE DATA BASE CREATED IN THIS RUN IS TOO IMMATURE TO BE RESTARTED.
     USER ACTION: DELETE THIS DATA BASE BEFORE STARTING YOUR NEXT RUN.

Solution
Solution
Accepted by topic author Igor
‎08-26-2015 04:32 AM

Re: how to launch batch cases on NX Nastran?

Hi Igor,

 

the script file content is OK - but you are passing the script file to the Nastran solver. So Nastran takes the .bat file as an input file which is not correct. Instead of starting the ".bat" file with Nastran, you just have to directly run the bat file on the commandline.

 

Please also take care not to start the job in the installation folder of Nastran. You will not have write access to it (that's also why it is working when you start the shell as Administrator - but that is not recommendet as all result files will now be written to the Nastran Install dir).

 

So please execute the following commands in your DOS shell to start the batch file correctly:

 

cd C:\003_NX_CASES

batch_v2.bat

 

the first line will change to your working directory, the second line will start the script in this workling folder.

 

Now your skript should work correctly.

 

I saw in your second post that you had problems running Nastran from the commandline. If you Change your Working folder using the DOS "cd" command before starting the Nastran job you will have no problems (like Blas described in his post).

 

Best regards
Boris

 

 

Re: how to launch batch cases on NX Nastran?

Hi,

 

Could I execute the comand line for executing the .bat file, with another  .bat file?

I want to use windows task manager with .bat file for scheduling jobs. On main .bat file I have all my .dat jobs, but if I want to execute at night, I need to launch the command that must be on a .bat file, later I can use Windows 7/8 task manager for scheduling the . bat file execution time.

Example code for launching MS DOS command and .bat file.

 

@echo off

cd /d "c:\Program files\IIS Express" start "" iisexpress /path:"

C:\FormsAdmin.Site" /port:8088 /clr:v2.0

timeout 10 start http://localhost:8088/default.aspx pause

Re: how to launch batch cases on NX Nastran?

What I can do if I read this error message from the prompt:

 

*** USER FATAL MESSAGE (pgm: nastran, fn: main)

        jid=ofSIMULATION.dat          (command line [1])

        This file does not exist.

Re: how to launch batch cases on NX Nastran?

Hi Boris,

 

Are you familiar with a Femap bundled tool called VisQ? Couldn't that also work?

 

As far as I understand, it is free to use?

 

Juan