Multiple Input Files

To create multiple input files, the parameters of interest are represented by Templex variables.

By creating a simple iterative loop surrounding the new input deck, Templex writes out the necessary decks while maintaining all format requirements.

The example below shows a finite element Nastran bulk data file that has been modified to create multiple input files. In this example, the goal is to perform a design study based on modification of the z-coordinate of Grid# 143 in the model.
{GZ143 = 458.0000}
{dz = 3}
{output_file = "bulkdata"}
{str = { "_1.out", "_2.out", "_3.out"}}
{for(i=0; i<=2; i++)}
 {open output_file+str[i]}
BEGIN BULK
GRID         143     848.000  200.000  {GZ143+i*dz,%7.3f}              
GRID         145     849.508  225.000  458.000                      
GRID         165     848.000  200.000  430.750                      
GRID         169     849.508  225.000  430.750                      
CQUAD4       125    1     143      165      169     145              
 {close}
{endloop}
This template produces three separate files containing Nastran bulk data decks with z-coordinates for Grid# 143 of 458.000, 461.000, and 464.000.
Figure 1. Bulk Data Deck #1
BEGIN BULK
GRID         143     848.000  200.000  458.000              
GRID         145     849.508  225.000  458.000                      
GRID         165     848.000  200.000  430.750                      
GRID         169     849.508  225.000  430.750                      
CQUAD4       125    1     143      165      169     145              
Figure 2. Bulk Data Deck #2
BEGIN BULK
GRID         143     848.000  200.000  461.000              
GRID         145     849.508  225.000  458.000                      
GRID         165     848.000  200.000  430.750                      
GRID         169     849.508  225.000  430.750                      
CQUAD4       125    1     143      165      169     145              
Figure 3. Bulk Data Deck #3
BEGIN BULK
GRID         143     848.000  200.000  464.000              
GRID         145     849.508  225.000  458.000                      
GRID         165     848.000  200.000  430.750                      
GRID         169     849.508  225.000  430.750                      
CQUAD4       125    1     143      165      169     145