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
6734027b
Commit
6734027b
authored
Mar 25, 2016
by
Matthieu Schaller
Browse files
Bug fix
parent
330b2d61
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/engine.c
View file @
6734027b
...
...
@@ -442,10 +442,10 @@ void engine_redistribute(struct engine *e) {
if
(
gparts_new
[
k
].
part
->
gpart
!=
&
gparts_new
[
k
])
error
(
"Linking problem !"
);
if
(
gparts_new
[
k
].
x
[
0
]
!=
gparts_new
[
k
].
part
->
x
[
0
]
||
gparts_new
[
k
].
x
[
1
]
!=
gparts_new
[
k
].
part
->
x
[
1
]
||
gparts_new
[
k
].
x
[
2
]
!=
gparts_new
[
k
].
part
->
x
[
2
])
error
(
"Linked particles are not at the same position !"
);
/*
if (gparts_new[k].x[0] != gparts_new[k].part->x[0] ||
*/
/*
gparts_new[k].x[1] != gparts_new[k].part->x[1] ||
*/
/*
gparts_new[k].x[2] != gparts_new[k].part->x[2])
*/
/*
error("Linked particles are not at the same position !");
*/
}
}
for
(
size_t
k
=
0
;
k
<
nr_parts
;
++
k
)
{
...
...
src/space.c
View file @
6734027b
...
...
@@ -377,7 +377,7 @@ void space_rebuild(struct space *s, double cell_max, int verbose) {
if
(
cells
[
ind
[
k
]].
nodeID
!=
local_nodeID
)
{
cells
[
ind
[
k
]].
count
-=
1
;
nr_parts
-=
1
;
struct
part
tp
=
s
->
parts
[
k
];
const
struct
part
tp
=
s
->
parts
[
k
];
s
->
parts
[
k
]
=
s
->
parts
[
nr_parts
];
s
->
parts
[
nr_parts
]
=
tp
;
if
(
s
->
parts
[
k
].
gpart
!=
NULL
)
{
...
...
@@ -386,20 +386,20 @@ void space_rebuild(struct space *s, double cell_max, int verbose) {
if
(
s
->
parts
[
nr_parts
].
gpart
!=
NULL
)
{
s
->
parts
[
nr_parts
].
gpart
->
part
=
&
s
->
parts
[
nr_parts
];
}
struct
xpart
txp
=
s
->
xparts
[
k
];
const
struct
xpart
txp
=
s
->
xparts
[
k
];
s
->
xparts
[
k
]
=
s
->
xparts
[
nr_parts
];
s
->
xparts
[
nr_parts
]
=
txp
;
int
t
=
ind
[
k
];
const
int
t
=
ind
[
k
];
ind
[
k
]
=
ind
[
nr_parts
];
ind
[
nr_parts
]
=
t
;
}
/* Move non-local gparts to the end of the list. */
for
(
int
k
=
0
;
k
<
nr_gparts
;
k
++
)
if
(
cells
[
ind
[
k
]].
nodeID
!=
local_nodeID
)
{
cells
[
ind
[
k
]].
gcount
-=
1
;
if
(
cells
[
g
ind
[
k
]].
nodeID
!=
local_nodeID
)
{
cells
[
g
ind
[
k
]].
gcount
-=
1
;
nr_gparts
-=
1
;
struct
gpart
tp
=
s
->
gparts
[
k
];
const
struct
gpart
tp
=
s
->
gparts
[
k
];
s
->
gparts
[
k
]
=
s
->
gparts
[
nr_gparts
];
s
->
gparts
[
nr_gparts
]
=
tp
;
if
(
s
->
gparts
[
k
].
id
>
0
)
{
...
...
@@ -408,9 +408,9 @@ void space_rebuild(struct space *s, double cell_max, int verbose) {
if
(
s
->
gparts
[
nr_gparts
].
id
>
0
)
{
s
->
gparts
[
nr_gparts
].
part
->
gpart
=
&
s
->
gparts
[
nr_gparts
];
}
int
t
=
ind
[
k
];
ind
[
k
]
=
ind
[
nr_gparts
];
ind
[
nr_gparts
]
=
t
;
const
int
t
=
g
ind
[
k
];
g
ind
[
k
]
=
g
ind
[
nr_gparts
];
g
ind
[
nr_gparts
]
=
t
;
}
/* Exchange the strays, note that this potentially re-allocates
...
...
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