Commit 7966efd2 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Fixed failing tests

parent 589eea6c
......@@ -87,6 +87,15 @@ grp.attrs["Flag_Entropy_ICs"] = [0, 0, 0, 0, 0, 0]
grp = file.create_group("/RuntimePars")
grp.attrs["PeriodicBoundariesOn"] = periodic
#Units
grp = file.create_group("/Units")
grp.attrs["Unit length in cgs (U_L)"] = 1.
grp.attrs["Unit mass in cgs (U_M)"] = 1.
grp.attrs["Unit time in cgs (U_t)"] = 1.
grp.attrs["Unit current in cgs (U_I)"] = 1.
grp.attrs["Unit temperature in cgs (U_T)"] = 1.
#Particle group
grp = file.create_group("/PartType0")
ds = grp.create_dataset('Coordinates', (numPart, 3), 'd')
......
......@@ -33,14 +33,18 @@ int main() {
struct part *parts = NULL;
struct gpart *gparts = NULL;
/* Default unit system */
struct UnitSystem us;
units_init_cgs(&us);
/* Properties of the ICs */
const double boxSize = 1.;
const int L = 4;
const double rho = 2.;
/* Read data */
read_ic_single("input.hdf5", dim, &parts, &gparts, &Ngas, &Ngpart, &periodic,
&flag_entropy_ICs, 0);
read_ic_single("input.hdf5", &us, dim, &parts, &gparts, &Ngas, &Ngpart,
&periodic, &flag_entropy_ICs, 0);
/* Check global properties read are correct */
assert(dim[0] == boxSize);
......
......@@ -131,7 +131,7 @@ int main() {
for (j = 0; j < 27; ++j)
for (i = 0; i < cells[j]->count; ++i) {
cells[j]->parts[i].mass = dim * dim * dim * rho / (N * N * N);
cells[j]->parts[i].u = P / ((const_hydro_gamma - 1.) * rho);
cells[j]->parts[i].u = P / (hydro_gamma_minus_one * rho);
}
message("m=%f", dim * dim * dim * rho / (N * N * N));
......
......@@ -85,10 +85,10 @@ int main(int argc, char *argv[]) {
p1.force.balsara = 0.0f;
p2.force.c = 58.8972740361f;
p2.force.balsara = 0.0f;
p1.u = 1.e-5 / ((const_hydro_gamma - 1.) * p1.rho);
p2.u = 1.e-5 / ((const_hydro_gamma - 1.) * p2.rho) + 100.0f / (33 * p2.mass);
p1.force.POrho2 = p1.u * (const_hydro_gamma - 1.0f) / p1.rho;
p2.force.POrho2 = p2.u * (const_hydro_gamma - 1.0f) / p2.rho;
p1.u = 1.e-5 / (hydro_gamma_minus_one * p1.rho);
p2.u = 1.e-5 / (hydro_gamma_minus_one * p2.rho) + 100.0f / (33 * p2.mass);
p1.force.POrho2 = p1.u * hydro_gamma_minus_one / p1.rho;
p2.force.POrho2 = p2.u * hydro_gamma_minus_one / p2.rho;
/* Dump a header. */
// printParticle_single(&p1, NULL);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment