Skip to content

Getting Started with Tolosa-lib

This guide will help you get started with compiling and running Tolosa-lib examples.

Before you begin, make sure you have:

  • A Fortran compiler (GNU Fortran or Intel Fortran)
  • Make utility
  • MPI library (for parallel execution)
  • Scotch library (for mesh partitioning)
Terminal window
git clone https://github.com/TolosaProject/Tolosa-lib.git
cd Tolosa-lib

Tolosa-lib includes several example cases that demonstrate its features.

Terminal window
make

This will:

  1. Compile all Fortran modules
  2. Link the executable
  3. Place the executable in the /bin directory

You can customize the compilation with various options:

Terminal window
# Use Intel compiler
make COMPILER=intel
# Enable debug mode
make DEBUG=yes
# Set optimization level
make OPT=3

After compilation:

Terminal window
cd bin
./exe

The bin directory should contain:

  • input.txt - Main configuration file
  • m_user_data.f90 - User-defined functions for initial/boundary conditions
# Mesh parameters
nx = 100
ny = 100
lx = 1000.0
ly = 1000.0
# Time parameters
dt = 0.1
t_end = 100.0
# Output parameters
output_frequency = 10
output_format = vtk

To run with MPI:

Terminal window
mpirun -np 4 ./exe

This will use 4 MPI processes for parallel computation.

Results are written to /bin/res/ directory in the format specified in input.txt:

  • VTK files: .vtk extension
  • Tecplot files: .plt extension
  • Binary files: .bin extension
  • CSV files: .csv extension