From dae6cbbea7580c5de320f7cccd3f61eb0b660c96 Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 26 Mar 2009 11:34:32 +0000 Subject: [PATCH] cosmetics --- .../interpolationLookUpTable.C | 82 ++++++++----------- .../interpolationLookUpTable.H | 12 +-- .../greyMeanAbsorptionEmission.H | 2 +- 3 files changed, 42 insertions(+), 54 deletions(-) diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/interpolationLookUpTable/interpolationLookUpTable.C b/src/thermophysicalModels/radiation/radiationModel/fvDOM/interpolationLookUpTable/interpolationLookUpTable.C index e9e28658c4..f000e43fa3 100755 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/interpolationLookUpTable/interpolationLookUpTable.C +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/interpolationLookUpTable/interpolationLookUpTable.C @@ -29,23 +29,23 @@ License // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // template -Foam::label Foam::interpolationLookUpTable ::index +Foam::label Foam::interpolationLookUpTable::index ( const List& indices, const bool lastDim ) const { - label totalindex = 0; + label totalIndex = 0; - for (int i = 0; i < dim_.size() - 1; i++) + forAll(dim_, i) { label dim = 1; for (int j = i + 1; j < dim_.size(); j++) { - dim *=(dim_[j]+1); + dim *= dim_[j] + 1; } - totalindex += + totalIndex += dim *min ( @@ -57,7 +57,7 @@ Foam::label Foam::interpolationLookUpTable ::index if (lastDim) { label iLastdim = dim_.size() - 1; - totalindex += Foam::min + totalIndex += Foam::min ( max ( @@ -68,12 +68,12 @@ Foam::label Foam::interpolationLookUpTable ::index ); } - return totalindex; + return totalIndex; } template -Foam::label Foam::interpolationLookUpTable ::index +Foam::label Foam::interpolationLookUpTable::index ( const scalar indice ) const @@ -171,15 +171,15 @@ void Foam::interpolationLookUpTable::dimensionTable() max_[i] = readScalar(entries_[i].lookup("max")); min_[i] = readScalar(entries_[i].lookup("min")); delta_[i] = (max_[i] - min_[i])/dim_[i]; - tableDim *= (dim_[i] + 1); - fieldIndices_.insert(entries_[i].lookup("name"),index); + tableDim *= dim_[i] + 1; + fieldIndices_.insert(entries_[i].lookup("name"), index); entryIndices_[i] = index; index++; } forAll(output_,i) { - fieldIndices_.insert(output_[i].lookup("name"),index); + fieldIndices_.insert(output_[i].lookup("name"), index); outputIndices_[i] = index; index++; } @@ -229,8 +229,7 @@ void Foam::interpolationLookUpTable::readTable FatalErrorIn ( "Foam::interpolationLookUpTable::readTable()" - ) << "table is empty" << nl - << exit(FatalError); + ) << "table is empty" << nl << exit(FatalError); } } @@ -240,7 +239,7 @@ void Foam::interpolationLookUpTable::readTable template Foam::interpolationLookUpTable::interpolationLookUpTable() : - List(), + List(), fileName_("fileNameIsUndefined") {} @@ -251,7 +250,7 @@ Foam::interpolationLookUpTable::interpolationLookUpTable const fileName& fn, const word& instance, const fvMesh& mesh ) : - List(), + List(), fileName_(fn), dim_(0), min_(0), @@ -273,7 +272,7 @@ Foam::interpolationLookUpTable::interpolationLookUpTable const interpolationLookUpTable& interpTable ) : - List(interpTable), + List(interpTable), fileName_(interpTable.fileName_), entryIndices_(interpTable.entryIndices_), outputIndices_(interpTable.outputIndices_), @@ -293,7 +292,7 @@ Foam::interpolationLookUpTable::interpolationLookUpTable const dictionary& dict ) : - List(), + List(), fileName_(fileName(dict.lookup("fileName")).expand()), dim_(0), min_(0.0), @@ -315,20 +314,19 @@ Foam::interpolationLookUpTable::interpolationLookUpTable template void Foam::interpolationLookUpTable::check() const { -// check order in the first dimension. - - scalar prevValue = List::operator[](0).operator[](0); - label dim = 1 ; + // check order in the first dimension. + scalar prevValue = List::operator[](0).operator[](0); + label dim = 1; for (int j = 1; j < dim_.size(); j++) { - dim *=(dim_[j]+1); + dim *= dim_[j] + 1; } for (label i = 1; i < dim_[0]; i++) { label index = i*dim; const scalar currValue = - List::operator[](0).operator[](index); + List::operator[](0).operator[](index); // avoid duplicate values (divide-by-zero error) if (currValue <= prevValue) @@ -336,9 +334,8 @@ void Foam::interpolationLookUpTable::check() const FatalErrorIn ( "Foam::interpolationLookUpTable::checkOrder() const" - ) << "out-of-order value: " - << currValue << " at index " << index << nl - << exit(FatalError); + ) << "out-of-order value: " << currValue + << " at index " << index << nl << exit(FatalError); } prevValue = currValue; } @@ -379,8 +376,7 @@ void Foam::interpolationLookUpTable::write FatalErrorIn ( "Foam::interpolationTable::write()" - ) << "table is empty" << nl - << exit(FatalError); + ) << "table is empty" << nl << exit(FatalError); } os.writeKeyword("values"); os << *this << token::END_STATEMENT << nl; @@ -400,31 +396,25 @@ Foam::interpolationLookUpTable::operator[](const label i) { FatalErrorIn ( - "Foam::interpolationLookUpTable::operator[]" - "(const label) const" - ) << "table has (" << n << ") columns" << nl - << exit(FatalError); + "Foam::interpolationLookUpTable::operator[](const label)" + ) << "table has (" << n << ") columns" << nl << exit(FatalError); } else if (ii < 0) { FatalErrorIn ( - "Foam::interpolationLookUpTable::operator[]" - "(const label) const" - ) << "index (" << ii << ") underflow" << nl - << exit(FatalError); + "Foam::interpolationLookUpTable::operator[](const label)" + ) << "index (" << ii << ") underflow" << nl << exit(FatalError); } else if (ii > n) { FatalErrorIn ( - "Foam::interpolationLookUpTable::operator[]" - "(const label) const" - ) << "index (" << ii << ") overflow" << nl - << exit(FatalError); + "Foam::interpolationLookUpTable::operator[](const label)" + ) << "index (" << ii << ") overflow" << nl << exit(FatalError); } - return List::operator[](ii); + return List::operator[](ii); } @@ -441,8 +431,7 @@ Foam::interpolationLookUpTable::operator[](const label i) const ( "Foam::interpolationLookUpTable::operator[]" "(const label) const" - ) << "table has (" << n << ") columns" << nl - << exit(FatalError); + ) << "table has (" << n << ") columns" << nl << exit(FatalError); } else if (ii < 0) { @@ -450,8 +439,7 @@ Foam::interpolationLookUpTable::operator[](const label i) const ( "Foam::interpolationLookUpTable::operator[]" "(const label) const" - ) << "index (" << ii << ") underflow" << nl - << exit(FatalError); + ) << "index (" << ii << ") underflow" << nl << exit(FatalError); } else if (ii > n) @@ -464,7 +452,7 @@ Foam::interpolationLookUpTable::operator[](const label i) const << exit(FatalError); } - return List::operator[](ii); + return List::operator[](ii); } @@ -500,7 +488,7 @@ void Foam::interpolationLookUpTable::findHi forAll(entryIndices_,i) { - if (checkRange(retvals,entryIndices_[i])) + if (checkRange(retvals, entryIndices_[i])) { label dim = 1; diff --git a/src/thermophysicalModels/radiation/radiationModel/fvDOM/interpolationLookUpTable/interpolationLookUpTable.H b/src/thermophysicalModels/radiation/radiationModel/fvDOM/interpolationLookUpTable/interpolationLookUpTable.H index d2518d4e02..6140ae4bc3 100755 --- a/src/thermophysicalModels/radiation/radiationModel/fvDOM/interpolationLookUpTable/interpolationLookUpTable.H +++ b/src/thermophysicalModels/radiation/radiationModel/fvDOM/interpolationLookUpTable/interpolationLookUpTable.H @@ -54,7 +54,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class interpolationLookUpTable Declaration + Class interpolationLookUpTable Declaration \*---------------------------------------------------------------------------*/ template @@ -64,22 +64,22 @@ class interpolationLookUpTable { private: - // Private data + // Privsate data //- File name fileName fileName_; //- Table dimensions - List