Git Product home page Git Product logo

barnes-hut's Introduction

This is a threaded implementation of the Barnes-Hut algorithm, as it would need
to be implmented if I were in Analysis of Algorithms. Meant to give me
experience for when I try to do something similar (unless this works out to be
what I was thinking the fast multipole method was) in Universum Meum.

Compile:
	To compile, you will need the Qt library for threading support
	To compile without SFML GUI:
		make
	To compile with SFML GUI:
		make gui=yes

	To switch between GUI/non GUI versions you must
		make clean between them
	It is possible to run the GUI compiled version without opening any windows

Run:
	./bin/barnes-hut [filename] [tau] [arg4] [arg5]
	If you do not specify a file containing the initial particle descriptions,
	this program will prompt you to spceify the file on stdin. If you do not
	specify a tau value, 0.5 will be assumed.

	arg4 is a special arg that makes the program print the particle system after
	running the Barnes-Hut algorithm to stdout

	arg5 is a special arg that makes the program display the quadtree after
	running the Barnes-Hut algorithm if it was compiled with gui=yes

	When run this way, this program creates 4 worker threads to split up the work
	of applying the Barnes-Hut algorithm to particles in the system.

	-- THIS IS NOT SUGGESTED FOR END USERS --
	If any argument after tau is "-t", then the program will run a test of the
	root mean square error.
	Run this way, the program currently tries to divide the problem space
	and do it in chunks that are saved in between. Each calculation uses the
	multithreaded Barnes-Hut algorithm for speed.
	-- THIS IS NOT SUGGESTED FOR END USERS --

Input/output format:
	Input format should be a series of lines with three floats on each line. The
	first float will be used as the x, the next y, and the final will be mass.
	Technically, white space doesn't matter but it looks better ;)

	The output will be the same as the input, except on each line the
	instantaneous x and y forces will be appended

Warning:
	I haven't done much file IO, so don't run this on something you don't want to
	turn into a radioactive sheep-cheese. (it has been tested repeatedly, and it
	hasn't done this up to this point, still, don't run it on anything not in the
	right format)

License:
	GPL3, see COPYING

Notes:
	Pay attention to compiler warnings about using == and != on floating point
	values if you ever make something like this!

barnes-hut's People

Contributors

jachapmanii avatar

Stargazers

Srinidhi Krishna avatar  avatar amelie avatar Sho Hirose avatar Chris Mc avatar Max Bo avatar Bobby Barjasteh avatar Xiuxia Zhang avatar  avatar  avatar evandrix avatar

Watchers

evandrix avatar  avatar James Cloos avatar Artyom avatar

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.