Commit c78e236b authored by Pedro Gonnet's avatar Pedro Gonnet
Browse files

forgot that local part/xpart pointers need to be updated if the parts are re-allocated.


Former-commit-id: 6b8cc8d01d17b1455f7729ec9338a2ece94e168a
parent b8a803c3
...@@ -358,6 +358,8 @@ void space_rebuild ( struct space *s , double cell_max ) { ...@@ -358,6 +358,8 @@ void space_rebuild ( struct space *s , double cell_max ) {
ind[ nr_parts ] = t; ind[ nr_parts ] = t;
} }
s->nr_parts = nr_parts + engine_exchange_strays( s->e , nr_parts , &ind[nr_parts] , s->nr_parts - nr_parts ); s->nr_parts = nr_parts + engine_exchange_strays( s->e , nr_parts , &ind[nr_parts] , s->nr_parts - nr_parts );
parts = s->parts;
xparts = s->xparts;
for ( k = nr_parts ; k < s->nr_parts ; k++ ) { for ( k = nr_parts ; k < s->nr_parts ; k++ ) {
p = &parts[k]; p = &parts[k];
ind[k] = cell_getid( cdim , p->x[0]*ih[0] , p->x[1]*ih[1] , p->x[2]*ih[2] ); ind[k] = cell_getid( cdim , p->x[0]*ih[0] , p->x[1]*ih[1] , p->x[2]*ih[2] );
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment