Tweaks for speed

This commit is contained in:
Guilhem Lavaux 2022-01-29 08:22:08 +01:00
parent 8ab094ad3d
commit d875416200
2 changed files with 128 additions and 135 deletions

View file

@ -192,7 +192,9 @@ void SPHSmooth<ValType,Ndims>::addGridSite(const typename SPHTree::coords& c)
{
ComputePrecision d = internal.distances[i];
SPHCell& cell = *(internal.ngb[i]);
cell.val.weight += getKernel(d/internal.smoothRadius) / r3;
double kernel_value = getKernel(d/internal.smoothRadius) / r3;
#pragma omp atomic
cell.val.weight += kernel_value;
}
}