Fixes for SPH. Workaround for buggy gadget headers. Fixed borg generation for newer API.
This commit is contained in:
parent
bb94130bcd
commit
b639bcedaf
8 changed files with 55 additions and 11 deletions
|
@ -48,15 +48,15 @@ SPHSmooth<ValType,Ndims>::fetchNeighbours(const typename SPHTree::coords& c, uin
|
|||
if (requested > maxNgb)
|
||||
{
|
||||
maxNgb = requested;
|
||||
internal.ngb = boost::shared_ptr<SPHCell*[]>(new SPHCell *[maxNgb]);
|
||||
internal.ngb = boost::shared_ptr<P_SPHCell[]>(new P_SPHCell[maxNgb]);
|
||||
internal.distances = boost::shared_ptr<CoordType[]>(new CoordType[maxNgb]);
|
||||
}
|
||||
|
||||
memcpy(internal.currentCenter, c, sizeof(c));
|
||||
tree->getNearestNeighbours(c, requested, internal.ngb.get(), internal.distances.get());
|
||||
tree->getNearestNeighbours(c, requested, (SPHCell **)internal.ngb.get(), (CoordType*)internal.distances.get());
|
||||
|
||||
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++)
|
||||
{
|
||||
internal.distances[i] = sqrt(internal.distances[i]);
|
||||
d2 = internal.distances[i];
|
||||
|
@ -191,9 +191,8 @@ void SPHSmooth<ValType,Ndims>::addGridSite(const typename SPHTree::coords& c)
|
|||
for (uint32_t i = 0; i < internal.currentNgb; i++)
|
||||
{
|
||||
ComputePrecision d = internal.distances[i];
|
||||
SPHCell& cell = *internal.ngb[i];
|
||||
SPHCell& cell = *(internal.ngb[i]);
|
||||
cell.val.weight += getKernel(d/internal.smoothRadius) / r3;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue