BUG: sixDoFRigidBodyMotion. Was not skipping constraints and

restraints when there were none read.  Was not a problem for
restraints, but constraints were stopping the code on a maxIteration
trap, as it defaults to zero.
This commit is contained in:
graham
2010-02-04 19:26:19 +00:00
parent 9c52c9f1cf
commit fbcfa196f2
3 changed files with 16 additions and 0 deletions

View File

@ -30,6 +30,11 @@ License
void Foam::sixDoFRigidBodyMotion::applyRestraints()
{
if (restraints_.size() == 0)
{
return;
}
if (Pstream::master())
{
forAll(restraints_, rI)
@ -57,6 +62,11 @@ void Foam::sixDoFRigidBodyMotion::applyRestraints()
void Foam::sixDoFRigidBodyMotion::applyConstraints(scalar deltaT)
{
if (constraints_.size() == 0)
{
return;
}
if (Pstream::master())
{
label iter = 0;

View File

@ -69,6 +69,9 @@ bool Foam::sixDoFRigidBodyMotionConstraint::read
const dictionary& sDoFRBMCDict
)
{
name_ =
fileName(sDoFRBMCDict.name().name()).components(token::COLON).last();
tolerance_ = (readScalar(sDoFRBMCDict.lookup("tolerance")));
relaxationFactor_ = sDoFRBMCDict.lookupOrDefault<scalar>

View File

@ -64,6 +64,9 @@ bool Foam::sixDoFRigidBodyMotionRestraint::read
const dictionary& sDoFRBMRDict
)
{
name_ =
fileName(sDoFRBMRDict.name().name()).components(token::COLON).last();
sDoFRBMRCoeffs_ = sDoFRBMRDict.subDict(type() + "Coeffs");
return true;