Skip to content


The Tolosa-lib library provides a base of input informations shared by all Tolosa models. These inputs will be detailed in the following paragraph, however the inputs specific to each Tolosa model will be defined in the model's tab.

To be able to set the required inputs, one has to fill an input.txt file out. This file should be placed in the same directory as the Tolosa executable.

The following paragraphs will first present the inputs' implementation in the code, the structures' usage, and then the available input parameters that can be filled out in the input.txt file.


For a usage example of the input.txt file, one can go to Tolosa-sw/Inputs.

Inputs' implementation in Tolosa-lib

The Command Line Interface cli structure encapsulates all the simple inputs and all the group of simple inputs. The inputs are first loaded from the input.txt file and can be overridden from the command line.

Each input has a name, a default value, a switch, a kind (real, integer, character) and an eventual manual.

The cli structure contains these inputs in a list of arguments arg(:). Each argument needs to be initialized by calling the add procedure. This routine enables one to define a new argument in the argument list by its name, and potentially its default value, its kind, its switch (the name used in the command line to override its value), and its manual.

type(cli) :: input


call input%add( name = 'mesh_name' , kind = ctype , default = 'mesh.msh' )

When the new argument is defined, one can get its value(s) from the input.txt file by calling the get procedure.

character(len=128) :: mesh_name

call input%get( name = 'mesh_name' , value = mesh_name )

Overriding arguments from the command line interface

./exe -nx 1000 -ny 100 -ts 1.

If an argument is written in the command line, the get procedure will give priority to the value in the command line. The input arguments read in input.txt are overridden.

One can initialize an argument and get its value(s) by only calling the add_get procedure.

type(cli) :: input
character(len=128) :: mesh_name


call input%add_get( name = 'mesh_name' , kind = ctype , value = mesh_name , default = 'mesh.msh' )

Print all the arguments and their parameters

One can call the print procedure to print all the arguments' parameters.


Available input parameters

Tolosa has already defined arguments that are read from the input.txt file. The existing arguments allow one to configure the mesh, the numerical and physical parameters and output options.

Input keys

The available input keys with their signification and usage are detailed in the following table :

Input option Description Option Type Default Value Values
mesh_type Mesh type character basic basic: Create carthesian mesh from input.txt arguments
gmsh : Gets mesh from GMSH mesh file
mesh_name Mesh file name character mesh.msh
part_strat Scotch Partition Strategy character seq
nx Number of nodes in x direction integer 101
ny Number of nodes in y direction integer 101
lx Lenght of computational domain x horizontal direction double 1.
ly Lenght of computational domain y vertical direction double 1.
bc_N Boundary Condition North character wall
bc_S Boundary Condition South character wall
bc_W Boundary Condition West character wall
bc_E Boundary Condition East character wall
temp_scheme Temporal scheme character euler euler or 1
rk2 or 2
rk3 or 3
spatial_scheme Spatial scheme character first low_mach (lm)
low_mach_dmp_rt (lm_dmp_rt, lmdmprt)
rusanov (r)
rusanov_twisted (rt)
spatial_order Spatial order character 1 1 : without MUSCL
2 : with MUSCL
dt Time step double 1.d15
adapt_dt Adaptive time step option integer 1 1 : Adaptive time step
other : Constant time step
cfl CFL Value double 0.5
time_format Time format character classic classic
ts Simulation Time (in seconds) double 0.
simu_time Simulation Time (interpreted string) character null with X an integer :
X days
X hours
X minutes
X seconds
X(equivalent to X seconds)
start_date Initial date (mandatory if time_format = julian or julian_cnes) double -1.
end_date Final date double -1.
dtw Time step to extract Result Files double 1.d15
dtp Time step to extract Post Variables double 1.d15
dt_tecplot Time step to extract Tecplot Files character null
dt_vtk Time step to extract VTK Files character null
dt_binary Time step to extract Binary Files character null
w_tecplot Tecplot Output File option integer 0 1 to 9: Binary File with Partitionned Connectivity
10 to 19: Binary File with Origin Connectivity
w_gnuplot Gnuplot Output File option integer 0
w_python Python Output File option integer 0
w_bin Binary Output File option integer 0 1: One Binary Output File per time step
2: One Binary Output File containing all time steps
w_exact Exact Solution Output File option integer 0
w_norm Error Norms Computation option integer 0
verbose Verbosity Level integer 1 >0: Verbosity activated with level 1, 2, >= 3


  • If mesh_name is given and the file exists, mesh_type is ignored. The mesh file is read.
  • The simulation time can be specified in three ways :
    • ts : in seconds
    • simu_time : interpreted string with days, hours, minutes, seconds units
    • start_date and end_date : if time_format = julian or julian_cnes
  • If time_format = julian_cnes or julian, start_date is mandatory. end_date is never mandatory ; however, if it is specified, the priority is given for end_date over simu_time or ts.

Default parametrization file

The following example of input.txt file sums up the keys with their default value.

!  Mesh parameters
    mesh_name           =   your_mesh.msh
    part_strat          =   seq
!  Schemes parameters
    temp_scheme         =   euler              ! Temporal Scheme
    spatial_scheme      =   first              ! Spatial Scheme
    spatial_order       =   1                  ! Spatial Scheme Order
    adapt_dt            =   1                  ! Activate Adaptive Time Step
    cfl                 =   0.5                ! CFL number in case of Adaptative Time Step
!  Simulation parameters
    ! Time - Date
    time_format         =   julian_cnes ! Time format choice (classic, julian, julian_cnes)
    start_date          =   22548       ! Initial date in time format
    simu_time           =   5 days      ! Formatted Simulation Time (seconds, minutes, hours, days)
    ! Output
    dtw                 =   1.d15      ! Result File    Time Step
    dtp                 =   1.d15      ! Post-Treatment Time Step
    dtb                 =   -1.
    w_tecplot           =   0
    w_vtk               =   0
    w_bin               =   0
    w_gnuplot           =   0
    w_python            =   0
    w_exact             =   0
    w_norm              =   0
    w_post              =   0
    verbose             =   1            ! Verbosity Level


Keep in mind that the library is a set of tools. Therefore, to solve a specific numeric model other input informations need to be provided. These input informations and their keys will be detailed in the corresponding page.

Back to top