What does FalconIC do?

The missing link between Boltzmann codes and N-body simulations

  • Discrete sampling of phase space of any species in CLASS, CAMB, EFTCAMB and soon HiCLASS,
  • Eulerian and Lagrangian represenations of all species, free choice of frames.
  • Newtonian positions (for Gadget etc.),
  • Relativistic positions and discretized metric fields in all available gauges,
  • Varying mass and pressure for anything beyond Cold Dark Matter.
  • Implemented output formats
    • Gadget
    • Tipsy
  • Fully parallel: either OpenMP or OpenMPI, depending on your calls
  • Graphical User Interface (HTML5/Javascript based) implemented in OS X and Linux (Firefox needed for the latter)


This is the code that we release with the paper

Initial conditions for cosmological N-body simulations of the scalar sector of theories of Newtonian, Relativistic and Modified Gravity by Wessel Valkenburg and Bin Hu.

Also available as JCAP09(2015)054.
Download binary or source

If you use Mac OS, you may want to try the binary.

Download source

Or if you need no instructions and know how to extract the source file and type make, you may want to download the source and see how far you get with the compilation process. You can also clone into the git repository
How to compile FalconIC

If you have openmpi installed, then point the Makefile to the right path. If not, then leave it as it is, but beware that the first compilation may take a long time (30 minutes perhaps). After the first time it will be a matter of seconds. If make fails, first try make again. If on OS X towards the end of the make process, you get this dialog: 'codesign wants to use the "FalconIC" keychain' then leave the password field empty and click OK. Compilation has been tested on OS X and linux with: make CC=clang CXX=clang++ and make CC=gcc CXX=g++ and make CC=icc CXX=icpc or try your luck with make Note that if you are on OS X, typing gcc often actually invokes clang, so you may need full paths, such as: make CC=/usr/local/bin/gcc CXX=/usr/local/bin/g++ If you want to recompile with a different compiler (e.g. you compiled with clang, but then you want to test with gcc), you must remember to first: make clean

Compilation as library (Gevolution)

Currently, use as a library is only implemented in the branch that is specifically adapted for use in Gevolution. Checkout that branch, git checkout latfield perform the build process as above, with in addition the path to your LATfield library set in the Makefile, make clean make library Next, you can enable FalconIC in your Gevolution Makefile, by adding the following flags: INCLUDE += -I/path/to/falconic/include LIB += -L/path/to/falconic/class/lib -lclass -L/path/to/falconic/lib -lFalconIC DLATFIELD2 += -DICGEN_FALCONIC and finally build Gevolution, and run Gevolution while using FalconIC by setting IC generator = f in your settings.ini.

Usage of FalconIC

Run ./FalconIC -h for help on the Command Line Interface (in a terminal). Running ./FalconIC without arguments opens the GUI. Click on the menu "Run", and then the option "Run". Or alternatively, click ctrl-r. This will generate density fields with the default settings, and display them in the top left panel. Play a bit with the interface, and see what you can do.

Saving settings

FalconIC works with bundles. That is, a "file" is actually a folder with several files in it. All you decide is the name of the bundle, everything else will be stored inside it (including settings.fic).

Output IC for simulation

Just tick the checkbox of your favourite format.
Some questions and answers

I see only a slice of the full 3D density field. Is the full 3D field stored in memory?

The 3D density field is displayed in one slice, but indeed the full thing is in memory. Showing all slice is generally too slow, as the gui is hand-coded in plain c (and a bit c++), without opencl acceleration or anything. You can increase the number of slices displayed with the button "thickness" in the view panel, which has a + and - button. Before you do that, perhaps you should toggle the density field to be displayed in 'dots' (plain pixels) rather than any of the other shapes (many-pixel objects). Also, set the opacity to something less than one, so that over-dense regions are most visible. In the same panel, there is the button "Move displacement", which lets you exaggerate the displacement with a scale-independent rescaling of the displacement.

Is it possible to run from command line with mpirun?

For OS X users: yes, the binary in fact is a stand alone file, hidden in the .app bundle, at the path: FalconIC.app/Contents/MacOS/FalconIC. It is compiled with mpi, so you can run directly the following: mpirun -np 4 ./FalconIC.app/Contents/MacOS/FalconIC the/path/to/your/bundle.ficb where the last argument points to a bundle which you should first save from within the GUI. Alternatively, you could create a folder mybundle.ficb, and in its root place a file settings.fic, which contains at least one parameter, in the classical notation of ngrid = 512, or whatever. But… once the session finishes, there is no visualization of anything, since the program shuts down. What you do find then, are the spectra which it computes, stored in mybundle.ficb/spectra. Or anything else you made the code compute and save for you.

Displacement of CDM+Baryons, is that an option?

CDM + Baryons is in there, it is the default setting. CDM in blue, Baryons in yellow.

Are you using vanilla CLASS and CAMB?

The code links against vanilla CLASS and CAMB, so it should be straightforward to link against modified versions. Moreover, by doing some magic with linkers, it is even possible to simultaneously link against multiple versions of the same library. For example, the plain source already links against both CAMB and EFTCAMB, and runs either of the libraries upon your selection, without conflicts.

Do you use the transfer functions or the matter power spectrum?

The code uses the transfer functions directly from the Boltzmann libraries. The reason is that the sign matters, which goes lost in the power spectra (T(k)2). For example, the EFT Q-field is sometimes anti-correlated with CDM perturbations.
Fun stuff

Copy the following settings to your clipboard, open FalconIC, click "File -> Paste all settings from clipboard" (or press ctrl-shift-v), and paste this text in there.


reality [0] = Newtonian - no radiation linearPowerSpectrum [0] = TabulatedPLANCK2015 multipleMatterSpecies [0] = 0 filter2DImage [0] = 1 filterImagePath [0] = builtin:smile
When you run a simulation with these initial conditions, you get something like this:

Einstein Equations

reality [0] = Newtonian - no radiation linearPowerSpectrum [0] = TabulatedPLANCK2015 multipleMatterSpecies [0] = 0 filter2DImage [0] = 1 filterImagePath [0] = builtin:einsteinEq


reality [0] = Newtonian - no radiation linearPowerSpectrum [0] = TabulatedPLANCK2015 multipleMatterSpecies [0] = 0 filter2DImage [0] = 1 filterImagePath [0] = builtin:falcon

Smoothed density field

reality [0] = Newtonian - no radiation linearPowerSpectrum [0] = TabulatedPLANCK2015 multipleMatterSpecies [0] = 0 filterPrimordialGaussian [0] = 1 filterGaussianWidth [0] = 10