Fixes to sphSmooth

This commit is contained in:
Guilhem Lavaux 2014-05-20 10:58:07 +02:00
parent 34de699863
commit c6668cbd0a

View File

@ -47,12 +47,12 @@ SPHSmooth<ValType,Ndims>::fetchNeighbours(const typename SPHTree::coords& c, uin
if (requested > maxNgb)
{
maxNgb = requested;
internal.ngb = new SPHCell *[maxNgb];
internal.distances = new CoordType[maxNgb];
internal.ngb = boost::shared_ptr<SPHCell*[]>(new SPHCell *[maxNgb]);
internal.distances = boost::shared_ptr<CoordType[]>(new CoordType[maxNgb]);
}
memcpy(internal.currentCenter, c, sizeof(c));
tree->getNearestNeighbours(c, requested, internal.ngb, internal.distances);
tree->getNearestNeighbours(c, requested, internal.ngb.get(), internal.distances.get());
internal.currentNgb = 0;
for (uint32_t i = 0; i < requested && internal.ngb[i] != 0; i++,internal.currentNgb++)