My Project
BK-pad

This is a specialization project looking at Numerical Simulation Comparing the Burridge-Knopoff and Burridge-Knopoff-Pad Model. Below is a description of the project.

The project looks at comparing the Burridge-Knopoff(BK) and Burridge-Knopoff-Pad(BKP) model. These are simulated by solving two differential equations through a numerical scheme. In this project the 2nd order Runge-Kutta scheme is used. See simulation page for overview of the classes and function. This can be achived by clicked the hyperlink or find "Simulation" at the bottom of the Classes page accessible through the bar above. This documentation also include all python code used for visualising, analysing and animating the simulations. These are support to the main implementation.

More information about the Simulation code, animtation and other python scripts can be found in the subpages listed in Related Pages in the bar above.

The project is based on the The Burrigde-Knopoff-Pad Model Thesis by a previous NTNU-student.

Folder description

How to run the main code:

The main code is the simulations used to run the BK and BKP model which is writte in C++. Here is a short guide on how to run the code. All code and documentation can otherwise be reached through Classes and Files in the bar above.

Compile and run c++ code

To run the code it is required that CMake and Make is installed. Resources online will tell you how to install these. The required libraries must be installed before compiling(see the Libraries section below).

$ cd <path_to_project_folder>
$ cmake .
$ make
$ ./bin/<compiled filename>

If you want to run with gdb debugging options, run

$ cmake -DCMAKE_BUILD_TYPE=Debug .

If you want to run with locally linked libraries. Which can be hardcoded in the CMakeFile in src/alph. This is an option when the compiled version needs to be run on a computer without rights to install the required packages.

$ cmake -DLOCAL:BOOL=true .

as the first command.

Generate doxygen documentation(html)

Please check you have the following packages installed, if not the doxygen set-up might fail or parts of the output will be different than expected.

If the documentation has not been created in the html folder or needs to be updated, run the below command from the parent directory.

$ doxygen BK-pad.conf

the produced documentation can then be opened in the preffered browser. Example below is given with firefox.

$ firefox html/index.html

If generation of latex documentation is enabled this can be found in the folder latex. To view the documentation as a pdf simply write

$ make pdf

from the latex folder.

Libraries

Eigen(old code from previous thesis)

To install the Eigen package you need to pull a repository to a folder you have access to. At this time (18.09.2018) this can be found at eigen git repository. Then it is pratical to make a environment variable, so that CMake will recognise it

export EIGEN3_INCLUDE_DIR=<path_to_eigen_local_repository>

Armadillo

I have used Ubuntu when programming, but should work on Windows and Mac. More information about different installations can be found here. For documentation go to the documentation site. If you use ubuntu you can use the prebuilt armadillo package.

Nice commands

ldd

Lets you see the dependencies for an executable, ex; go to the bin/ folder and do ldd readParameters.