VS Code Aster
Features

Editing .export files

A .export file tells code_aster what to run: parameters (P lines) and input and output files (F lines). VS Code Aster edits it through a form, and also highlights and formats it as text.

Opening the form

  • Existing file: open a .export and click the pencil icon Edit export file in the editor title bar, or run Edit export file while it is the active editor. The form is filled from the file, its title reads "Edit an export file" and the main button is Save.
  • New file: run Edit export file from the Command Palette with no .export active, or New export file… in the sidebar's Quick actions. The form reads "Create a new export file", the button is Create, and it starts with:
    • name simvia;
    • simvia.comm (input, unit 1), simvia.mmed (input, unit 20) and simvia.rmed (output, unit 80);
    • time limit 300, memory limit 1024, 1 CPU, 1 MPI process, 1 MPI node.

A new file is written in the first folder of the workspace. Type a path in the name (subdir/run) to put it elsewhere; missing folders are created.

Fields

Parameters: File name (the .export suffix is added), Time Limit, NCPUs, Memory Limit, MPI NBCPU, MPI NBNOEUD, Max Base (Mo) (optional), Test list (concurrency sequential or parallel, category verification or validation, projects for a validation test) and Expected diag (optional, for example NOOK_TEST_RESU). Arrow keys step any number field.

Input Files and Output Files: one row per file with its type, name, extension and unit. Rows can be dragged to reorder them and removed with ×. Empty rows are ignored. The file name field suggests the files of the destination folder that match the type (↑/↓ to move, Enter or Tab to pick, Esc to close).

  • Inputs accept comm, mmed, nom, base, mail, libr, msh, dat. Outputs accept mmed, rmed, mess, base, mail, tab, msh, dat.
  • Units are proposed for you: the next free unit when the type is already present, otherwise the highest unit of the file rounded up to the next multiple of 10. nom files are always on unit 0 and the first mess file gets unit 6, the unit code_aster uses for messages.

Other parameters: P lines the form has no field for, as name and value rows.

Other lines: A lines and your own comments, kept as text.

Everything in the last two sections is written back on save, and each file line keeps its F or R head and its D, DC, R or RC flag while its type is unchanged, so editing a file in the form loses nothing. R lines name directories and need no extension.

Auto comments: writes the header and section comments on save (stored in the vs-code-aster.exportAutoComments setting).

Checks

Errors block saving and warnings do not. The footer counts both and scrolls to each one.

Errors:

  • "The export file name is required."
  • A parameter that is not a whole number ("<key> must be a whole number.").
  • "At least one comm input file is required."
  • A file row without type, name or extension (directories excepted), or with a unit that is not a whole number.

Warnings:

  • "Multiple files share unit N" (unit 0 excepted).
  • "No mesh file is set (mmed, mail, or msh)."
  • "No rmed output file is set."
  • Renaming the file: "Saving will rename X.export to Y.export. The original file will be deleted."

Switching tabs keeps the form as you left it. After saving, the panel closes and the file opens in a text editor.

Syntax highlighting

.export files have their own grammar: P, F and A directives, parameter names, file types, direction flags (D, R, RC), units and # comments each get a theme color.

Formatting

Format Document sorts the file into commented sections: # Simulation parameters, # Input files, # Output files, and # Unknown lines for anything else. F lines come before R lines and are ordered by type (comm, mmed, rmed, mess, nom, base, mail, libr, tab, msh, dat). Standalone comments stay with the line they precede. Saving from the form runs the same formatter.

With auto comments on, a header is added on top:

Code
# <name>.export # This file was generated using VS Code Aster... # VS Code Aster is an open-source project maintained by Simvia...

Untick Auto comments in the form, or set vs-code-aster.exportAutoComments to false, to remove the header and the section comments on the next save or format.

Comments

Ctrl+/ (Cmd+/) toggles # line comments.

Last modified on