Skip to content
GitLab
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
67061bd5
Commit
67061bd5
authored
Aug 20, 2016
by
Matthieu Schaller
Browse files
Tests now pass with the new level of warnings for GCC compilation.
parent
16eca057
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/serial_io.c
View file @
67061bd5
...
...
@@ -179,7 +179,8 @@ void readArray(hid_t grp, const struct io_props props, size_t N,
void
prepareArray
(
struct
engine
*
e
,
hid_t
grp
,
char
*
fileName
,
FILE
*
xmfFile
,
char
*
partTypeGroupName
,
const
struct
io_props
props
,
unsigned
long
long
N_total
,
const
struct
UnitSystem
*
internal_units
,
unsigned
long
long
N_total
,
const
struct
UnitSystem
*
internal_units
,
const
struct
UnitSystem
*
snapshot_units
)
{
/* Create data space */
...
...
tests/test125cells.c
View file @
67061bd5
...
...
@@ -127,7 +127,7 @@ void get_solution(const struct cell *main_cell, struct solution_part *solution,
float
density
,
enum
velocity_field
vel
,
enum
pressure_field
press
,
float
size
)
{
for
(
size_
t
i
=
0
;
i
<
main_cell
->
count
;
++
i
)
{
for
(
in
t
i
=
0
;
i
<
main_cell
->
count
;
++
i
)
{
solution
[
i
].
id
=
main_cell
->
parts
[
i
].
id
;
...
...
@@ -187,7 +187,7 @@ void get_solution(const struct cell *main_cell, struct solution_part *solution,
void
reset_particles
(
struct
cell
*
c
,
enum
velocity_field
vel
,
enum
pressure_field
press
,
float
size
,
float
density
)
{
for
(
size_
t
i
=
0
;
i
<
c
->
count
;
++
i
)
{
for
(
in
t
i
=
0
;
i
<
c
->
count
;
++
i
)
{
struct
part
*
p
=
&
c
->
parts
[
i
];
...
...
@@ -304,7 +304,7 @@ void dump_particle_fields(char *fileName, struct cell *main_cell,
fprintf
(
file
,
"# Main cell --------------------------------------------
\n
"
);
/* Write main cell */
for
(
size_
t
pid
=
0
;
pid
<
main_cell
->
count
;
pid
++
)
{
for
(
in
t
pid
=
0
;
pid
<
main_cell
->
count
;
pid
++
)
{
fprintf
(
file
,
"%6llu %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f "
"%8.5f "
...
...
@@ -343,7 +343,7 @@ void dump_particle_fields(char *fileName, struct cell *main_cell,
fprintf
(
file
,
"# Solution ---------------------------------------------
\n
"
);
for
(
size_
t
pid
=
0
;
pid
<
main_cell
->
count
;
pid
++
)
{
for
(
in
t
pid
=
0
;
pid
<
main_cell
->
count
;
pid
++
)
{
fprintf
(
file
,
"%6llu %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f %8.5f "
"%8.5f %8.5f "
...
...
tests/test27cells.c
View file @
67061bd5
...
...
@@ -146,7 +146,7 @@ void clean_up(struct cell *ci) {
* @brief Initializes all particles field to be ready for a density calculation
*/
void
zero_particle_fields
(
struct
cell
*
c
)
{
for
(
size_
t
pid
=
0
;
pid
<
c
->
count
;
pid
++
)
{
for
(
in
t
pid
=
0
;
pid
<
c
->
count
;
pid
++
)
{
hydro_init_part
(
&
c
->
parts
[
pid
]);
}
}
...
...
@@ -155,7 +155,7 @@ void zero_particle_fields(struct cell *c) {
* @brief Ends the loop by adding the appropriate coefficients
*/
void
end_calculation
(
struct
cell
*
c
)
{
for
(
size_
t
pid
=
0
;
pid
<
c
->
count
;
pid
++
)
{
for
(
in
t
pid
=
0
;
pid
<
c
->
count
;
pid
++
)
{
hydro_end_density
(
&
c
->
parts
[
pid
],
1
);
}
}
...
...
@@ -177,7 +177,7 @@ void dump_particle_fields(char *fileName, struct cell *main_cell,
fprintf
(
file
,
"# Main cell --------------------------------------------
\n
"
);
/* Write main cell */
for
(
size_
t
pid
=
0
;
pid
<
main_cell
->
count
;
pid
++
)
{
for
(
in
t
pid
=
0
;
pid
<
main_cell
->
count
;
pid
++
)
{
fprintf
(
file
,
"%6llu %10f %10f %10f %10f %10f %10f %13e %13e %13e %13e %13e "
"%13e %13e %13e
\n
"
,
...
...
@@ -219,7 +219,7 @@ void dump_particle_fields(char *fileName, struct cell *main_cell,
"# Offset: [%2d %2d %2d] -----------------------------------
\n
"
,
i
-
1
,
j
-
1
,
k
-
1
);
for
(
size_
t
pjd
=
0
;
pjd
<
cj
->
count
;
pjd
++
)
{
for
(
in
t
pjd
=
0
;
pjd
<
cj
->
count
;
pjd
++
)
{
fprintf
(
file
,
"%6llu %10f %10f %10f %10f %10f %10f %13e %13e %13e %13e %13e "
...
...
tests/testPair.c
View file @
67061bd5
...
...
@@ -105,7 +105,7 @@ void clean_up(struct cell *ci) {
* @brief Initializes all particles field to be ready for a density calculation
*/
void
zero_particle_fields
(
struct
cell
*
c
)
{
for
(
size_
t
pid
=
0
;
pid
<
c
->
count
;
pid
++
)
{
for
(
in
t
pid
=
0
;
pid
<
c
->
count
;
pid
++
)
{
hydro_init_part
(
&
c
->
parts
[
pid
]);
}
}
...
...
@@ -125,7 +125,7 @@ void dump_particle_fields(char *fileName, struct cell *ci, struct cell *cj) {
fprintf
(
file
,
"# ci --------------------------------------------
\n
"
);
for
(
size_
t
pid
=
0
;
pid
<
ci
->
count
;
pid
++
)
{
for
(
in
t
pid
=
0
;
pid
<
ci
->
count
;
pid
++
)
{
fprintf
(
file
,
"%6llu %10f %10f %10f %10f %10f %10f %13e %13e %13e %13e %13e "
"%13e %13e %13e
\n
"
,
...
...
@@ -149,7 +149,7 @@ void dump_particle_fields(char *fileName, struct cell *ci, struct cell *cj) {
fprintf
(
file
,
"# cj --------------------------------------------
\n
"
);
for
(
size_
t
pjd
=
0
;
pjd
<
cj
->
count
;
pjd
++
)
{
for
(
in
t
pjd
=
0
;
pjd
<
cj
->
count
;
pjd
++
)
{
fprintf
(
file
,
"%6llu %10f %10f %10f %10f %10f %10f %13e %13e %13e %13e %13e "
"%13e %13e %13e
\n
"
,
...
...
tests/testReading.c
View file @
67061bd5
...
...
@@ -28,7 +28,7 @@ int main() {
size_t
Ngas
=
0
,
Ngpart
=
0
;
int
periodic
=
-
1
;
int
flag_entropy_ICs
=
-
1
;
int
i
,
j
,
k
,
n
;
int
i
,
j
,
k
;
double
dim
[
3
];
struct
part
*
parts
=
NULL
;
struct
gpart
*
gparts
=
NULL
;
...
...
@@ -55,7 +55,7 @@ int main() {
assert
(
periodic
==
1
);
/* Check particles */
for
(
n
=
0
;
n
<
Ngas
;
++
n
)
{
for
(
size_t
n
=
0
;
n
<
Ngas
;
++
n
)
{
/* Check that indices are in a reasonable range */
unsigned
long
long
index
=
parts
[
n
].
id
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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