MP-Gadget  5.0.1.dev1-76bc7d4726-dirty
Functions
lightcone.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void lightcone_init (Cosmology *CP, double timeBegin, const double UnitLength_in_cm, const char *OutputDir)
 
void lightcone_compute (double a, double BoxSize, Cosmology *CP, inttime_t ti_curr, inttime_t ti_next)
 

Function Documentation

◆ lightcone_compute()

void lightcone_compute ( double  a,
double  BoxSize,
Cosmology CP,
inttime_t  ti_curr,
inttime_t  ti_next 
)

Definition at line 177 of file lightcone.c.

178 {
179  int i;
180  lightcone_set_time(a, BoxSize);
181  const double ddrift = get_exact_drift_factor(CP, ti_curr, ti_next);
182  #pragma omp parallel for
183  for(i = 0; i < PartManager->NumPart; i++)
184  {
185  lightcone_cross(i, ddrift);
186  }
187 }
static void lightcone_set_time(double a, const double BoxSize)
Definition: lightcone.c:189
static void lightcone_cross(int p, double ddrift)
Definition: lightcone.c:222
struct part_manager_type PartManager[1]
Definition: partmanager.c:11
static Cosmology * CP
Definition: power.c:27
double get_exact_drift_factor(Cosmology *CP, inttime_t ti0, inttime_t ti1)
Definition: timefac.c:64

References CP, get_exact_drift_factor(), lightcone_cross(), lightcone_set_time(), part_manager_type::NumPart, and PartManager.

Referenced by run().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lightcone_init()

void lightcone_init ( Cosmology CP,
double  timeBegin,
const double  UnitLength_in_cm,
const char *  OutputDir 
)

Definition at line 91 of file lightcone.c.

92 {
93  int i;
94  dloga = (0.0 - log(timeBegin)) / (NENTRY - 1);
95  for(i = 0; i < NENTRY; i ++) {
97  };
98  char buf[1024];
99  int chunk = 100;
100  int ThisTask;
101  MPI_Comm_rank(MPI_COMM_WORLD, &ThisTask);
102 
103  sprintf(buf, "%s/lightcone/", OutputDir);
104  mkdir(buf, 02755);
105  sprintf(buf, "%s/lightcone/%03d/", OutputDir, (int)(ThisTask / chunk));
106  mkdir(buf, 02755);
107  sprintf(buf, "%s/lightcone/%03d/lightcone-%05d.raw", OutputDir, (int)(ThisTask / chunk), ThisTask);
108 
109  fd_lightcone = fopen(buf, "a+");
110  if(fd_lightcone == NULL) {
111  endrun(1, "failed to open %s\n", buf);
112  }
114  printf("lightcone reference redshift = %g distance = %g\n",
116 }
void endrun(int where, const char *fmt,...)
Definition: endrun.c:147
static double HorizonDistanceRef
Definition: lightcone.c:41
#define NENTRY
Definition: lightcone.c:19
static FILE * fd_lightcone
Definition: lightcone.c:46
static double dloga
Definition: lightcone.c:21
static void lightcone_init_entry(Cosmology *CP, int i, const double UnitLength_in_cm)
Definition: lightcone.c:65
static double ReferenceRedshift
Definition: lightcone.c:44
static double lightcone_get_horizon(double a)
Definition: lightcone.c:119
static double UnitLength_in_cm
Definition: power.c:26
int ThisTask
Definition: test_exchange.c:23

References CP, dloga, endrun(), fd_lightcone, HorizonDistanceRef, lightcone_get_horizon(), lightcone_init_entry(), NENTRY, ReferenceRedshift, ThisTask, and UnitLength_in_cm.

Referenced by begrun().

Here is the call graph for this function:
Here is the caller graph for this function: