Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
997b8f16
Commit
997b8f16
authored
Sep 14, 2016
by
Stefan Arridge
Browse files
Added conversion of box dimensions
parent
5c46ced3
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/parallel_io.c
View file @
997b8f16
...
...
@@ -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
))
!=
...
...
src/serial_io.c
View file @
997b8f16
...
...
@@ -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
);
...
...
src/single_io.c
View file @
997b8f16
...
...
@@ -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
))
!=
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment