Pre-school Courses / Blog

Lecture videos (youtube link)

Courses/Projects/Instructions in this Github repository

Introduction to the N-body problem

by Mario A. Rodriguez-MezaLecture-day1-00-Intro.pdf

Course notes: 1, 2

In these lectures the basics of the N-body problem in astrophysics is given. Focusing mainly on the numerical procedures to do simple N-body simulations. In general these procedures consist in constructing the N-body initial conditions, computing the forces between bodies, advancing the system (by solving Newton second law equations) and writing a snapshot of the system. In order to construct initial conditions we will give a brief description of the Monte Carlo method and show how to construct simple initial conditions for astrophysical system of interest, like star cluster, galaxies and sample cubes for cosmological simulations. In particular, attention is given to the following schemes to compute forces among bodies: Particle-Particle, Treecode and TreePM. Also the Smooth Particle Hydrodynamics (SPH) method is review. Simple numerical code written in C will be given to the participants in order they can experiment running simulations and understand some of the main numerical issues of N-body simulations, like numerical errors associated to the force computation, the complexity of the force computation schemes and so on.

Introduction to the N-body problem II

by Octavio Valenzuela

In these lectures I will introduce the basics concepts of the N-body problem in astrophysics. Particular attention will be given to Particle-Particle (PP), Particle-Mesh (PM) and introduction to the Adaptive Mesh Refinement (AMR) techniques and discussion of the equation of motion integrators. I will define some exercises testing initial conditions and evolution accuracy for spherical isolated systems and small cosmological boxes. In coordination to the Parallel Computing lecturer (Julio Clemente) I will define 3 projects: Parallel Montecarlo Realizations, parallel PP-Nbody code and the parallel solution of a partial differential equation on a mesh.

Comments 28

  • Utilizaremos este software para visualizar los miniproyectos

  • Hi, I tried to install tipsy from the link posted. I successfully created the Makefile but I got compilation errors. This was done in a MacBook Air with El Capitan OS.

    • I have the same problem, also with El Capitan OS. If someone made it work already, your help would be greatly appreciated.

    • could you post the error message?

        In file included from acc_load.c:13:
        ./defs.h:141:10: fatal error: ‘X11/Xlib.h’ file not found
        1 error generated.
        make: *** [acc_load.o] Error 1

  • I successfully installed tipsy in a Ubuntu 16.04 environment. I’ll make it easier for you. Just download this tar ball Then extract all the files (just type tar xvf …) then run this commands:

    #Move to the tipsy directory you just extracted
    cd tipsy-2.2.3d

    #Move to the code directory
    cd code

    #Run this command
    bash configure

    This will create a Makefile in the same directory, you may want to check it to see if you if the flags and libraries are correct for your system. Then:

    #Now run a make

    That’s all folks.

    • Doing what Favio’s intructions say you may encounter this error:

      rldefs.h:46:23: termcap.h: No such file or directory
      make[1]: *** [readline.o] Error 1
      make[1]: Leaving directory `/local/dana/tipsy-2.2.1/code/readline’
      make: *** [readline/libreadline.a] Error 2

      This means you’re missing teamcap libraries, to fix this installed some libraries with this command:

      sudo apt-get install libncurses5-dev

      This includes libteamcap
      After doing this you should follow Favio’s instructions and now it should be fine.

  • Realizaremos 3 proyectos:

    Condiciones Iniciales Colapso Frío de una Esfera Homogenea
    Visualización con tipsy
    Medición de perfil de densidad radial

    Evolución con el código de integración directa PP nbody1.f

  • Proyecto Avanzado
    Exportar nbody1.f a una versión paralela en mpi

  • A los que tengan problema instalando tipsy ya está instalado en atocatl
    solicitar a Julio Clemente la cuenta e instrucciones

  • I tried to compile the code and this is the error I get:

    /tmp/ccjCaoad.o: In function `MAIN__’:
    nbody1.f:(.text+0xfe9): undefined reference to `energies_’
    nbody1.f:(.text+0x1267): undefined reference to `analyze_’
    nbody1.f:(.text+0x128f): undefined reference to `writesnapshot_’
    nbody1.f:(.text+0x12c5): undefined reference to `savemoment_’
    collect2: error: ld returned 1 exit status

    • The problem that Favio reported is because the code has to be compiled together with Nbodyaux.f and the headerfile nbody1.h must be in the same directory. All the files are in the dropbox directory that we provided you

  • The problem that Favio reported is because the code has to be compiled together with Nbodyaux.f and the headerfile nbody1.h must be in the same directory. All the files are in the dropbox directory that we provided you

  • Hola, donde puedo encontrar los pdf de las presentaciónes?

  • Estoy interesada en trabajar en proyectos que relacionados con condiciones iniciales y salida de los mismos.

  • ¿Alguien ha tenido problemas con openmp con su compilador?

    Estoy usando gcc en Os X Yosemite con gcc instalado desde brew y no encuentra la biblioteca.

    Les adjunto el error:

    MacBook-Pro-de-Antonio-2:preescuela antoniogalvan$ gcc pi_sec.c
    pi_sec.c:2:10: fatal error: ‘omp.h’ file not found
    1 error generated.

  • para gfortran-4.9 Hay un error de compilación que es el siguiente:


    Open(1,file=’particlesA.dat’,status=’unknow’, action=’write’)
    Error: STATUS specifier in OPEN statement at (1) has invalid value ‘unknow’

    La solución en mi caso es por el case sensitive:

    reemplazar la linea por:

    Open(1,file=’particlesA.dat’,status=’UNKNOWN’, action=’write’)

  • in nbodyaux.f the subroutine writesnapshot has an extra right handed parenthesis
    write(10,'(i6,2g11.4,i8,3g12.4))’) it should be like this:

    please fix it in your version

  • Any mac user can use the examples of omp and mpi? Which are the installation of your compiler are used?

  • We are migrating to Github, please feel free to ask questions there.
    Github repository: