BUG: sixDoF BCs - corrected output to Ostream

This commit is contained in:
andy
2014-01-20 14:10:03 +00:00
parent a9ce01c68f
commit ae73181bc1
30 changed files with 111 additions and 95 deletions

View File

@ -1,4 +1,5 @@
EXE_INC = \
-DFULLDEBUG -g -O0 \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/postProcessing/functionObjects/forces/lnInclude \

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -116,7 +116,7 @@ bool Foam::sixDoFRigidBodyMotionConstraints::axis::read
}
void Foam::sixDoFRigidBodyMotionConstraints::axis::write
void Foam::sixDoFRigidBodyMotionConstraints::axis::writeData
(
Ostream& os
) const
@ -125,4 +125,5 @@ void Foam::sixDoFRigidBodyMotionConstraints::axis::write
<< axis_ << token::END_STATEMENT << nl;
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -101,8 +101,8 @@ public:
//- Update properties from given dictionary
virtual bool read(const dictionary& sDoFRBMCCoeff);
//- Write
virtual void write(Ostream&) const;
//- Write model data
virtual void writeData(Ostream&) const;
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -116,7 +116,7 @@ bool Foam::sixDoFRigidBodyMotionConstraints::line::read
}
void Foam::sixDoFRigidBodyMotionConstraints::line::write
void Foam::sixDoFRigidBodyMotionConstraints::line::writeData
(
Ostream& os
) const
@ -125,4 +125,5 @@ void Foam::sixDoFRigidBodyMotionConstraints::line::write
<< dir_ << token::END_STATEMENT << nl;
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -100,8 +100,8 @@ public:
//- Update properties from given dictionary
virtual bool read(const dictionary& sDoFRBMCCoeff);
//- Write
virtual void write(Ostream&) const;
//- Write model data
virtual void writeData(Ostream&) const;
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -96,11 +96,11 @@ bool Foam::sixDoFRigidBodyMotionConstraints::orientation::read
}
void Foam::sixDoFRigidBodyMotionConstraints::orientation::write
void Foam::sixDoFRigidBodyMotionConstraints::orientation::writeData
(
Ostream& os
) const
{
}
{}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -94,8 +94,8 @@ public:
//- Update properties from given dictionary
virtual bool read(const dictionary& sDoFRBMCCoeff);
//- Write
virtual void write(Ostream&) const;
//- Write model data
virtual void writeData(Ostream&) const;
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -97,7 +97,7 @@ bool Foam::sixDoFRigidBodyMotionConstraints::plane::read
}
void Foam::sixDoFRigidBodyMotionConstraints::plane::write
void Foam::sixDoFRigidBodyMotionConstraints::plane::writeData
(
Ostream& os
) const
@ -106,4 +106,5 @@ void Foam::sixDoFRigidBodyMotionConstraints::plane::write
<< normal_ << token::END_STATEMENT << nl;
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -100,8 +100,8 @@ public:
//- Update properties from given dictionary
virtual bool read(const dictionary& sDoFRBMCCoeff);
//- Write
virtual void write(Ostream&) const;
//- Write model data
virtual void writeData(Ostream&) const;
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -97,7 +97,7 @@ bool Foam::sixDoFRigidBodyMotionConstraints::point::read
}
void Foam::sixDoFRigidBodyMotionConstraints::point::write
void Foam::sixDoFRigidBodyMotionConstraints::point::writeData
(
Ostream& os
) const
@ -106,4 +106,5 @@ void Foam::sixDoFRigidBodyMotionConstraints::point::write
<< point_ << token::END_STATEMENT << nl;
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -103,8 +103,8 @@ public:
//- Update properties from given dictionary
virtual bool read(const dictionary& sDoFRBMCCoeff);
//- Write
virtual void write(Ostream&) const;
//- Write model data
virtual void writeData(Ostream&) const;
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -60,14 +60,21 @@ bool Foam::sixDoFRigidBodyMotionConstraint::read
const dictionary& sDoFRBMCDict
)
{
sDoFRBMCCoeffs_ = sDoFRBMCDict;
sDoFRBMCCoeffs_ = sDoFRBMCDict.subDict(type() + "Coeffs");
return true;
}
void Foam::sixDoFRigidBodyMotionConstraint::write(Ostream& os) const
{}
{
os << indent << word(type() + "Coeffs") << nl
<< indent << token::BEGIN_BLOCK << nl << incrIndent;
writeData(os);
os << decrIndent << indent << token::END_BLOCK << endl;
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -146,8 +146,12 @@ public:
return sDoFRBMCCoeffs_;
}
//- Write
virtual void write(Ostream&) const;
//- Write model data
virtual void writeData(Ostream&) const = 0;
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -34,10 +34,7 @@ Foam::sixDoFRigidBodyMotionConstraint::New
const dictionary& sDoFRBMCDict
)
{
const word constraintType
(
sDoFRBMCDict.lookup("sixDoFRigidBodyMotionConstraint")
);
const word constraintType(sDoFRBMCDict.lookup(typeName));
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(constraintType);
@ -48,11 +45,12 @@ Foam::sixDoFRigidBodyMotionConstraint::New
(
"sixDoFRigidBodyMotionConstraint::New"
"("
"const dictionary& sDoFRBMCDict"
"const word&, "
"const dictionary&"
")"
) << "Unknown sixDoFRigidBodyMotionConstraint type "
) << "Unknown " << typeName << " type "
<< constraintType << nl << nl
<< "Valid sixDoFRigidBodyMotionConstraints are : " << endl
<< "Valid " << typeName << "s are : " << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -195,7 +195,7 @@ bool Foam::sixDoFRigidBodyMotionRestraints::linearAxialAngularSpring::read
}
void Foam::sixDoFRigidBodyMotionRestraints::linearAxialAngularSpring::write
void Foam::sixDoFRigidBodyMotionRestraints::linearAxialAngularSpring::writeData
(
Ostream& os
) const
@ -213,4 +213,5 @@ void Foam::sixDoFRigidBodyMotionRestraints::linearAxialAngularSpring::write
<< damping_ << token::END_STATEMENT << nl;
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -114,8 +114,8 @@ public:
//- Update properties from given dictionary
virtual bool read(const dictionary& sDoFRBMRCoeff);
//- Write
virtual void write(Ostream&) const;
//- Write model data
virtual void writeData(Ostream&) const;
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -100,7 +100,7 @@ bool Foam::sixDoFRigidBodyMotionRestraints::linearDamper::read
}
void Foam::sixDoFRigidBodyMotionRestraints::linearDamper::write
void Foam::sixDoFRigidBodyMotionRestraints::linearDamper::writeData
(
Ostream& os
) const

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -104,8 +104,8 @@ public:
//- Update properties from given dictionary
virtual bool read(const dictionary& sDoFRBMRCoeff);
//- Write
virtual void write(Ostream&) const;
//- Write model data
virtual void writeData(Ostream&) const;
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -120,7 +120,7 @@ bool Foam::sixDoFRigidBodyMotionRestraints::linearSpring::read
}
void Foam::sixDoFRigidBodyMotionRestraints::linearSpring::write
void Foam::sixDoFRigidBodyMotionRestraints::linearSpring::writeData
(
Ostream& os
) const
@ -141,4 +141,5 @@ void Foam::sixDoFRigidBodyMotionRestraints::linearSpring::write
<< restLength_ << token::END_STATEMENT << nl;
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -117,8 +117,8 @@ public:
//- Update properties from given dictionary
virtual bool read(const dictionary& sDoFRBMRCoeff);
//- Write
virtual void write(Ostream&) const;
//- Write model data
virtual void writeData(Ostream&) const;
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -66,4 +66,15 @@ bool Foam::sixDoFRigidBodyMotionRestraint::read
}
void Foam::sixDoFRigidBodyMotionRestraint::write(Ostream& os) const
{
os << indent << word(type() + "Coeffs") << nl
<< indent << token::BEGIN_BLOCK << nl << incrIndent;
writeData(os);
os << decrIndent << indent << token::END_BLOCK << endl;
}
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -150,8 +150,12 @@ public:
return sDoFRBMRCoeffs_;
}
//- Write
virtual void write(Ostream&) const = 0;
virtual void write(Ostream&) const;
//- Write model data
virtual void writeData(Ostream&) const = 0;
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -34,10 +34,7 @@ Foam::sixDoFRigidBodyMotionRestraint::New
const dictionary& sDoFRBMRDict
)
{
const word restraintType
(
sDoFRBMRDict.lookup("sixDoFRigidBodyMotionRestraint")
);
const word restraintType(sDoFRBMRDict.lookup(typeName));
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(restraintType);
@ -48,11 +45,12 @@ Foam::sixDoFRigidBodyMotionRestraint::New
(
"sixDoFRigidBodyMotionRestraint::New"
"("
"const dictionary& sDoFRBMRDict"
"const word&, "
"const dictionary&"
")"
) << "Unknown sixDoFRigidBodyMotionRestraint type "
) << "Unknown " << typeName << " type "
<< restraintType << nl << nl
<< "Valid sixDoFRigidBodyMotionRestraint types are : " << endl
<< "Valid " << typeName << " s types are : " << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -102,7 +102,7 @@ bool Foam::sixDoFRigidBodyMotionRestraints::sphericalAngularDamper::read
}
void Foam::sixDoFRigidBodyMotionRestraints::sphericalAngularDamper::write
void Foam::sixDoFRigidBodyMotionRestraints::sphericalAngularDamper::writeData
(
Ostream& os
) const

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -103,8 +103,8 @@ public:
//- Update properties from given dictionary
virtual bool read(const dictionary& sDoFRBMRCoeff);
//- Write
virtual void write(Ostream&) const;
//- Write model data
virtual void writeData(Ostream&) const;
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -147,7 +147,7 @@ bool Foam::sixDoFRigidBodyMotionRestraints::sphericalAngularSpring::read
}
void Foam::sixDoFRigidBodyMotionRestraints::sphericalAngularSpring::write
void Foam::sixDoFRigidBodyMotionRestraints::sphericalAngularSpring::writeData
(
Ostream& os
) const

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -111,8 +111,8 @@ public:
//- Update properties from given dictionary
virtual bool read(const dictionary& sDoFRBMRCoeff);
//- Write
virtual void write(Ostream&) const;
//- Write model data
virtual void writeData(Ostream&) const;
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -221,7 +221,8 @@ bool Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring::read
}
void Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring::write
void Foam::sixDoFRigidBodyMotionRestraints::tabulatedAxialAngularSpring::
writeData
(
Ostream& os
) const

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -121,8 +121,8 @@ public:
//- Update properties from given dictionary
virtual bool read(const dictionary& sDoFRBMRCoeff);
//- Write
virtual void write(Ostream&) const;
//- Write model data
virtual void writeData(Ostream&) const;
};

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -60,14 +60,8 @@ void Foam::sixDoFRigidBodyMotion::write(Ostream& os) const
os.writeKeyword("sixDoFRigidBodyMotionRestraint")
<< restraintType << token::END_STATEMENT << nl;
os.writeKeyword(word(restraintType + "Coeffs")) << nl;
os << indent << token::BEGIN_BLOCK << nl << incrIndent;
restraints_[rI].write(os);
os << decrIndent << indent << token::END_BLOCK << nl;
os << decrIndent << indent << token::END_BLOCK << endl;
}
@ -89,16 +83,8 @@ void Foam::sixDoFRigidBodyMotion::write(Ostream& os) const
os.writeKeyword("sixDoFRigidBodyMotionConstraint")
<< constraintType << token::END_STATEMENT << nl;
constraints_[rI].sixDoFRigidBodyMotionConstraint::write(os);
os.writeKeyword(word(constraintType + "Coeffs")) << nl;
os << indent << token::BEGIN_BLOCK << nl << incrIndent;
constraints_[rI].write(os);
os << decrIndent << indent << token::END_BLOCK << nl;
os << decrIndent << indent << token::END_BLOCK << endl;
}