# Readme exercice 3 code by Marti Bosch (marti.bosch@epfl.ch) and Marc Schwaerzel (marc.schwaerzel@epfl.ch) ## Exercise 1 The particle objects are organised in the folowing way: * The MaterialPoint, PingPongBall and Planet object inherit from the Particle class. Their respective factories inherit from the PatriclesFactoryInterface. * The different compute classes inherit from the mother Compute class. In our exercice, we will use the MaterialPoint object that inherits from Particle and will use the ComputeTemperature that inherits from compute. We will also use the Matrix and the FFT modules in order to compute our propagation of the heat. Matrix will treat all operations in relation with matrices and fft will compute the fast fourrier transforms. ## Exercise 2 ## Exercise 3 ## Exercise 4 ### 4.3 The test for volumetric heat is still failing. We have tried to follow the system evolution with Paraview but we have not been able to find where numbers go wrong. ### 4.4 The boundary conditions of the temperature fields have been set to 0 in the `compute_boundary.hh` and `compute_boundary.cc`. A function that sets the minimum of the temperatures array (borders) to 0 has been created. ### 4.5 See the section below to run the code with output for paraview. ---- ## Instructions to run the code To run the code follow the instructions: 1) Create a new directory in the exercice_3 directory and go into that folder: $ mkdir build $ cd build 2) Check whether your paths are set correctly $ ccmake ../ 2) Compile the code: $ cmake ../ $ make 3) Then run as follows $ ./particles --help Usage: ./particles nsteps dump_freq input.csv particle_type timestep particle type can be: planet, ping_pong, material_point In order to generate the initial heat distribution described in exercise 4.4, the Python script `src/create_heat_distribution.py` (which requires NumPy) is used as follows: $ python generate_heat_distribution.py usage: generate_heat_distribution.py [-h] size radius_heat_source filename generate_heat_distribution.py: error: the following arguments are required: size, radius_heat_source, filename where `size` corresponds to the size of the side of the matrix (since we only consider square matrices, the side can be the number of rows or columns indiferently) and `radius_heat_source` is the parameter `R` as described in exercise 4.4 The following instructions might be used as an example to launch a simulation with dumps observable in Paraview (after compiling the code in a `build` directory as described above): $ cd exercise_3 # from the repository's root $ python src/generate_heat_distribution.py 128 0.5 input.csv $ mkdir dumps $ ./build/particles 100 10 input.csv material_point 1 Then the dump files located in the `dumps` directory might be imported into Paraview, using a space character delimiter with no headers. In the `Table To Points` filter, use the fields 0, 1 and 2 as the `X`, `Y` and `Z` columns respectively, and in the posterior `Glyph` filter, set `Scalars` to the field 13 in order to visualize the distribution of the temperature.