diff --git a/Homework3/README.md b/Homework3/README.md index b8e837f..1c7b769 100644 --- a/Homework3/README.md +++ b/Homework3/README.md @@ -1,44 +1,79 @@ # SP4E - Homework 3 ---- ## General Info This file provides a brief documentation and information related to the third Homework of the course "Scientific Programming for Engineers", fall 2019. This homework is done by **O. Ashtari** and **A. Sieber**. Last update: 12.11.2019 ---- ## Project Description One goal of this project is to learn and practice how to link an external library, here FFTW, to a C++ code. We use fast Fourier transforms to solve heat equation using a pseudo-spectral method. For this aim, as the second objective of the project, we extend the existing code originally written for simulating dynamics of interacting particles. Many functionalities we need have been already implemented and tested in the available code, meaning that we can trust on it as the starting point of development. ---- ## Executable Files After cloning this repository on your computer, you should build the program in a desired directory based on the `CMakeLists.txt` file in the root. To do so, inside the destination directory, you can build the executable file(s) using commands below: ``` $ cmake -DCMAKE_PREFIX_PATH= -DCMAKE_LIBRARY_PATH= -DUSE_FFT= $ make ``` where the command `cmake` is basically followed by the address of the directory where the `CMakeLists.txt` is located (denoted by ``.) Available options are as follows: * `-DCMAKE_PREFIX_PATH` specifies the path where you want the program look for headers (.h files) in. `` in the command above will be replaced by the address. * `-DCMAKE_LIBRARY_PATH` specifies the path where you want the program look for libraries (.a files) in. `` in the command above will be replaced by the address. -* `-DUSE_FFT` determines whether the program should look for `FFTW` library/header in the specified directories or not. `` can either be `ON` or `OFF`. +* `-DUSE_FFT` determines whether the program should look for `FFTW` library/header in the specified directories or not. `` can either be `ON` or `OFF`. -The executable file `particles` will be built in `/src`. Moreover, three tests `test_fft`, `test_heat` and `test_kepler` are built. The minimum requirement for CMake is the version 3.1. +The executable file `particles` will be built in `/src`. Moreover, three tests `test_fft`, `test_heat` and `test_kepler` are built. The minimum requirement for CMake is the version 3.1. ## Running a simulation: from generating initial condition to post-processing +The first step in running a simulation consist in setting up the initial conditions. This is done through the python script `input_generator.py`. By running this code, the user is asked to chose the simulation case `simulation`, the grid size `N_grid`, the half domain extend `L` in both the x and y directions and the radius of the heat source `R`. -## An overview of extending the available code +The available simulation test cases are the following: +* Uniform temperature without heat source, `uniform_temperature`. +* Uniform temperature with line heat sources, `line_source`. +* Uniform temperature with radial heat source, `radial_source`. -## Concluding discussion +As an example by running the following command line: + +``` +$ python3 -simulation line_source -N_grid 32 -L 1 -R 0.5 + +``` + +A line source simulation is initialized on a [-1;1]x[-1;1] domain on a 32x32 grid. The radial heat source is not used in this case. + +Once this step is achieved, the actual simulation can be performed. This is done by running the `particles` executable through the command line alongside a set a user-defined variables. + +``` +$ ./particles n_steps dump_freq input_file particles_type boundary_type domain_length density_heat_capacity heat_conductivity + +``` + +The arguments are introduced above represents: +* `n_steps`, the amount of time steps. Must be an integer. +* `dump_freq`, the output files dumping frequency. Must be an integer. +* `input_file`, the path to the input file generated with the `input_generator.py` script. +* `particles_types`, the type of simulation. Here the string material_point must be used. +* `boundary_type`, the boundary type. As of now, only `Dirichlet` or `Periodic` boundary conditions are implemented. +* `domain_length`, the total length of the domain in both the x and y directions. As opposed to the python script `domain_length` must be set to 2xL. +* `density_heat_capacity`, the product of the density and the heat capacity of the simulated material. +* `heat_conductivity`, the heat conductivity of the simulated material. + +The user is also asked to create a `dumps` folder where the dumped file can be stored. +The visualization of the results can be done with the `Paraview` software. To that end, the dumped files are loaded into the software. When loading the files, be sure sure to set the `field delimiter character` to a simple space and untick the `Have Headers` box. The `Table To Points` filter allows to convert the data points to coordinates. The x-coordinates correspond to the `field 0`, the y-coordinates correspond to the `field 1` and the z-coordinates correspond to the `field 2`. Visualization of the temperature field is achieved by setting the `Coloring` option of the `field 13` whereas the `field 14` shows the heat source distribution. Additionally, a smoother visualization can be achieved using the `Point Volume Interpolator` filter. +## An overview of extending the available code + + +## Concluding discussion diff --git a/Homework3/lib/googletest b/Homework3/lib/googletest index 200ff59..78fdd6c 160000 --- a/Homework3/lib/googletest +++ b/Homework3/lib/googletest @@ -1 +1 @@ -Subproject commit 200ff599496e20f4e39566feeaf2f6734ca7570f +Subproject commit 78fdd6c00b8fa5dd67066fbb796affc87ba0e075