Your final project files should be copied to a directory created in your home
directory on NIC5 named project-final
before 03/01/2024 23h59:
mkdir ~/project-final cp -r directory-were-you-code-is/* ~/project-final/
Don't forget that several datasets are available and that we will test your code on new input datasets.
The oral exam will take place in room 1.21 of the Montefiore Institute (B28) according to the following schedule:
You should prepare a 10 min presentation to present your results. Focus on analyzing your results, not on generic reminders. Structuring your presentation according to the Instructions section of the project description is recommended. Be prepared to answer questions individually, to modify and recompile your code on the fly, and to run your code on the NIC5 cluster during the exam.
The exam is face-to-face but we will ask you to share your screen on Teams using this link, so make sure to have Teams installed on your computer before the exam.
project-intermediate
:
mkdir ~/project-intermediate cp -r directory-were-you-code-is/* ~/project-intermediate/
Note: the module load Info0939Tools
command appears
repeatedly throughout this document before the invocation of a tool used
for the project. This command only has to be run once per session.
Once you are connected to NIC5, you can retrieve the serial code by running the following commands:
module load Info0939Tools
get_info0939_project
This command will copy all the relevant files in a directory named
project_info0939
. If a directory with this name already exists,
the files will we be placed in a directory named
project_info0939-1
.
module load GCC cd project_info0939 gcc -O3 -o fdtd fdtd.c -lm
This will generate an executable named fdtd
. You can test the
executable by running one of the simple (and small) examples:
cd example_inputs/simple3d ../../fdtd param_3d.txt
This simple example should run in approx. 1 minute and will produce 4 files:
out_p.dat
, out_vx.dat
, out_vy.dat
and out_vz.dat
.
The data2audio
tool allows you to generate an audio file from
your output pressure files. Basic usage is
module load Info0939Tools
data2audio -i input_pressure_data -x xcoord -y ycoord -z zcoord
The command above will extract the pressure from the file
input_pressure_data
at the point with coordinates x
,
y
and z
, and produce a file named
output.mp3
. The name of the output file can be specified using
the -o output_name.mp3
option.
If the duration of the audio file is too short, most players will refuse to
play it. In this situation where the simulation time is very short (which is
the case for the simple example param_3d.txt
), you can use
the --repeat numreapeat
option to repeat the pressure
data numreapeat
times. The tool will print a warning suggesting
you to use this option if the audio file duration is inferior to 2s.
All available options can be obtained using the --help
command
line switch:
$ data2audio --help Usage: data2audio [OPTIONS] -x or --x COORD the x coordinates of the point to extract -y or --y COORD the y coordinates of the point to extract -z or --z COORD the z coordinates of the point to extract -i or --input INPUTFILE the data file from which the value should be extracted -o or --output OUTPUTFILE the path to the output audio file -r or --repeat NUMREPEAT reapeat the input data NUMREPEAT times. Use this option if the input is very short. --normalize-loudness normalize the (perceived) loudness of the output audio file. Use this option if input the volume is low.
You can use the data2gmsh
tool to convert a data file to a Gmsh
file for vizualization. Basic usage of the tool is as follows:
module load Info0939Tools
data2gmsh input_data
The command above will produce a file with name full.msh
. This
can be opened with Gmsh.
For large files, it is recommended to convert a cut instead of the full
data. This can be done by using -cutx coordx
, -cuty
coordy
or -cutz coordz
option which will produce a file
with name cutx.msh
, cuty.msh
and cutz.msh
respectively.
$ data2gmsh -h Usage: data2gmsh [option] file(s) Option can be -cutx valx: to extract data on plane x = valx -cuty valy: to extract data on plane y = valy -cutz valz: to extract data on plane z = valz If no option is given, extract the full data The output .msh file can be opened with Gmsh (https://gmsh.info)
You can use scripts to automate all the operations in Gmsh: either using Gmsh's built-in scripting language (".geo" files), or using Python or Julia.
For example, let us assume that you want to open multiple .msh
files at the same time, apply the same visualization range to all of them, and
only show the scale bar for the first one. You can open all
the .msh
files using the File->Open
menu, then merge
the following script with File->Merge
:
Mesh.SurfaceEdges = 0; Mesh.SurfaceFaces = 0; Mesh.VolumeEdges = 0; For i In {0:PostProcessing.NbViews-1} View[i].RangeType = 2; // custom range View[i].CustomMin = -1; View[i].CustomMax = 1; If (i == 0) View[i].Name = "Ma jolie vue : pression en Pa"; Else View[i].ShowScale = 0; EndIf EndFor
On the command line you could achieve the same result with:
$ gmsh -open file1.msh file2.msh file3.msh myscript.geo
geninput
utility can be used to generate inputs with different
grid sizes. It takes 2 parameters:
$ geninput --help Usage: geninput [OPTIONS] -s or --size SIZE an integer value used as the problem size multiplier (default: 1) -t or --type TYPE the problem type which can be simple or slit (default: simple)For example, to generate an input for the "slit" system with a grid 4 times the size of the base grid, you can use the following commands:
$ mkdir slit4x && cd slit4x $ geninput --type slit --size 4 Type of input: slit Size multiplier: 4 Output parameter file: param_slit_4x.txt [SUCCES] Input files createdYou can then use the generated
param_slit_4x.txt
as input parameters
for your application.
You can generate an input data file from an audio file using the
audio2input
tool. Basic usage is as follows:
module load Info0939Tools
audio2input -i input_audio_file
The command will produce a file with name in_audio.dat
that you
can then use as an input parameter for your simulation. For example:
audio in_audio.dat 0.5 0.5 0.5
The name of the output file can be specified using the
-o output_name.dat
option. A list of the available options can be
obtained by invoking the tool with the --help
command line switch:
$ audio2input --help Usage: audio2input [OPTIONS] -i or --input INPUT the audio file to convert to audio input -o or --output OUTPUT the file to which the input audio will be written to