Skip to content
Snippets Groups Projects
Commit 997b8f16 authored by Stefan Arridge's avatar Stefan Arridge
Browse files

Added conversion of box dimensions

parent 5c46ced3
No related branches found
No related tags found
1 merge request!254Added conversion of box dimensions
......@@ -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 */
*Ngas = N[0];
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,
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. */
MPI_Bcast(flag_entropy, 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,
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 */
*Ngas = N[0];
if (posix_memalign((void*)parts, part_align, *Ngas * sizeof(struct part)) !=
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment