Skip to content

Render Command

Usage

xfds render --help
Usage: xfds render [OPTIONS] [DIRECTORY] COMMAND [ARGS]...

  Render an FDS template file into scenarios.

Arguments:
  [DIRECTORY]  Directory containing pbd.yml configuration file.  [default: .]

Options:
  --help  Show this message and exit.

  Developed by pbd.tools

Description

The xFDS render command converts template input files into usable modeling files. From a given directory (or the current directory if not specified), xFDS will traverse up the file system until it finds a pbd.yml configuration file. It then parses the contents of the configuration file and generates a model for each set of parameters.

Each input file specified in the configuration file will be treated like a template. The templates will be processed with the data specified in the configuration file and placed in an output directory.

For example, the configuration file below expects two files to be located in the same directory as the configuration file: model.fds and model.pbs. It recognizes that a single parameter is set.

examples/pbs/pbd.yml
1
2
3
4
5
6
7
8
xfds:
  render:
    - name: using_{{n}}_nodes
      files:
        - model.fds
        - model.pbs
      parameters:
        n: [4, 8, 12]

The two input files are defined in a way that uses the n parameter from the configuration file. The model.fds template is a simple file that just creates n meshes placed next to each other in the x-direction. Meahwhile, the model.pbs template is a partial PBS file showing how the nodes specifications can be altered based on the number of processors required (assuming 1 processor per mesh).

examples/pbs/model.fds
1
2
3
4
{% for ix in range(n) %}
{% set xb = ix, ix + 1, 0, 1, 0, 1%}
&MESH XB={{ xb|xb }}, IJK={{ xb|ijk(0.25) }}
{% endfor %}
examples/pbs/model.pbs
1
2
3
4
#PBS -l nodes=
{%- if n|node(ppn=8, mode='full') %}{{ n // 8 }}:node:ppn=8{% endif %}
{%- if n|node(ppn=8, mode='both') %}:{% endif %}
{%- if n|node(ppn=8, mode='part') %}1:node:ppn={{ n % 8 }}{% endif %}

xFDS will process each of the templates and place them in a directory ./output/using_{{n}}_nodes where {{n}} is replaced by the parameter n. Each model is placed in its own directory where the name matches the input files.

Tip

While xFDS will treat every specified file as a template, if there is no template syntax defined, the file will be copied over to the output directory and be given the same base name as the model file. This is useful for having consistent Smokeview scripts, Smokeview ini files, or other files for each model.

Warning

xFDS will use the name defined in the configuration file and match the file extension from the template file. This is how model.fds gets renamed to using_{{n}}_nodes.fds in the output.

If you are using the &CATF feature in FDS, make sure the OTHER_FILES do not have an .fds file extension. Use a .txt or .data extension instead if you need to use this feature.

You can have multiple .fds files in a project as long as they're specified as different models.

Files in output/using_4_nodes:

examples/pbs/output/using_4_nodes/using_4_nodes.fds
1
2
3
4
&MESH XB=  0.000,  1.000,  0.000,  1.000,  0.000,  1.000, IJK=4,4,4
&MESH XB=  1.000,  2.000,  0.000,  1.000,  0.000,  1.000, IJK=4,4,4
&MESH XB=  2.000,  3.000,  0.000,  1.000,  0.000,  1.000, IJK=4,4,4
&MESH XB=  3.000,  4.000,  0.000,  1.000,  0.000,  1.000, IJK=4,4,4
examples/pbs/output/using_4_nodes/using_4_nodes.pbs
1
#PBS -l nodes=1:node:ppn=4

Files in output/using_8_nodes:

examples/pbs/output/using_8_nodes/using_8_nodes.fds
1
2
3
4
5
6
7
8
&MESH XB=  0.000,  1.000,  0.000,  1.000,  0.000,  1.000, IJK=4,4,4
&MESH XB=  1.000,  2.000,  0.000,  1.000,  0.000,  1.000, IJK=4,4,4
&MESH XB=  2.000,  3.000,  0.000,  1.000,  0.000,  1.000, IJK=4,4,4
&MESH XB=  3.000,  4.000,  0.000,  1.000,  0.000,  1.000, IJK=4,4,4
&MESH XB=  4.000,  5.000,  0.000,  1.000,  0.000,  1.000, IJK=4,4,4
&MESH XB=  5.000,  6.000,  0.000,  1.000,  0.000,  1.000, IJK=4,4,4
&MESH XB=  6.000,  7.000,  0.000,  1.000,  0.000,  1.000, IJK=4,4,4
&MESH XB=  7.000,  8.000,  0.000,  1.000,  0.000,  1.000, IJK=4,4,4
examples/pbs/output/using_8_nodes/using_8_nodes.pbs
1
#PBS -l nodes=1:node:ppn=8

Files in output/using_12_nodes:

examples/pbs/output/using_12_nodes/using_12_nodes.fds
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
&MESH XB=  0.000,  1.000,  0.000,  1.000,  0.000,  1.000, IJK=4,4,4
&MESH XB=  1.000,  2.000,  0.000,  1.000,  0.000,  1.000, IJK=4,4,4
&MESH XB=  2.000,  3.000,  0.000,  1.000,  0.000,  1.000, IJK=4,4,4
&MESH XB=  3.000,  4.000,  0.000,  1.000,  0.000,  1.000, IJK=4,4,4
&MESH XB=  4.000,  5.000,  0.000,  1.000,  0.000,  1.000, IJK=4,4,4
&MESH XB=  5.000,  6.000,  0.000,  1.000,  0.000,  1.000, IJK=4,4,4
&MESH XB=  6.000,  7.000,  0.000,  1.000,  0.000,  1.000, IJK=4,4,4
&MESH XB=  7.000,  8.000,  0.000,  1.000,  0.000,  1.000, IJK=4,4,4
&MESH XB=  8.000,  9.000,  0.000,  1.000,  0.000,  1.000, IJK=4,4,4
&MESH XB=  9.000, 10.000,  0.000,  1.000,  0.000,  1.000, IJK=4,4,4
&MESH XB= 10.000, 11.000,  0.000,  1.000,  0.000,  1.000, IJK=4,4,4
&MESH XB= 11.000, 12.000,  0.000,  1.000,  0.000,  1.000, IJK=4,4,4
examples/pbs/output/using_12_nodes/using_12_nodes.pbs
1
#PBS -l nodes=1:node:ppn=8:1:node:ppn=4