diff --git a/exercice_4/README.md b/exercice_4/README.md index 65b3274..fdf3582 100644 --- a/exercice_4/README.md +++ b/exercice_4/README.md @@ -1,52 +1,52 @@ # Readme exercice 4 code by Marti Bosch (marti.bosch@epfl.ch) and Marc Schwaerzel (marc.schwaerzel@epfl.ch) ## Exercise 1 -* 1.2 It enables us to choose from one compute depending on which particle type we choose directely from the main.py. When we enter the particle type as argument, it is overloading the createSimulation from the specific class. The method of the class called createComputes will create the right compute object. +1.2 It enables us to choose from one compute depending on which particle type we choose directely from the main.py. When we enter the particle type as argument, it is overloading the createSimulation from the specific class. The method of the class called createComputes will create the right compute object. ## Exercise 2 -* 2.2 We used shared pointers for binding the classes compute and compute_temperature in order not to desallocate when python's reference count goes to 0. A unique pointer could lead to a segmentation fault (memory allocation issues). -* 2.3 We used the method where we put setters directely in the compute_temperature.py in order to access private members from outside the class.But there is a smarter way to access private members +2.2 We used shared pointers for binding the classes compute and compute_temperature in order not to desallocate when python's reference count goes to 0. A unique pointer could lead to a segmentation fault (memory allocation issues). +2.3 We used the method where we put setters directely in the compute_temperature.py in order to access private members from outside the class.But there is a smarter way to access private members ## Exercise 3 created bind for classes and functions needed for main.py. ## Instructions to run the code To run the code follow the instructions: 1) Create a new directory in the exercice_4 directory and go into that folder: $ mkdir build $ cd build -2) Check whether your paths are set correctly +2) Check whether your paths are set correctly: $ ccmake ../ -2) Compile the code: +3) Compile the code: $ cmake ../ $ make -3) Create an input file and move it into our current build file (see exercice_3): +4) Create an input file and move it into our current build file (see exercice_3): e.g. take the input file created with generate_heat_distribution.py from exercice_3 (see README from exercice_3 to use the python function) -4) Make a folder to store the ouput files: +5) Make a folder to store the ouput files: $ mkdir dumps -5) Then run as follows +6) Then run as follows: $ python ./src/main.py arg1 arg2 arg3 arg4 arg5 where: arg1 is the number of steps (e.g. 1000) arg2 is the dump frequency (e.g. 10) arg3 is the input filename (e.g. step-00000.csv from last ex) arg4 is the particle type (e.g. material_point) arg5 is the timestep (e.g. 1)