NBody.net Code Available

Friday, March 26, 2010 – 6:56 AM

I’ve dropped some of the code which makes up NBody.net to a BitBucket repository. This may not be the project’s final home but for now that’s where I’ll be dropping code for now.

Currently there are two of the core libraries:

  • NBody.DomainModel.Common – The core types and interfaces upon which the system is build.

    There’s not much to see here although it does include a reusable Vector T4 template which will allow you to generate a Vector class for different numeric types. This is a brute force approach to get around the problems you run into when trying to create Vector<T> where T is a numeric type (see Generic Operators and Generic Numerics). The advantage of T4 templates is there’s no performance hit associated with the other approaches. It’s also not nearly as clever of course.

  • NBody.DomainModel.FSharp – Two integrators written in F#.

    A Forward Euler integrator and a wrapper for it which implements a Barnes-Hut tree code. I’ve blogged about this before. It’s an Octree implementation in F# which uses the asynchronous computations feature to scale across multiple cores.

Currently this code runs against Visual Studio 2008 SP1 and the F# October 2009 CTP. As soon as VS 2010 ships I’ll be upgrading to that.