Commit ed6041eb authored by graham's avatar graham
Browse files

ENH: Adding more useful information to sixDoFRigidBodyMotion restraint

reporting.

Making sixDoFRigidBodyMotionConstraints less verbose by default, now
requires debug switch to be set.
parent 9c694034
......@@ -726,6 +726,7 @@ DebugSwitches
shapeList 0;
shapeToCell 0;
simple 0;
sixDoFRigidBodyMotionConstraint 0;
skewCorrected 0;
skewCorrectionVectors 0;
sliced 0;
......
......@@ -248,10 +248,13 @@ void sixDoFRigidBodyDisplacementPointPatchVectorField::write(Ostream& os) const
{
pointPatchField<vector>::write(os);
os.writeKeyword("rhoInf") << rhoInf_ << token::END_STATEMENT << nl;
os.writeKeyword("rhoName") << rhoName_ << token::END_STATEMENT << nl;
if (rhoName_ == "rhoInf")
{
os.writeKeyword("rhoInf") << rhoInf_ << token::END_STATEMENT << nl;
}
if (lookupGravity_ == 0 || lookupGravity_ == -2)
{
os.writeKeyword("g") << g_ << token::END_STATEMENT << nl;
......
......@@ -40,7 +40,7 @@ void Foam::sixDoFRigidBodyMotion::applyRestraints()
{
if (report_)
{
Info<< "Restraint " << restraintNames_[rI];
Info<< "Restraint " << restraintNames_[rI] << ": ";
}
// restraint position
......@@ -89,9 +89,9 @@ void Foam::sixDoFRigidBodyMotion::applyConstraints(scalar deltaT)
forAll(constraints_, cI)
{
if (report_)
if (sixDoFRigidBodyMotionConstraint::debug)
{
Info<< "Constraint " << constraintNames_[cI];
Info<< "Constraint " << constraintNames_[cI] << ": ";
}
// constraint position
......
......@@ -121,7 +121,7 @@ bool Foam::sixDoFRigidBodyMotionConstraints::fixedAxis::constrain
bool converged(mag(theta) < tolerance_);
if (motion.report())
if (sixDoFRigidBodyMotionConstraint::debug)
{
Info<< " angle " << theta
<< " force " << constraintForceIncrement
......
......@@ -107,7 +107,7 @@ bool Foam::sixDoFRigidBodyMotionConstraints::fixedLine::constrain
bool converged(mag(error) < tolerance_);
if (motion.report())
if (sixDoFRigidBodyMotionConstraint::debug)
{
Info<< " error " << error
<< " force " << constraintForceIncrement
......
......@@ -143,7 +143,7 @@ bool Foam::sixDoFRigidBodyMotionConstraints::fixedOrientation::constrain
bool converged(mag(maxTheta) < tolerance_);
if (motion.report())
if (sixDoFRigidBodyMotionConstraint::debug)
{
Info<< " max angle " << maxTheta
<< " force " << constraintForceIncrement
......
......@@ -107,7 +107,7 @@ bool Foam::sixDoFRigidBodyMotionConstraints::fixedPlane::constrain
bool converged(mag(error) < tolerance_);
if (motion.report())
if (sixDoFRigidBodyMotionConstraint::debug)
{
Info<< " error " << error
<< " force " << constraintForceIncrement
......
......@@ -116,7 +116,7 @@ bool Foam::sixDoFRigidBodyMotionConstraints::fixedPoint::constrain
bool converged(mag(error) < tolerance_);
if (motion.report())
if (sixDoFRigidBodyMotionConstraint::debug)
{
Info<< " error " << error
<< " force " << constraintForceIncrement
......
......@@ -136,7 +136,7 @@ Foam::sixDoFRigidBodyMotionRestraints::linearAxialAngularSpring::restrain
if (motion.report())
{
Info<< " angle " << theta
Info<< " angle " << theta*sign(a & axis_)
<< " force " << restraintForce
<< " moment " << restraintMoment
<< endl;
......
......@@ -96,7 +96,8 @@ void Foam::sixDoFRigidBodyMotionRestraints::linearSpring::restrain
if (motion.report())
{
Info<< " spring length " << magR
Info<< " attachmentPt - anchor " << r
<< " spring length " << magR
<< " force " << restraintForce
<< " moment " << restraintMoment
<< endl;
......
......@@ -37,7 +37,6 @@ boundaryField
centreOfMass (0.5 0.5 0.5);
momentOfInertia (0.08622222 0.08622222 0.144);
mass 9.6;
rhoInf 1;
report on;
value uniform (0 0 0);
}
......
Markdown is supported
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