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
c616a929
Commit
c616a929
authored
Aug 01, 2017
by
Peter W. Draper
Browse files
Fix issues with new sort arrays in tests
parent
5c4f5858
Changes
5
Hide whitespace changes
Inline
Side-by-side
tests/test125cells.c
View file @
c616a929
...
...
@@ -340,7 +340,8 @@ struct cell *make_cell(size_t n, const double offset[3], double size, double h,
// shuffle_particles(cell->parts, cell->count);
cell
->
sorted
=
0
;
cell
->
sort
=
NULL
;
for
(
int
k
=
0
;
k
<
13
;
k
++
)
cell
->
sort
[
k
]
=
NULL
;
return
cell
;
}
...
...
@@ -348,7 +349,9 @@ struct cell *make_cell(size_t n, const double offset[3], double size, double h,
void
clean_up
(
struct
cell
*
ci
)
{
free
(
ci
->
parts
);
free
(
ci
->
xparts
);
free
(
ci
->
sort
);
for
(
int
k
=
0
;
k
<
13
;
k
++
)
if
(
ci
->
sort
[
k
]
!=
NULL
)
free
(
ci
->
sort
[
k
]);
free
(
ci
);
}
...
...
tests/test27cells.c
View file @
c616a929
...
...
@@ -178,14 +178,17 @@ struct cell *make_cell(size_t n, double *offset, double size, double h,
shuffle_particles
(
cell
->
parts
,
cell
->
count
);
cell
->
sorted
=
0
;
cell
->
sort
=
NULL
;
for
(
int
k
=
0
;
k
<
13
;
k
++
)
cell
->
sort
[
k
]
=
NULL
;
return
cell
;
}
void
clean_up
(
struct
cell
*
ci
)
{
free
(
ci
->
parts
);
free
(
ci
->
sort
);
for
(
int
k
=
0
;
k
<
13
;
k
++
)
if
(
ci
->
sort
[
k
]
!=
NULL
)
free
(
ci
->
sort
[
k
]);
free
(
ci
);
}
...
...
tests/testPair.c
View file @
c616a929
...
...
@@ -121,14 +121,17 @@ struct cell *make_cell(size_t n, double *offset, double size, double h,
shuffle_particles
(
cell
->
parts
,
cell
->
count
);
cell
->
sorted
=
0
;
cell
->
sort
=
NULL
;
for
(
int
k
=
0
;
k
<
13
;
k
++
)
cell
->
sort
[
k
]
=
NULL
;
return
cell
;
}
void
clean_up
(
struct
cell
*
ci
)
{
free
(
ci
->
parts
);
free
(
ci
->
sort
);
for
(
int
k
=
0
;
k
<
13
;
k
++
)
if
(
ci
->
sort
[
k
]
!=
NULL
)
free
(
ci
->
sort
[
k
]);
free
(
ci
);
}
...
...
tests/testPeriodicBC.c
View file @
c616a929
...
...
@@ -177,14 +177,17 @@ struct cell *make_cell(size_t n, double *offset, double size, double h,
shuffle_particles
(
cell
->
parts
,
cell
->
count
);
cell
->
sorted
=
0
;
cell
->
sort
=
NULL
;
for
(
int
k
=
0
;
k
<
13
;
k
++
)
cell
->
sort
[
k
]
=
NULL
;
return
cell
;
}
void
clean_up
(
struct
cell
*
ci
)
{
free
(
ci
->
parts
);
free
(
ci
->
sort
);
for
(
int
k
=
0
;
k
<
13
;
k
++
)
if
(
ci
->
sort
[
k
]
!=
NULL
)
free
(
ci
->
sort
[
k
]);
free
(
ci
);
}
...
...
tests/testSPHStep.c
View file @
c616a929
...
...
@@ -81,7 +81,8 @@ struct cell *make_cell(size_t N, float cellSize, int offset[3], int id_offset) {
cell
->
ti_end_max
=
1
;
cell
->
sorted
=
0
;
cell
->
sort
=
NULL
;
for
(
int
k
=
0
;
k
<
13
;
k
++
)
cell
->
sort
[
k
]
=
NULL
;
return
cell
;
}
...
...
@@ -211,7 +212,9 @@ int main() {
for
(
int
j
=
0
;
j
<
27
;
++
j
)
{
free
(
cells
[
j
]
->
parts
);
free
(
cells
[
j
]
->
xparts
);
free
(
cells
[
j
]
->
sort
);
for
(
int
k
=
0
;
k
<
13
;
k
++
)
if
(
cells
[
j
]
->
sort
[
k
]
!=
NULL
)
free
(
cells
[
j
]
->
sort
[
k
]);
free
(
cells
[
j
]);
}
...
...
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