exsp4e/exercice_48d64b1ce677emaster
exercice_4
README.md
Readme exercice 4
code by Marti Bosch (marti.bosch@epfl.ch) and Marc Schwaerzel (marc.schwaerzel@epfl.ch)
Exercise 1
Exercise 2
2.2 We used shared pointers for the pybind of 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 --> reread class notes and implement them.
Exercise 3
created bind for csvwriter, evol.setNsteps, evol.setDumpFreq and evol.evolve...
Instructions to run the code
To run the code follow the instructions:
- Create a new directory in the exercice_4 directory and go into that folder:
$ mkdir build $ cd build
- Check whether your paths are set correctly
$ ccmake ../
- Compile the code:
$ cmake ../ $ make
- Find an input file and move it into our current build file:
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)
- Make a folder to store the ouputs files
$ mkdir dumps
- 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)