Skip to content
Snippets Groups Projects
Commit 79a14c4b authored by graham's avatar graham
Browse files

BUG: sixDoFRigidBodyMotion, calling boolean function along with

boolean test was not actually calling the function.  Probably
optimised out.
parent 36ed688f
Branches
Tags
Loading
...@@ -61,7 +61,7 @@ void Foam::sixDoFRigidBodyMotion::applyConstraints(scalar deltaT) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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) ...@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment