Skip to content
Snippets Groups Projects
Commit a3a04cea authored by Henry Weller's avatar Henry Weller
Browse files

ORourkeCollision: Cache access to the UList of parcel pointers for cell

parent d60ae9a4
Branches
Tags
No related merge requests found
......@@ -56,14 +56,16 @@ void Foam::ORourkeCollision<CloudType>::collide(const scalar dt)
for (label celli=0; celli<this->owner().mesh().nCells(); celli++)
{
if (pInCell[celli].size() >= 2)
UList<parcelType*> pInCelli(pInCell[celli]);
if (pInCelli.size() >= 2)
{
forAll(pInCell[celli], i)
forAll(pInCelli, i)
{
for (label j=i+1; j<pInCell[celli].size(); j++)
for (label j=i+1; j<pInCelli.size(); j++)
{
parcelType& p1 = *pInCell[celli][i];
parcelType& p2 = *pInCell[celli][j];
parcelType& p1 = *pInCelli[i];
parcelType& p2 = *pInCelli[j];
scalar m1 = p1.nParticle()*p1.mass();
scalar m2 = p2.nParticle()*p2.mass();
......
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