GraviDy  1.0
Gravitational Dynamics N-body integrator
Classes | Typedefs | Variables
common.hpp File Reference
#include <iomanip>
#include <iostream>
#include <ctime>
#include <cstdio>
#include <omp.h>
#include <cmath>
#include <fstream>
#include <sstream>
#include <vector>
#include <string>
Include dependency graph for common.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  double4
 Defining the «double4» structure based on the CUDA definition for the CPU version, which not include the CUDA headers. More...
 
struct  double3
 Defining the «double3» structure based on the CUDA definition for the CPU version, which not include the CUDA headers. More...
 
struct  Distance
 Structure to handle the distance of the particles, to be able to identify them while sorted. More...
 
struct  Energy
 This structure contains all the energy variables of the system. More...
 
struct  options
 Options to handling printing options, like printing the snapshot on the screen instead of a file; print the informaton of all the particles (id, mass, position, velocity, acceleration, jerk, current timestep); calculating and printing the lagrange radii. More...
 
struct  Predictor
 This structure contains the predicted information of a particle in some moment of the integration. More...
 
struct  Forces
 This structure contains the information of the Forces of a particle in some moment of the integration. More...
 
struct  Gtime
 This structure contains different times of the internal integration process. More...
 
struct  file_data
 General structure to read the INPUT file. More...
 

Typedefs

typedef struct double4 double4
 Defining the «double4» structure based on the CUDA definition for the CPU version, which not include the CUDA headers. More...
 
typedef struct double3 double3
 Defining the «double3» structure based on the CUDA definition for the CPU version, which not include the CUDA headers. More...
 
typedef struct Energy Energy
 
typedef struct options options
 
typedef struct Predictor Predictor
 
typedef struct Forces Forces
 
typedef struct Gtime Gtime
 
typedef struct file_data file_data
 

Variables

const int G = 1
 Gravitational constant. More...
 
const int J = 6
 Amount of neighbours to calculate the center of density of the system (Casertano & Hut 1985) More...
 
const float CORE_MASS = 0.1
 Common mass percentage in the core of a globular cluster. More...
 
const float LAGRANGE_RADII [] = {0.01, 0.05, 0.1, 0.2, 0.5, 0.75}
 
const double E = 1e-4
 Softening parameter. More...
 
const double E2 = 1e-8
 Softening parameter squared. More...
 
const float ETA_S = 0.01
 Initial ETA parameter to calculate the first timestep of all the particles of the system. More...
 
const float ETA_N = 0.01
 Iteration ETA parameter to calculate new timestep of all the active particles of the system, in a certain integration time. More...
 
const double D_TIME_MIN = 1.1920928955078125e-07
 Lower boundary for the particles timesteps, $2^{-23}$. More...
 
const double D_MTIME_MIN = 7.450580596923828e-09
 Lower boundary for the binary timesteps, $2^{-30}$. More...
 
const double D_TIME_MAX = 0.125
 Upper boundary for the particles timesteps, $2^{-3}$. More...
 
const double KERNEL_GFLOP = 48e-9
 

Typedef Documentation

§ double3

typedef struct double3 double3

Defining the «double3» structure based on the CUDA definition for the CPU version, which not include the CUDA headers.

§ double4

typedef struct double4 double4

Defining the «double4» structure based on the CUDA definition for the CPU version, which not include the CUDA headers.

§ Energy

typedef struct Energy Energy

§ file_data

typedef struct file_data file_data

§ Forces

typedef struct Forces Forces

§ Gtime

typedef struct Gtime Gtime

§ options

typedef struct options options

§ Predictor

typedef struct Predictor Predictor

Variable Documentation

§ CORE_MASS

const float CORE_MASS = 0.1

Common mass percentage in the core of a globular cluster.

§ D_MTIME_MIN

const double D_MTIME_MIN = 7.450580596923828e-09

Lower boundary for the binary timesteps, $2^{-30}$.

§ D_TIME_MAX

const double D_TIME_MAX = 0.125

Upper boundary for the particles timesteps, $2^{-3}$.

§ D_TIME_MIN

const double D_TIME_MIN = 1.1920928955078125e-07

Lower boundary for the particles timesteps, $2^{-23}$.

§ E

const double E = 1e-4

Softening parameter.

§ E2

const double E2 = 1e-8

Softening parameter squared.

§ ETA_N

const float ETA_N = 0.01

Iteration ETA parameter to calculate new timestep of all the active particles of the system, in a certain integration time.

Based on Aarseth formula

§ ETA_S

const float ETA_S = 0.01

Initial ETA parameter to calculate the first timestep of all the particles of the system.

Based on Aarseth formula

§ G

const int G = 1

Gravitational constant.

Since we are working in N-body units we set G as one.

§ J

const int J = 6

Amount of neighbours to calculate the center of density of the system (Casertano & Hut 1985)

§ KERNEL_GFLOP

const double KERNEL_GFLOP = 48e-9

§ LAGRANGE_RADII

const float LAGRANGE_RADII[] = {0.01, 0.05, 0.1, 0.2, 0.5, 0.75}