diff --git a/src/randomProcesses/Kmesh/Kmesh.C b/src/randomProcesses/Kmesh/Kmesh.C index c28db5e1e0..a251459de0 100644 --- a/src/randomProcesses/Kmesh/Kmesh.C +++ b/src/randomProcesses/Kmesh/Kmesh.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,34 +30,27 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -namespace Foam +inline Foam::label Foam::Kmesh::index +( + const label i, + const label j, + const label k, + const labelList& nn +) { - //! \cond fileScope - inline label rep - ( - const label i, - const label j, - const label k, - const labelList& nn - ) - { - return (k + j*nn[2] + i*nn[1]*nn[2]); - } - //! \endcond - -} // End namespace Foam + return (k + j*nn[2] + i*nn[1]*nn[2]); +} // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// from fvMesh Foam::Kmesh::Kmesh(const fvMesh& mesh) : vectorField(mesh.V().size()), - NN(vector::dim) + nn_(vector::dim) { boundBox box = mesh.bounds(); - L = box.span(); + l_ = box.span(); vector cornerCellCentre = ::Foam::max(mesh.C().internalField()); vector cellL = 2*(box.max() - cornerCellCentre); @@ -65,18 +58,17 @@ Foam::Kmesh::Kmesh(const fvMesh& mesh) vector rdeltaByL; label nTot = 1; - label i; - forAll(NN, i) + forAll(nn_, i) { - NN[i] = label(L[i]/cellL[i] + 0.5); - nTot *= NN[i]; + nn_[i] = label(l_[i]/cellL[i] + 0.5); + nTot *= nn_[i]; - if (NN[i] > 1) + if (nn_[i] > 1) { - L[i] -= cellL[i]; + l_[i] -= cellL[i]; } - rdeltaByL[i] = NN[i]/(L[i]*L[i]); + rdeltaByL[i] = nn_[i]/(l_[i]*l_[i]); } if (nTot != mesh.nCells()) @@ -86,24 +78,31 @@ Foam::Kmesh::Kmesh(const fvMesh& mesh) << abort(FatalError); } - for (i=0; i