mirror of
https://bitbucket.org/cosmicvoids/vide_public.git
synced 2025-07-05 07:41:11 +00:00
Fixed QHull detection. Added support for void rescaling
This commit is contained in:
commit
bc437752b5
2 changed files with 12 additions and 11 deletions
|
@ -2,7 +2,7 @@ SET(QHULL_BASE_PATH CACHE PATH "Qhull base path")
|
||||||
|
|
||||||
find_path(QHULL_INCLUDE_PATH qhull_a.h HINTS ${QHULL_BASE_PATH}/src/libqhull)
|
find_path(QHULL_INCLUDE_PATH qhull_a.h HINTS ${QHULL_BASE_PATH}/src/libqhull)
|
||||||
find_path(QHULL_CPP_INCLUDE_PATH Qhull.h HINTS ${QHULL_BASE_PATH}/src/libqhullcpp)
|
find_path(QHULL_CPP_INCLUDE_PATH Qhull.h HINTS ${QHULL_BASE_PATH}/src/libqhullcpp)
|
||||||
find_library(QHULL_LIBRARY qhull6 HINTS ${QHULL_BASE_PATH}/lib)
|
find_library(QHULL_LIBRARY qhull HINTS ${QHULL_BASE_PATH}/lib)
|
||||||
find_library(QHULL_CPP_LIBRARY qhullcpp HINTS ${QHULL_BASE_PATH}/lib)
|
find_library(QHULL_CPP_LIBRARY qhullcpp HINTS ${QHULL_BASE_PATH}/lib)
|
||||||
find_library(QHULL_P_LIBRARY qhullstatic_p HINTS ${QHULL_BASE_PATH}/lib)
|
find_library(QHULL_P_LIBRARY qhullstatic_p HINTS ${QHULL_BASE_PATH}/lib)
|
||||||
|
|
||||||
|
|
|
@ -179,7 +179,7 @@ Interpolate make_cosmological_redshift(double OM, double OL, double z0, double z
|
||||||
return buildFromVector(pairs);
|
return buildFromVector(pairs);
|
||||||
}
|
}
|
||||||
|
|
||||||
void metricTransform(SimuData *data, int axis, bool reshift, bool pecvel, double*& expfact)
|
void metricTransform(SimuData *data, int axis, bool reshift, bool pecvel, double*& expfact, bool cosmo_flag)
|
||||||
{
|
{
|
||||||
int x0, x1, x2;
|
int x0, x1, x2;
|
||||||
|
|
||||||
|
@ -203,6 +203,7 @@ void metricTransform(SimuData *data, int axis, bool reshift, bool pecvel, double
|
||||||
double z_base = reshift ? z0 : 0;
|
double z_base = reshift ? z0 : 0;
|
||||||
TotalExpansion e_computer;
|
TotalExpansion e_computer;
|
||||||
double baseComovingDistance;
|
double baseComovingDistance;
|
||||||
|
float vmax = 0;
|
||||||
|
|
||||||
expfact = new double[data->NumPart];
|
expfact = new double[data->NumPart];
|
||||||
|
|
||||||
|
@ -230,12 +231,17 @@ void metricTransform(SimuData *data, int axis, bool reshift, bool pecvel, double
|
||||||
// Distorted redshift
|
// Distorted redshift
|
||||||
if (reduced_red == 0)
|
if (reduced_red == 0)
|
||||||
z = 0;
|
z = 0;
|
||||||
else
|
else if (cosmo_flag)
|
||||||
z = (z_vs_D.compute(reduced_red)-z_base)*LIGHT_SPEED/100.;
|
z = (z_vs_D.compute(reduced_red)-z_base)*LIGHT_SPEED/100.;
|
||||||
|
else
|
||||||
|
z = reduced_red*LIGHT_SPEED/100.0;
|
||||||
|
|
||||||
expfact[i] = z / z_old;
|
expfact[i] = z / z_old;
|
||||||
// Add peculiar velocity
|
// Add peculiar velocity
|
||||||
if (pecvel)
|
if (pecvel) {
|
||||||
|
vmax = std::max(v,vmax);
|
||||||
z += v/100;
|
z += v/100;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch(const InvalidRangeException& e) {
|
catch(const InvalidRangeException& e) {
|
||||||
cout << "Trying to interpolate out of the tabulated range." << endl;
|
cout << "Trying to interpolate out of the tabulated range." << endl;
|
||||||
|
@ -243,6 +249,7 @@ void metricTransform(SimuData *data, int axis, bool reshift, bool pecvel, double
|
||||||
abort();
|
abort();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
cout << "vmax=" << vmax << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void generateOutput(SimuData *data, int axis,
|
void generateOutput(SimuData *data, int axis,
|
||||||
|
@ -531,13 +538,7 @@ int main(int argc, char **argv)
|
||||||
|
|
||||||
double *expfact;
|
double *expfact;
|
||||||
|
|
||||||
if (args_info.cosmo_flag)
|
metricTransform(simu, args_info.axis_arg, args_info.preReShift_flag, args_info.peculiarVelocities_flag, expfact, args_info.cosmo_flag);
|
||||||
metricTransform(simu, args_info.axis_arg, args_info.preReShift_flag, args_info.peculiarVelocities_flag, expfact);
|
|
||||||
else
|
|
||||||
{
|
|
||||||
expfact = new double[simu->NumPart];
|
|
||||||
for (int j = 0; j < simu->NumPart; j++) expfact[j] = 1.0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (args_info.inputParameter_given)
|
if (args_info.inputParameter_given)
|
||||||
makeBoxFromParameter(simu, expfact, simuOut, args_info);
|
makeBoxFromParameter(simu, expfact, simuOut, args_info);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue