More cosmological parameters
This commit is contained in:
parent
42c6f11034
commit
b5b44fdead
@ -24,7 +24,10 @@ int ipvz_out = 5;
|
||||
void h5_read_runtime_parameters
|
||||
(H5File* file, /* file handle */
|
||||
double* LBox, // box size
|
||||
int* numPart) // number of particles
|
||||
int* numPart,
|
||||
double *hubble,
|
||||
double *omegam,
|
||||
double *omegalambda) // number of particles
|
||||
{
|
||||
|
||||
int MAX_PARM = 200;
|
||||
@ -47,6 +50,8 @@ void h5_read_runtime_parameters
|
||||
str_runtime_params_t *str_rt_parms;
|
||||
log_runtime_params_t *log_rt_parms;
|
||||
|
||||
double omegarad;
|
||||
|
||||
int i;
|
||||
|
||||
nint_runtime_parameters = MAX_PARM;
|
||||
@ -145,6 +150,15 @@ void h5_read_runtime_parameters
|
||||
if (strncmp(real_runtime_parameter_names[i],"xmax",4) == 0 ) {
|
||||
*LBox = real_runtime_parameter_values[i];
|
||||
}
|
||||
if (strncmp(int_runtime_parameter_names[i],"hubbleconstant", 14) == 0 ) {
|
||||
*hubble = real_runtime_parameter_values[i];
|
||||
}
|
||||
if (strncmp(int_runtime_parameter_names[i],"omegamatter", 11) == 0 ) {
|
||||
*omegam = real_runtime_parameter_values[i];
|
||||
}
|
||||
if (strncmp(int_runtime_parameter_names[i],"omegaradiation", 11) == 0 ) {
|
||||
omegarad = real_runtime_parameter_values[i];
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < nint_runtime_parameters; i++) {
|
||||
@ -153,6 +167,9 @@ void h5_read_runtime_parameters
|
||||
*numPart = *numPart * *numPart * *numPart;
|
||||
}
|
||||
}
|
||||
|
||||
*omegalambda = 1-(*omegam)-omegarad;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -14,7 +14,10 @@ using namespace H5;
|
||||
void h5_read_runtime_parameters
|
||||
(H5File* file, /* file handle */
|
||||
double* LBox,
|
||||
int* numPart);
|
||||
int* numPart,
|
||||
double* hubble,
|
||||
double* omegam,
|
||||
double* omegalambda);
|
||||
|
||||
void h5_read_flash3_particles (H5File* file,
|
||||
int* totalparticles,
|
||||
|
@ -20,11 +20,12 @@ SimuData *CosmoTool::loadFlashMulti(const char *fname, int id, int loadflags)
|
||||
H5File *fileID;
|
||||
H5std_string filename;
|
||||
//char filename[81];
|
||||
double lbox, time;
|
||||
double lbox, time, hubble, omegam, omegalambda;
|
||||
int npart;
|
||||
|
||||
const double kpc2cm = 3.08568025e21;
|
||||
const double km2cm = 1.e5;
|
||||
const double hubble2cm = 3.240779270005e-18;
|
||||
|
||||
if (id != 0)
|
||||
throw NoSuchFileException();
|
||||
@ -42,9 +43,12 @@ SimuData *CosmoTool::loadFlashMulti(const char *fname, int id, int loadflags)
|
||||
h5_read_flash3_header_info(&file, &time);
|
||||
data->time = time;
|
||||
|
||||
h5_read_runtime_parameters(&file, &lbox, &npart);
|
||||
h5_read_runtime_parameters(&file, &lbox, &npart, &hubble, &omegam, &omegalambda);
|
||||
data->TotalNumPart = data->NumPart = npart;
|
||||
data->BoxSize = lbox/kpc2cm;
|
||||
data->Hubble = hubble/hubble2cm;
|
||||
data->Omega_M = omegam;
|
||||
data->Omega_Lambda = omegalambda;
|
||||
|
||||
// particle data
|
||||
for (int i = 0; i < 3; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user