N-Body simulation: MERCURY vs. Swift

In summary: Thanks again for your question!In summary, neither of the Mercury or Swift codes are currently in development, but they may still be in use. However, Gadget is a free and widely used code for Nbody simulations that is compatible with MPI.
  • #1
zhermes
1,255
3
I've been hearing that these (MERCURY and Swift codes) are standards for N-Body evolution simulations. Neither of them seem to be currently in development however. Does anyone know if these (or others) are indeed still commonly in use?

If anyone has used either or both, could you say a few words on their features, strengths or weaknesses?

Thanks,
Z
 
Astronomy news on Phys.org
  • #2
Hi there,

Weird, I work in numerical astrophysical simulations, among which Nbody, and I have never heard of either of these codes. I would advice you (if you want to do gravitational N-body simulations) to use the code Gadget 2, which is freely available on the web. The install may be a little difficult, but it is one of the most stable codes currently used in astrophysics. It is best for large scale computations (galaxies, cosmology) and if you want to do, say, a star cluster or solar system, you might also want to consider starlab. Let me know if you have issues installing, running or interpreting the code, as I have done all of that before.

Cheers, Harcel
 
  • #3
Hi Harcel,

Thanks for your response! I was under the impression that Gadget was used primarily for SPH calculations---but I suppose that includes everything required for NBody... Naively I would still guess that Gadget is much slower than a purely NBody code---what do you think?

And I actually, just yesterday, tried to install Gadget---but I couldn't even get the necessary packages together on my MacBook Pro (snow leopard). It seems I need FFTW2.xxx for MPI compatibility, but FFTW2.xxx doesn't like my 64bit OpenMPI (included with the OS)... What type of system are you running on? Is it even worthwhile installing Gadget on a laptop, or is that too slow for even simple test cases?

Thanks very much!
Z
 
  • #4
Hi!

So, yes, Gadget does pure Nbody, if you have zero SPH particles, and then it is not at all slower than pure Nbody codes (on the contrary, most Nbody codes don't do trees for the long range gravity). I have installed it on my laptop and desktop (both linux). I have not yet tried it on my MacPro.

Indeed, you need a lot of packages, that best be installed by hand, with some of the prefixes and flags set by hand, FFTW is not necessary for MPI (it in fact is used for th tree), but the installs all need to be consistent with one another. Did you follow the Gadget install manual? I had some issues with MPI and FFTW (and HDF5, but if you don't want to use that just don't install it with hdf5 capabilities). I think I used mpich2 instead of OpenMPI, but I am not sure about that. Also, OpenMPI should just work, but maybe you need some flags in an installation by hand (rather than the default using Fink or similar software).

If you follow the gadget install manual in the right order, and you get stuck somewhere, the error message usually is helpful... Give me some details if it doesn't work!

Good luck!
 
  • #6
You may also want to look into http://lca.ucsd.edu/software/enzo/v1.0.1/. It's rather simple to code, and uses a grid scheme instead of calculating particles by themselves (it calculates densities and such of each of the grid cells and you can assign subgrids for areas that you need more resolution, like for hydrodynamics towards the center of the galaxy, or something). Enzo comes with some examples, and it has a pretty good documentation. Haven't worked much with Gadget, just GadgetViewer (really just modified the code to make it read my binary files), but plenty of people use that as well. Different tools really, so depends on what you want.
 
Last edited by a moderator:
  • #7
I've been trying to figure out Gadget-2 for some time and I was able to run one of the examples that they give. The only problem is that I havn't been able to visualize them yet and I'm having problems reading the snapshot format when I set the output option to 2 which is the format compatible with Gadget-1.
I'm trying to use splotch4.4 but I'm not sure if I'm reading the snapshot file correctly or if I set something up wrong.

I was just wondering what visualization software or program you used for your simulations?
 
  • #8
I use a variety of tools in both IDL and Python. I use the HDF5 output format, which is useful if you have HDF5 viewers (like e.g. hdfview) for first inspection. Compiling Gadget with the HDF5 option can be a bit more cumbersome though...

My tools won't be particularly useful for you, as we use a much extended output format, which is related to all the different subgrid routines we implemented. But at the very least you should be able to read the particle data with simple HDF5 viewer tools, if you are using hdf5.
 

1. What is an N-Body simulation?

An N-Body simulation is a computational method used to study the motion and interactions of a group of particles or bodies in a physical system. It involves simulating the forces and movements of each individual body in the system over a period of time to understand how they interact with each other.

2. What is MERCURY?

MERCURY is an N-Body simulation software package specifically designed for simulating the dynamics of planetary systems. It is capable of accurately modeling the gravitational forces and interactions between multiple bodies in a system, making it useful for studying the orbits of planets, moons, and other celestial objects.

3. What is Swift?

Swift is another N-Body simulation software that is widely used in astrophysics research. It is designed for simulating the dynamics of galaxies and other stellar systems, and is particularly useful for studying the formation and evolution of these systems over time.

4. What are the main differences between MERCURY and Swift?

While both MERCURY and Swift are N-Body simulation software, they have different focus areas and capabilities. MERCURY is mainly used for simulating planetary systems, while Swift is more commonly used for studying larger stellar systems. Additionally, MERCURY uses a hybrid symplectic integrator, while Swift uses a direct integration method, leading to slightly different results.

5. Which N-Body simulation software is better?

There is no clear answer to this question as it ultimately depends on the specific research goals and system being studied. Both MERCURY and Swift have their own strengths and limitations, and it is important to choose the software that best suits the needs of the particular study. It is also common for researchers to use both programs in combination to get a more comprehensive understanding of a system's dynamics.

Similar threads

Replies
12
Views
2K
  • Classical Physics
Replies
2
Views
1K
  • Programming and Computer Science
Replies
19
Views
2K
  • Astronomy and Astrophysics
Replies
1
Views
1K
  • Astronomy and Astrophysics
Replies
6
Views
1K
  • Advanced Physics Homework Help
Replies
1
Views
1K
  • Programming and Computer Science
Replies
15
Views
2K
Replies
3
Views
1K
  • Programming and Computer Science
Replies
7
Views
2K
Replies
7
Views
4K
Back
Top