From 71b7f8932973ef61e48cc3f613a4f19e14c58678 Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 19 Aug 2009 11:47:52 +0100 Subject: [PATCH] more sensible variable names --- .../faceZonesIntegration.C | 39 +++++++++---------- .../faceZonesIntegration.H | 6 +-- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/src/postProcessing/functionObjects/zones/faceZoneIntegration/faceZonesIntegration.C b/src/postProcessing/functionObjects/zones/faceZoneIntegration/faceZonesIntegration.C index 36740cbf11..2899224d29 100644 --- a/src/postProcessing/functionObjects/zones/faceZoneIntegration/faceZonesIntegration.C +++ b/src/postProcessing/functionObjects/zones/faceZoneIntegration/faceZonesIntegration.C @@ -55,8 +55,8 @@ Foam::faceZonesIntegration::faceZonesIntegration obr_(obr), active_(true), log_(false), - faceZonesSet_(), - fItems_(), + zoneNames_(), + fieldNames_(), filePtr_(NULL) { // Check if the available mesh is an fvMesh otherise deactivate @@ -94,9 +94,9 @@ void Foam::faceZonesIntegration::read(const dictionary& dict) { log_ = dict.lookupOrDefault("log", false); - dict.lookup("fields") >> fItems_; + dict.lookup("fields") >> fieldNames_; - dict.lookup("faceZones") >> faceZonesSet_; + dict.lookup("faceZones") >> zoneNames_; } } @@ -132,11 +132,11 @@ void Foam::faceZonesIntegration::makeFile() mkDir(faceZonesIntegrationDir); // Open new file at start up - filePtr_.resize(fItems_.size()); + filePtr_.resize(fieldNames_.size()); - forAll(fItems_, Ifields) + forAll(fieldNames_, fieldI) { - const word& fieldName = fItems_[Ifields]; + const word& fieldName = fieldNames_[fieldI]; OFstream* sPtr = new OFstream ( @@ -163,10 +163,9 @@ void Foam::faceZonesIntegration::writeFileHeader() os << "#Time " << setw(w); - forAll (faceZonesSet_, zoneI) + forAll (zoneNames_, zoneI) { - const word name = faceZonesSet_[zoneI]; - os << name << setw(w); + os << zoneNames_[zoneI] << setw(w); } os << nl << endl; @@ -192,9 +191,9 @@ void Foam::faceZonesIntegration::write() { makeFile(); - forAll(fItems_, fieldI) + forAll(fieldNames_, fieldI) { - const word& fieldName = fItems_[fieldI]; + const word& fieldName = fieldNames_[fieldI]; const surfaceScalarField& sField = obr_.lookupObject(fieldName); @@ -203,17 +202,17 @@ void Foam::faceZonesIntegration::write() // 1. integrate over all face zones - scalarField integralVals(faceZonesSet_.size()); + scalarField integralVals(zoneNames_.size()); - forAll(faceZonesSet_, setI) + forAll(integralVals, zoneI) { - const word name = faceZonesSet_[setI]; + const word& name = zoneNames_[zoneI]; label zoneID = mesh.faceZones().findZoneID(name); const faceZone& fZone = mesh.faceZones()[zoneID]; - integralVals[setI] = returnReduce + integralVals[zoneI] = returnReduce ( calcIntegral(sField, fZone), sumOp() @@ -231,15 +230,15 @@ void Foam::faceZonesIntegration::write() os << obr_.time().value(); - forAll(integralVals, setI) + forAll(integralVals, zoneI) { - os << ' ' << setw(w) << integralVals[setI]; + os << ' ' << setw(w) << integralVals[zoneI]; if (log_) { Info<< "faceZonesIntegration output:" << nl - << " Integration[" << setI << "] " - << integralVals[setI] << endl; + << " Integration[" << zoneI << "] " + << integralVals[zoneI] << endl; } } diff --git a/src/postProcessing/functionObjects/zones/faceZoneIntegration/faceZonesIntegration.H b/src/postProcessing/functionObjects/zones/faceZoneIntegration/faceZonesIntegration.H index c2f3ad9d4b..d1a1bacfd2 100644 --- a/src/postProcessing/functionObjects/zones/faceZoneIntegration/faceZonesIntegration.H +++ b/src/postProcessing/functionObjects/zones/faceZoneIntegration/faceZonesIntegration.H @@ -82,11 +82,11 @@ protected: //- Switch to send output to Info as well as to file Switch log_; - //- faceZones to integrate over - wordList faceZonesSet_; + //- List of face zone names to integrate over + wordList zoneNames_; //- Names of the surface fields - wordList fItems_; + wordList fieldNames_; //- Current open files