From 35485351119d73c92e01f1483baebc80c7b40dec Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 21 Nov 2013 10:00:26 +0000 Subject: [PATCH] ENH: Code formatting updates --- .../mappedPolyPatch/mappedPatchBase.H | 1 + .../sampledPatch/sampledPatch.C | 6 +- .../sampledPatch/sampledPatch.H | 168 +++++++++--------- .../sampledPatchInternalField.C | 3 +- .../sampledPatchInternalField.H | 107 +++++------ .../sampledSurfacesTemplates.C | 10 +- 6 files changed, 155 insertions(+), 140 deletions(-) diff --git a/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.H b/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.H index 928a1d5b85..7dd98c1806 100644 --- a/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.H +++ b/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.H @@ -392,6 +392,7 @@ public: //- Get the patch on the region const polyPatch& samplePolyPatch() const; + // Helpers //- Get the sample points diff --git a/src/sampling/sampledSurface/sampledPatch/sampledPatch.C b/src/sampling/sampledSurface/sampledPatch/sampledPatch.C index da2d90c9fa..b100f7ed74 100644 --- a/src/sampling/sampledSurface/sampledPatch/sampledPatch.C +++ b/src/sampling/sampledSurface/sampledPatch/sampledPatch.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -248,6 +248,7 @@ Foam::tmp Foam::sampledPatch::sample return sampleField(vField); } + Foam::tmp Foam::sampledPatch::sample ( const volSphericalTensorField& vField @@ -292,6 +293,7 @@ Foam::tmp Foam::sampledPatch::sample return sampleField(sField); } + Foam::tmp Foam::sampledPatch::sample ( const surfaceSphericalTensorField& sField @@ -318,6 +320,7 @@ Foam::tmp Foam::sampledPatch::sample return sampleField(sField); } + Foam::tmp Foam::sampledPatch::interpolate ( const interpolation& interpolator @@ -335,6 +338,7 @@ Foam::tmp Foam::sampledPatch::interpolate return interpolateField(interpolator); } + Foam::tmp Foam::sampledPatch::interpolate ( const interpolation& interpolator diff --git a/src/sampling/sampledSurface/sampledPatch/sampledPatch.H b/src/sampling/sampledSurface/sampledPatch/sampledPatch.H index 0385f96a63..f0b810a5ba 100644 --- a/src/sampling/sampledSurface/sampledPatch/sampledPatch.H +++ b/src/sampling/sampledSurface/sampledPatch/sampledPatch.H @@ -53,7 +53,8 @@ class sampledPatch public sampledSurface { //- Private typedefs for convenience - typedef MeshedSurface MeshStorage; + typedef MeshedSurface MeshStorage; + // Private data @@ -78,16 +79,17 @@ class sampledPatch //- Start indices (in patchFaceLabels_) of patches labelList patchStart_; + // Private Member Functions - //- sample field on faces + //- Sample field on faces template tmp > sampleField ( const GeometricField& vField ) const; - //- sample surface field on faces + //- Sample surface field on faces template tmp > sampleField ( @@ -95,10 +97,9 @@ class sampledPatch ) const; template - tmp > - interpolateField(const interpolation&) const; + tmp > interpolateField(const interpolation&) const; - //- remap action on triangulation or cleanup + //- Re-map action on triangulation or cleanup virtual void remapFaces(const labelUList& faceMap); @@ -180,96 +181,99 @@ public: } - //- sample field on surface - virtual tmp sample - ( - const volScalarField& - ) const; + // Sample + //- Sample field on surface + virtual tmp sample + ( + const volScalarField& + ) const; - //- sample field on surface - virtual tmp sample - ( - const volVectorField& - ) const; + //- Sample field on surface + virtual tmp sample + ( + const volVectorField& + ) const; - //- sample field on surface - virtual tmp sample - ( - const volSphericalTensorField& - ) const; + //- Sample field on surface + virtual tmp sample + ( + const volSphericalTensorField& + ) const; - //- sample field on surface - virtual tmp sample - ( - const volSymmTensorField& - ) const; + //- Sample field on surface + virtual tmp sample + ( + const volSymmTensorField& + ) const; - //- sample field on surface - virtual tmp sample - ( - const volTensorField& - ) const; + //- Sample field on surface + virtual tmp sample + ( + const volTensorField& + ) const; - //- Surface sample field on surface - virtual tmp sample - ( - const surfaceScalarField& - ) const; + //- Surface sample field on surface + virtual tmp sample + ( + const surfaceScalarField& + ) const; - //- Surface Sample field on surface - virtual tmp sample - ( - const surfaceVectorField& - ) const; + //- Surface Sample field on surface + virtual tmp sample + ( + const surfaceVectorField& + ) const; - //- Surface sample field on surface - virtual tmp sample - ( - const surfaceSphericalTensorField& - ) const; + //- Surface sample field on surface + virtual tmp sample + ( + const surfaceSphericalTensorField& + ) const; - //- Surface sample field on surface - virtual tmp sample - ( - const surfaceSymmTensorField& - ) const; + //- Surface sample field on surface + virtual tmp sample + ( + const surfaceSymmTensorField& + ) const; - //- Surface sample field on surface - virtual tmp sample - ( - const surfaceTensorField& - ) const; - - //- interpolate field on surface - virtual tmp interpolate - ( - const interpolation& - ) const; + //- Surface sample field on surface + virtual tmp sample + ( + const surfaceTensorField& + ) const; - //- interpolate field on surface - virtual tmp interpolate - ( - const interpolation& - ) const; + // Interpolate - //- interpolate field on surface - virtual tmp interpolate - ( - const interpolation& - ) const; + //- Interpolate field on surface + virtual tmp interpolate + ( + const interpolation& + ) const; - //- interpolate field on surface - virtual tmp interpolate - ( - const interpolation& - ) const; + //- Interpolate field on surface + virtual tmp interpolate + ( + const interpolation& + ) const; - //- interpolate field on surface - virtual tmp interpolate - ( - const interpolation& - ) const; + //- Interpolate field on surface + virtual tmp interpolate + ( + const interpolation& + ) const; + + //- Interpolate field on surface + virtual tmp interpolate + ( + const interpolation& + ) const; + + //- Interpolate field on surface + virtual tmp interpolate + ( + const interpolation& + ) const; //- Write virtual void print(Ostream&) const; diff --git a/src/sampling/sampledSurface/sampledPatchInternalField/sampledPatchInternalField.C b/src/sampling/sampledSurface/sampledPatchInternalField/sampledPatchInternalField.C index 4f16bbed59..a133fdd8ce 100644 --- a/src/sampling/sampledSurface/sampledPatchInternalField/sampledPatchInternalField.C +++ b/src/sampling/sampledSurface/sampledPatchInternalField/sampledPatchInternalField.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-2013 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -204,6 +204,7 @@ Foam::tmp Foam::sampledPatchInternalField::interpolate return interpolateField(interpolator); } + Foam::tmp Foam::sampledPatchInternalField::interpolate ( diff --git a/src/sampling/sampledSurface/sampledPatchInternalField/sampledPatchInternalField.H b/src/sampling/sampledSurface/sampledPatchInternalField/sampledPatchInternalField.H index f2b3b7c4dc..05a7ea61a9 100644 --- a/src/sampling/sampledSurface/sampledPatchInternalField/sampledPatchInternalField.H +++ b/src/sampling/sampledSurface/sampledPatchInternalField/sampledPatchInternalField.H @@ -49,7 +49,7 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class sampledPatchInternalField Declaration + Class sampledPatchInternalField Declaration \*---------------------------------------------------------------------------*/ class sampledPatchInternalField @@ -74,6 +74,7 @@ class sampledPatchInternalField template tmp > interpolateField(const interpolation&) const; + public: //- Runtime type information @@ -97,67 +98,71 @@ public: // Member Functions - //- sample field on surface - virtual tmp sample - ( - const volScalarField& - ) const; + // Sample - //- sample field on surface - virtual tmp sample - ( - const volVectorField& - ) const; + //- Sample field on surface + virtual tmp sample + ( + const volScalarField& + ) const; - //- sample field on surface - virtual tmp sample - ( - const volSphericalTensorField& - ) const; + //- Sample field on surface + virtual tmp sample + ( + const volVectorField& + ) const; - //- sample field on surface - virtual tmp sample - ( - const volSymmTensorField& - ) const; + //- Sample field on surface + virtual tmp sample + ( + const volSphericalTensorField& + ) const; - //- sample field on surface - virtual tmp sample - ( - const volTensorField& - ) const; + //- Sample field on surface + virtual tmp sample + ( + const volSymmTensorField& + ) const; + + //- Sample field on surface + virtual tmp sample + ( + const volTensorField& + ) const; - //- interpolate field on surface - virtual tmp interpolate - ( - const interpolation& - ) const; + // Interpolate + //- Interpolate field on surface + virtual tmp interpolate + ( + const interpolation& + ) const; - //- interpolate field on surface - virtual tmp interpolate - ( - const interpolation& - ) const; + //- Interpolate field on surface + virtual tmp interpolate + ( + const interpolation& + ) const; - //- interpolate field on surface - virtual tmp interpolate - ( - const interpolation& - ) const; + //- Interpolate field on surface + virtual tmp interpolate + ( + const interpolation& + ) const; - //- interpolate field on surface - virtual tmp interpolate - ( - const interpolation& - ) const; + //- Interpolate field on surface + virtual tmp interpolate + ( + const interpolation& + ) const; + + //- Interpolate field on surface + virtual tmp interpolate + ( + const interpolation& + ) const; - //- interpolate field on surface - virtual tmp interpolate - ( - const interpolation& - ) const; //- Write virtual void print(Ostream&) const; diff --git a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfacesTemplates.C b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfacesTemplates.C index 35880afafa..8683e320dc 100644 --- a/src/sampling/sampledSurface/sampledSurfaces/sampledSurfacesTemplates.C +++ b/src/sampling/sampledSurface/sampledSurfaces/sampledSurfacesTemplates.C @@ -113,9 +113,9 @@ void Foam::sampledSurfaces::sampleAndWrite ) { // interpolator for this field - autoPtr< interpolation > interpolator; + autoPtr > interpolatorPtr; - const word& fieldName = vField.name(); + const word& fieldName = vField.name(); const fileName outputDir = outputPath_/vField.time().timeName(); forAll(*this, surfI) @@ -126,16 +126,16 @@ void Foam::sampledSurfaces::sampleAndWrite if (s.interpolate()) { - if (interpolator.empty()) + if (interpolatorPtr.empty()) { - interpolator = interpolation::New + interpolatorPtr = interpolation::New ( interpolationScheme_, vField ); } - values = s.interpolate(interpolator()); + values = s.interpolate(interpolatorPtr()); } else {