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:
CREATE-LOAD
is a function. A function cannot be nested into another function.CONCENTRATED
is a branch. A branch is always found under a function or under another branch and may not be unique. It details how the function must behave.NAME: MY_LOAD
is a keyword with an assigned value. A keyword may be found under a branch or directly under a function.
And there are some rules that need to be followed.
- A function must always be positioned at the 0-indentation level.
- The lines nested inside a function (or branch) must be indented compared to this function (resp. branch). Otherwise, the function (resp. branch) will be considered as empty and may result in an error. For instance, in the following example,
FORCE
,MOMENT
andON-NODES-FROM
will not be understood as being part of theCONCENTRATED
branch:
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
- The indentation level inside a function or branch must be consistent. For instance, this is not valid:
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
- However, you are free to choose the indentation increment for each level (1 space, 2 spaces, …).
- Keyword-value pair must be delimited by a semicolon
:
- List values must be delimited by a comma
,
- If the first non-blank character of a line is
#
, the line is considered as comment and will have no effect.
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:
- object names should contain only ASCII characters,
- object names must not start with and underscore
_
. - object names must be shorter that 40 characters.
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
.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.