Commit 997b8f16 authored by Stefan Arridge's avatar Stefan Arridge
Browse files

Added conversion of box dimensions

parent 5c46ced3
...@@ -486,6 +486,10 @@ void read_ic_parallel(char* fileName, const struct UnitSystem* internal_units, ...@@ -486,6 +486,10 @@ void read_ic_parallel(char* fileName, const struct UnitSystem* internal_units,
} }
} }
/* Convert the dimensions of the box */
for (int j = 0; j<3 ; j++)
dim[j] *= units_conversion_factor(ic_units, internal_units, UNIT_CONV_LENGTH);
/* Allocate memory to store SPH particles */ /* Allocate memory to store SPH particles */
*Ngas = N[0]; *Ngas = N[0];
if (posix_memalign((void*)parts, part_align, (*Ngas) * sizeof(struct part)) != if (posix_memalign((void*)parts, part_align, (*Ngas) * sizeof(struct part)) !=
......
...@@ -528,6 +528,10 @@ void read_ic_serial(char* fileName, const struct UnitSystem* internal_units, ...@@ -528,6 +528,10 @@ void read_ic_serial(char* fileName, const struct UnitSystem* internal_units,
H5Fclose(h_file); H5Fclose(h_file);
} }
/* Convert the dimensions of the box */
for (int j = 0; j<3 ; j++)
dim[j] *= units_conversion_factor(ic_units, internal_units, UNIT_CONV_LENGTH);
/* Now need to broadcast that information to all ranks. */ /* Now need to broadcast that information to all ranks. */
MPI_Bcast(flag_entropy, 1, MPI_INT, 0, comm); MPI_Bcast(flag_entropy, 1, MPI_INT, 0, comm);
MPI_Bcast(periodic, 1, MPI_INT, 0, comm); MPI_Bcast(periodic, 1, MPI_INT, 0, comm);
......
...@@ -433,6 +433,10 @@ void read_ic_single(char* fileName, const struct UnitSystem* internal_units, ...@@ -433,6 +433,10 @@ void read_ic_single(char* fileName, const struct UnitSystem* internal_units,
internal_units->UnitTemperature_in_cgs); internal_units->UnitTemperature_in_cgs);
} }
/* Convert the dimensions of the box */
for (int j = 0; j<3 ; j++)
dim[j] *= units_conversion_factor(ic_units, internal_units, UNIT_CONV_LENGTH);
/* Allocate memory to store SPH particles */ /* Allocate memory to store SPH particles */
*Ngas = N[0]; *Ngas = N[0];
if (posix_memalign((void*)parts, part_align, *Ngas * sizeof(struct part)) != if (posix_memalign((void*)parts, part_align, *Ngas * sizeof(struct part)) !=
......
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