Code Monkey home page Code Monkey logo

many_body_openmp's Introduction

N-body Simulation OpenMp

In physics and astronomy, an N-body simulation is a simulation of a dynamical system of particles, usually under the influence of physical forces, such as gravity. N-body simulations are widely used tools in astrophysics, from investigating the dynamics of few-body systems like the Earth-Moon-Sun system to understanding the evolution of the large-scale structure of the universe. Here, we have achieved the same assuming n bodies are trapped inside a cuboid of given dimensions using OpenMp.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

Prerequisites

What things you need to install the software and how to install them

OpenMp
Python >= 2.7
Mayavi
Pygame

Installing

A step by step series of examples that tell you how to get a development env running. In the terminal execute the following commands.

For installing OpenMp


$sudo apt-get install libomp-dev

For installing mayavi


$sudo easy_install pip<br/>
$sudo pip install mayavi

For installing pygame


$sudo apt-get install python-pygame

Pygame is used for 2D visualisation whereas mayavi is used for 3D visualisation.

Running the simulation

In order the simulate the environment, one needs to do the following:

Generating Trajectory file

This generates trajectory file for the specified number of threads which will be visualised.


$g++ -fopenmp many_body.cpp -o generate <br/>
$./generate number_of_threads

Specify the number of threads you want the code to run on in place of "number_of_threads".

Visualisation

Run the following commands for visualisation after trajectory file is generated.

For 2D Visualisation

$python2 visualiser.py 1

For 3D Visualisation

$python2 visualiser.py 2

Contributing

Please feel free to contribute by sending in PR and opening and handling issues.

Authors

See the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • This project was made as a part of the course High Performance Parallel Programming.

many_body_openmp's People

Contributors

aryan-jaiswal avatar manu-web avatar

Watchers

James Cloos avatar

Forkers

manu-web

many_body_openmp's Issues

Upate Readme

Update readme with theory and relevant information

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.