BUG: sixDoFRigidBodyMotion, calling boolean function along with

boolean test was not actually calling the function.  Probably
optimised out.
This commit is contained in:
graham
2010-01-28 16:35:19 +00:00
parent 36ed688f2d
commit 79a14c4b7c

View File

@ -61,7 +61,7 @@ void Foam::sixDoFRigidBodyMotion::applyConstraints(scalar deltaT)
{ {
label iter = 0; label iter = 0;
bool converged = true; bool allConverged = true;
// constraint force accumulator // constraint force accumulator
vector cFA = vector::zero; vector cFA = vector::zero;
@ -86,7 +86,7 @@ void Foam::sixDoFRigidBodyMotion::applyConstraints(scalar deltaT)
} }
converged = true; allConverged = true;
forAll(constraints_, cI) forAll(constraints_, cI)
{ {
@ -101,7 +101,7 @@ void Foam::sixDoFRigidBodyMotion::applyConstraints(scalar deltaT)
// constraint moment // constraint moment
vector cM = vector::zero; vector cM = vector::zero;
converged = converged && constraints_[cI].constrain bool constraintConverged = constraints_[cI].constrain
( (
*this, *this,
cFA, cFA,
@ -112,6 +112,8 @@ void Foam::sixDoFRigidBodyMotion::applyConstraints(scalar deltaT)
cM cM
); );
allConverged = allConverged && constraintConverged;
// Accumulate constraint force // Accumulate constraint force
cFA += cF; cFA += cF;
@ -119,7 +121,7 @@ void Foam::sixDoFRigidBodyMotion::applyConstraints(scalar deltaT)
cMA += cM + ((cP - centreOfMass()) ^ cF); cMA += cM + ((cP - centreOfMass()) ^ cF);
} }
} while(!converged); } while(!allConverged);
Info<< "Constraints converged in " << iter << " iterations" << nl Info<< "Constraints converged in " << iter << " iterations" << nl
<< "Constraint force: " << cFA << nl << "Constraint force: " << cFA << nl