From 8a935055897ee3c65ecf0b4c4b5ea67c2b1890bb Mon Sep 17 00:00:00 2001 From: graham Date: Fri, 1 Jul 2011 17:14:02 +0100 Subject: [PATCH] BUG: Wrong loop structure for molecule tests. --- .../polyatomicCloud/polyatomicCloud.C | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/lagrangian/molecularDynamics/molecule/polyatomic/polyatomicCloud/polyatomicCloud.C b/src/lagrangian/molecularDynamics/molecule/polyatomic/polyatomicCloud/polyatomicCloud.C index a49d9d2319..0d2a7c4f9a 100644 --- a/src/lagrangian/molecularDynamics/molecule/polyatomic/polyatomicCloud/polyatomicCloud.C +++ b/src/lagrangian/molecularDynamics/molecule/polyatomic/polyatomicCloud/polyatomicCloud.C @@ -284,7 +284,7 @@ void Foam::polyatomicCloud::removeHighEnergyOverlaps() forAll(dil, d) { - forAll(cellOccupancy_[d],cellIMols) + forAll(cellOccupancy_[d], cellIMols) { molI = cellOccupancy_[d][cellIMols]; @@ -322,35 +322,35 @@ void Foam::polyatomicCloud::removeHighEnergyOverlaps() } } } - } - forAll(cellOccupancy_[d], cellIOtherMols) - { - molJ = cellOccupancy_[d][cellIOtherMols]; - - if (molJ > molI) + forAll(cellOccupancy_[d], cellIOtherMols) { - if (evaluatePotentialLimit(*molI, *molJ)) + molJ = cellOccupancy_[d][cellIOtherMols]; + + if (molJ > molI) { - label idI = molI->id(); - - label idJ = molJ->id(); - - if - ( - idI == idJ - || findIndex(pot_.removalOrder(), idJ) - < findIndex(pot_.removalOrder(), idI) - ) + if (evaluatePotentialLimit(*molI, *molJ)) { - if (findIndex(molsToDelete, molJ) == -1) + label idI = molI->id(); + + label idJ = molJ->id(); + + if + ( + idI == idJ + || findIndex(pot_.removalOrder(), idJ) + < findIndex(pot_.removalOrder(), idI) + ) { - molsToDelete.append(molJ); + if (findIndex(molsToDelete, molJ) == -1) + { + molsToDelete.append(molJ); + } + } + else if (findIndex(molsToDelete, molI) == -1) + { + molsToDelete.append(molI); } - } - else if (findIndex(molsToDelete, molI) == -1) - { - molsToDelete.append(molI); } } }