Table of Contents

3.3. Input file

To instruct SesamX how to behave, you have to write an input file containing the actions to perform. This file must be properly formatted, and needs to follow some rules to be correctly understood by SesamX. The aim of this page is to provide you the knowledge about how to write proper input files, as well as how to submit them to SesamX.

Input file format

The Sesamx input file syntax follows a simplified derivation of the YAML format. It consists of a tree-structured format which serves 2 objectives: it encourages the user to keep the input file clean and easy to read, and it allows efficient reading and writing by a computer program.

An input file is made of function calls following one another. Each function has a specific scope and tells SesamX what needs to be performed. Example of a function call:

CREATE-LOAD  
  NAME: MY_LOAD  
  MODEL: MY_MODEL
  CONCENTRATED  
    FORCE: 10000.,0.,0.  
    MOMENT: 0.,0.,0.
    ON-NODES-FROM: LOAD_SELE
  # This is a comment line

This example consists of a CREATE-LOAD function. This function is used to create a loading case on the model MY_MODEL. It instructs SesamX to assign a concentrated force vector (given by the value of FORCE) on each node of the selection LOAD_SELE. We define some vocabulary:

And there are some rules that need to be followed.

CREATE-LOAD  
  NAME: MY_LOAD  
  MODEL: MY_MODEL
  CONCENTRATED  
  FORCE: 10000.,0.,0.  
  MOMENT: 0.,0.,0.
  ON-NODES-FROM: LOAD_SELE
  # This is a comment line
CREATE-LOAD  
  NAME: MY_LOAD  
  MODEL: MY_MODEL
  CONCENTRATED  
    FORCE: 10000.,0.,0.  
      MOMENT: 0.,0.,0.
    ON-NODES-FROM: LOAD_SELE
  # This is a comment line

Remark: a common pitfall is to use tab-indent instead of space-indent. You should always use space-indent.

So far we have exposed function, branch and keyword formatting. The last element to mention is the keywords list. Some functions or branches may authorized a list of repeated keywords. For instance the ADD-MESH function:

ADD-MESH 
  MODEL: MY_MODEL
  NODES
    - ID: 1  POINT: 0.,0.,0.
    - ID: 2  POINT: 1.,0.,0.
    - ID: 3  POINT: 0.,1.,0.

When defining nodes on a mesh we can provide a list of ID and POINT keywords, each one defines a new point. A new list element must start with an hyphen '-' and must be indented compared to the parent branch or function, as shown in the previous example.

Input file characters restrictions

SesamX lets you choose your own names for defining the various objects of the model (loading cases, solutions, …). However, there are restrictions about the characters that you can use:

Remark: the SesamX input file is case sensitive.

Notepad++ syntax highlighting

The SesamX installation archive comes with the SesamX user language for Notepad++. It provides syntax highlight for SesamX input files opened in Notepadd++. For more information about the installation procedure, you can consult the SesamX installation procedure.

Once installed, the previous example will display as follows in Notepad++:

Submit an input file to SesamX

The information given below assumes that SesamX was installed at the root of the E drive. The runSesamX.bat script is then located at E:\SesamX\runSesamX.bat. And we assume that the current working directory is E:\SesamX\batch, and contains the SesamX input files.

To submit a SesamX input file, you have to call runSesamX.bat with the path to the file as the first command line argument:

E:\SesamX\batch>..\SesamX\runSesamX.bat 01_INPUT_FILE.sx

You can submit multiple files at once. They will be executed one after the other:

E:\SesamX\batch>..\SesamX\runSesamX.bat 01_INPUT_FILE.sx  02_INPUT_FILE.sx

For each run, SesamX will produce a .out file describing what was understood and performed. This file will be written to the output directory. By default this directory is the same as the directory containing the input file. Using the option -o, you can force SesamX to use another directory. For instance:

E:\SesamX\batch>..\SesamX\runSesamX.bat -o "..\outputs" 01_INPUT_FILE.sx  02_INPUT_FILE.sx

Remark: when you import data (mesh, selection, …) from a .med file or Abaqus .inp into a SesamX function, you can provide a relative path to this data. This path is understood relative to the directory containing the SesamX input file that your are currently running.


See also

References