Fixes to sphSmooth
This commit is contained in:
parent
34de699863
commit
c6668cbd0a
@ -47,12 +47,12 @@ SPHSmooth<ValType,Ndims>::fetchNeighbours(const typename SPHTree::coords& c, uin
|
|||||||
if (requested > maxNgb)
|
if (requested > maxNgb)
|
||||||
{
|
{
|
||||||
maxNgb = requested;
|
maxNgb = requested;
|
||||||
internal.ngb = new SPHCell *[maxNgb];
|
internal.ngb = boost::shared_ptr<SPHCell*[]>(new SPHCell *[maxNgb]);
|
||||||
internal.distances = new CoordType[maxNgb];
|
internal.distances = boost::shared_ptr<CoordType[]>(new CoordType[maxNgb]);
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(internal.currentCenter, c, sizeof(c));
|
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;
|
internal.currentNgb = 0;
|
||||||
for (uint32_t i = 0; i < requested && internal.ngb[i] != 0; i++,internal.currentNgb++)
|
for (uint32_t i = 0; i < requested && internal.ngb[i] != 0; i++,internal.currentNgb++)
|
||||||
|
Loading…
Reference in New Issue
Block a user