ENH: Refactored function objects to make use of new base class

This commit is contained in:
andy
2012-10-15 17:59:38 +01:00
parent d8321469e9
commit 72d49281ce
27 changed files with 225 additions and 612 deletions

View File

@ -85,14 +85,11 @@ void Foam::forceCoeffs::read(const dictionary& dict)
}
void Foam::forceCoeffs::writeFileHeader()
void Foam::forceCoeffs::writeFileHeader(const label i)
{
if (forcesFilePtr_.valid())
{
forcesFilePtr_()
<< "# Time" << tab << "Cm" << tab << "Cd" << tab << "Cl" << tab
<< "Cl(f)" << "Cl(r)" << endl;
}
file()
<< "# Time" << tab << "Cm" << tab << "Cd" << tab << "Cl" << tab
<< "Cl(f)" << "Cl(r)" << endl;
}
@ -112,12 +109,12 @@ void Foam::forceCoeffs::write()
{
if (active_)
{
// Create the forces file if not already created
makeFile();
forces::calcForcesMoment();
if (Pstream::master())
{
functionObjectFile::write();
scalar pDyn = 0.5*rhoRef_*magUInf_*magUInf_;
Field<vector> totForce(force_[0] + force_[1]);
@ -140,7 +137,7 @@ void Foam::forceCoeffs::write()
scalar Clf = Cl/2.0 - Cm;
scalar Clr = Cl/2.0 + Cm;
forcesFilePtr_()
file()
<< obr_.time().value() << tab
<< Cm << tab << Cd << tab << Cl << tab << Clf << tab << Clr
<< endl;

View File

@ -146,7 +146,7 @@ class forceCoeffs
protected:
//- Output file header information
virtual void writeFileHeader();
virtual void writeFileHeader(const label i);
public: