diff --git a/src/sampling/sampledSurface/distanceSurface/distanceSurface.C b/src/sampling/sampledSurface/distanceSurface/distanceSurface.C index 4a4c9219d690dcb106b3b409f6994f535d5d65f1..450384506a79664ba333bbc5f1450d4f95c40787 100644 --- a/src/sampling/sampledSurface/distanceSurface/distanceSurface.C +++ b/src/sampling/sampledSurface/distanceSurface/distanceSurface.C @@ -393,8 +393,7 @@ bool Foam::distanceSurface::update() } -Foam::tmp<Foam::scalarField> -Foam::distanceSurface::sample +Foam::tmp<Foam::scalarField> Foam::distanceSurface::sample ( const volScalarField& vField ) const @@ -403,8 +402,7 @@ Foam::distanceSurface::sample } -Foam::tmp<Foam::vectorField> -Foam::distanceSurface::sample +Foam::tmp<Foam::vectorField> Foam::distanceSurface::sample ( const volVectorField& vField ) const @@ -413,8 +411,7 @@ Foam::distanceSurface::sample } -Foam::tmp<Foam::sphericalTensorField> -Foam::distanceSurface::sample +Foam::tmp<Foam::sphericalTensorField> Foam::distanceSurface::sample ( const volSphericalTensorField& vField ) const @@ -423,8 +420,7 @@ Foam::distanceSurface::sample } -Foam::tmp<Foam::symmTensorField> -Foam::distanceSurface::sample +Foam::tmp<Foam::symmTensorField> Foam::distanceSurface::sample ( const volSymmTensorField& vField ) const @@ -433,8 +429,7 @@ Foam::distanceSurface::sample } -Foam::tmp<Foam::tensorField> -Foam::distanceSurface::sample +Foam::tmp<Foam::tensorField> Foam::distanceSurface::sample ( const volTensorField& vField ) const @@ -443,8 +438,7 @@ Foam::distanceSurface::sample } -Foam::tmp<Foam::scalarField> -Foam::distanceSurface::interpolate +Foam::tmp<Foam::scalarField> Foam::distanceSurface::interpolate ( const interpolation<scalar>& interpolator ) const @@ -453,8 +447,7 @@ Foam::distanceSurface::interpolate } -Foam::tmp<Foam::vectorField> -Foam::distanceSurface::interpolate +Foam::tmp<Foam::vectorField> Foam::distanceSurface::interpolate ( const interpolation<vector>& interpolator ) const @@ -462,8 +455,7 @@ Foam::distanceSurface::interpolate return interpolateField(interpolator); } -Foam::tmp<Foam::sphericalTensorField> -Foam::distanceSurface::interpolate +Foam::tmp<Foam::sphericalTensorField> Foam::distanceSurface::interpolate ( const interpolation<sphericalTensor>& interpolator ) const @@ -472,8 +464,7 @@ Foam::distanceSurface::interpolate } -Foam::tmp<Foam::symmTensorField> -Foam::distanceSurface::interpolate +Foam::tmp<Foam::symmTensorField> Foam::distanceSurface::interpolate ( const interpolation<symmTensor>& interpolator ) const @@ -482,8 +473,7 @@ Foam::distanceSurface::interpolate } -Foam::tmp<Foam::tensorField> -Foam::distanceSurface::interpolate +Foam::tmp<Foam::tensorField> Foam::distanceSurface::interpolate ( const interpolation<tensor>& interpolator ) const diff --git a/src/sampling/sampledSurface/sampledPatch/sampledPatch.C b/src/sampling/sampledSurface/sampledPatch/sampledPatch.C index 9ed86afef8a9f63d6d9c942a96b59662e0ba1524..52e00080130f414019b66bf3659bc4f7d5caa4c3 100644 --- a/src/sampling/sampledSurface/sampledPatch/sampledPatch.C +++ b/src/sampling/sampledSurface/sampledPatch/sampledPatch.C @@ -162,8 +162,7 @@ void Foam::sampledPatch::remapFaces -Foam::tmp<Foam::scalarField> -Foam::sampledPatch::sample +Foam::tmp<Foam::scalarField> Foam::sampledPatch::sample ( const volScalarField& vField ) const @@ -172,8 +171,7 @@ Foam::sampledPatch::sample } -Foam::tmp<Foam::vectorField> -Foam::sampledPatch::sample +Foam::tmp<Foam::vectorField> Foam::sampledPatch::sample ( const volVectorField& vField ) const @@ -181,8 +179,7 @@ Foam::sampledPatch::sample return sampleField(vField); } -Foam::tmp<Foam::sphericalTensorField> -Foam::sampledPatch::sample +Foam::tmp<Foam::sphericalTensorField> Foam::sampledPatch::sample ( const volSphericalTensorField& vField ) const @@ -191,8 +188,7 @@ Foam::sampledPatch::sample } -Foam::tmp<Foam::symmTensorField> -Foam::sampledPatch::sample +Foam::tmp<Foam::symmTensorField> Foam::sampledPatch::sample ( const volSymmTensorField& vField ) const @@ -201,8 +197,7 @@ Foam::sampledPatch::sample } -Foam::tmp<Foam::tensorField> -Foam::sampledPatch::sample +Foam::tmp<Foam::tensorField> Foam::sampledPatch::sample ( const volTensorField& vField ) const @@ -211,8 +206,7 @@ Foam::sampledPatch::sample } -Foam::tmp<Foam::scalarField> -Foam::sampledPatch::interpolate +Foam::tmp<Foam::scalarField> Foam::sampledPatch::interpolate ( const interpolation<scalar>& interpolator ) const @@ -221,8 +215,7 @@ Foam::sampledPatch::interpolate } -Foam::tmp<Foam::vectorField> -Foam::sampledPatch::interpolate +Foam::tmp<Foam::vectorField> Foam::sampledPatch::interpolate ( const interpolation<vector>& interpolator ) const @@ -230,8 +223,7 @@ Foam::sampledPatch::interpolate return interpolateField(interpolator); } -Foam::tmp<Foam::sphericalTensorField> -Foam::sampledPatch::interpolate +Foam::tmp<Foam::sphericalTensorField> Foam::sampledPatch::interpolate ( const interpolation<sphericalTensor>& interpolator ) const @@ -240,8 +232,7 @@ Foam::sampledPatch::interpolate } -Foam::tmp<Foam::symmTensorField> -Foam::sampledPatch::interpolate +Foam::tmp<Foam::symmTensorField> Foam::sampledPatch::interpolate ( const interpolation<symmTensor>& interpolator ) const @@ -250,8 +241,7 @@ Foam::sampledPatch::interpolate } -Foam::tmp<Foam::tensorField> -Foam::sampledPatch::interpolate +Foam::tmp<Foam::tensorField> Foam::sampledPatch::interpolate ( const interpolation<tensor>& interpolator ) const diff --git a/src/sampling/sampledSurface/sampledPlane/sampledPlane.C b/src/sampling/sampledSurface/sampledPlane/sampledPlane.C index 6c8e0f91a7a0ecd4cf90c08f830c20782cfea183..1147b8ec1ac18a13b04ee98a0c0d0fdb70aba77a 100644 --- a/src/sampling/sampledSurface/sampledPlane/sampledPlane.C +++ b/src/sampling/sampledSurface/sampledPlane/sampledPlane.C @@ -156,8 +156,7 @@ bool Foam::sampledPlane::update() } -Foam::tmp<Foam::scalarField> -Foam::sampledPlane::sample +Foam::tmp<Foam::scalarField> Foam::sampledPlane::sample ( const volScalarField& vField ) const @@ -166,8 +165,7 @@ Foam::sampledPlane::sample } -Foam::tmp<Foam::vectorField> -Foam::sampledPlane::sample +Foam::tmp<Foam::vectorField> Foam::sampledPlane::sample ( const volVectorField& vField ) const @@ -176,8 +174,7 @@ Foam::sampledPlane::sample } -Foam::tmp<Foam::sphericalTensorField> -Foam::sampledPlane::sample +Foam::tmp<Foam::sphericalTensorField> Foam::sampledPlane::sample ( const volSphericalTensorField& vField ) const @@ -186,8 +183,7 @@ Foam::sampledPlane::sample } -Foam::tmp<Foam::symmTensorField> -Foam::sampledPlane::sample +Foam::tmp<Foam::symmTensorField> Foam::sampledPlane::sample ( const volSymmTensorField& vField ) const @@ -196,8 +192,7 @@ Foam::sampledPlane::sample } -Foam::tmp<Foam::tensorField> -Foam::sampledPlane::sample +Foam::tmp<Foam::tensorField> Foam::sampledPlane::sample ( const volTensorField& vField ) const @@ -206,8 +201,7 @@ Foam::sampledPlane::sample } -Foam::tmp<Foam::scalarField> -Foam::sampledPlane::interpolate +Foam::tmp<Foam::scalarField> Foam::sampledPlane::interpolate ( const interpolation<scalar>& interpolator ) const @@ -216,8 +210,7 @@ Foam::sampledPlane::interpolate } -Foam::tmp<Foam::vectorField> -Foam::sampledPlane::interpolate +Foam::tmp<Foam::vectorField> Foam::sampledPlane::interpolate ( const interpolation<vector>& interpolator ) const @@ -225,8 +218,7 @@ Foam::sampledPlane::interpolate return interpolateField(interpolator); } -Foam::tmp<Foam::sphericalTensorField> -Foam::sampledPlane::interpolate +Foam::tmp<Foam::sphericalTensorField> Foam::sampledPlane::interpolate ( const interpolation<sphericalTensor>& interpolator ) const @@ -235,8 +227,7 @@ Foam::sampledPlane::interpolate } -Foam::tmp<Foam::symmTensorField> -Foam::sampledPlane::interpolate +Foam::tmp<Foam::symmTensorField> Foam::sampledPlane::interpolate ( const interpolation<symmTensor>& interpolator ) const @@ -245,8 +236,7 @@ Foam::sampledPlane::interpolate } -Foam::tmp<Foam::tensorField> -Foam::sampledPlane::interpolate +Foam::tmp<Foam::tensorField> Foam::sampledPlane::interpolate ( const interpolation<tensor>& interpolator ) const diff --git a/src/sampling/sampledSurface/sampledSurface/sampledSurface.C b/src/sampling/sampledSurface/sampledSurface/sampledSurface.C index ec4a413ad799e5f7a885b925d8281090d4a85588..5cb11429d2ddae130260ac6e7ed21eceda5ba159 100644 --- a/src/sampling/sampledSurface/sampledSurface/sampledSurface.C +++ b/src/sampling/sampledSurface/sampledSurface/sampledSurface.C @@ -191,6 +191,7 @@ Foam::sampledSurface::~sampledSurface() clearGeom(); } + // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // const Foam::vectorField& Foam::sampledSurface::Sf() const @@ -238,7 +239,6 @@ Foam::scalar Foam::sampledSurface::area() const } -// do not project scalar - just copy values Foam::tmp<Foam::Field<Foam::scalar> > Foam::sampledSurface::project(const Field<scalar>& field) const { @@ -295,6 +295,7 @@ void Foam::sampledSurface::print(Ostream& os) const os << type(); } + // * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * // Foam::Ostream& Foam::operator<<(Ostream &os, const sampledSurface& s) @@ -304,4 +305,5 @@ Foam::Ostream& Foam::operator<<(Ostream &os, const sampledSurface& s) return os; } + // ************************************************************************* // diff --git a/src/sampling/sampledSurface/sampledSurface/sampledSurface.H b/src/sampling/sampledSurface/sampledSurface/sampledSurface.H index c3967e298920761687d8688c58129fe3f6a0b658..e79fd0cfd7e5b01f84e3ad39f70938a7cdbc6aee 100644 --- a/src/sampling/sampledSurface/sampledSurface/sampledSurface.H +++ b/src/sampling/sampledSurface/sampledSurface/sampledSurface.H @@ -98,6 +98,7 @@ class sampledSurface //- Total surface area mutable scalar area_; + // Make geometric data //- Make Sf @@ -109,6 +110,7 @@ class sampledSurface //- Make Cf void makeCf() const; + // Service methods //- Check field size matches surface size @@ -135,33 +137,36 @@ class sampledSurface template<class ReturnType, class Type> tmp<Field<ReturnType> > project(const tmp<Field<Type> >&) const; + protected: // Protected Member functions virtual void clearGeom() const; + public: //- Runtime type information - TypeName("sampledSurface"); - + TypeName("sampledSurface"); - // Declare run-time constructor selection table - declareRunTimeSelectionTable + //- Declare run-time constructor selection table + declareRunTimeSelectionTable + ( + autoPtr, + sampledSurface, + word, ( - autoPtr, - sampledSurface, - word, - ( - const word& name, - const polyMesh& mesh, - const dictionary& dict - ), - (name, mesh, dict) - ); + const word& name, + const polyMesh& mesh, + const dictionary& dict + ), + (name, mesh, dict) + ); + + // iNew helper class //- Class used for the PtrLists read-construction class iNew @@ -260,7 +265,6 @@ public: // Do nothing (and return false) if no update was required virtual bool update() = 0; - //- Points of surface virtual const pointField& points() const = 0; @@ -394,9 +398,7 @@ public: //- Write virtual void print(Ostream&) const; - - // IOstream operators - + //- Ostream operator friend Ostream& operator<<(Ostream&, const sampledSurface&); }; diff --git a/src/sampling/sampledSurface/sampledSurface/sampledSurfaceTemplates.C b/src/sampling/sampledSurface/sampledSurface/sampledSurfaceTemplates.C index adc018a00e2873c0a8fef6c3d792665b42a51d9a..9d52bbe457248a13975db43594cb720bd74b0660 100644 --- a/src/sampling/sampledSurface/sampledSurface/sampledSurfaceTemplates.C +++ b/src/sampling/sampledSurface/sampledSurface/sampledSurfaceTemplates.C @@ -56,7 +56,7 @@ Type Foam::sampledSurface::integrate(const Field<Type>& field) const if (checkFieldSize(field)) { - value = sum(field * magSf()); + value = sum(field*magSf()); } reduce(value, sumOp<Type>()); @@ -80,7 +80,7 @@ Type Foam::sampledSurface::average(const Field<Type>& field) const if (checkFieldSize(field)) { - value = sum(field * magSf()); + value = sum(field*magSf()); } reduce(value, sumOp<Type>()); @@ -88,7 +88,7 @@ Type Foam::sampledSurface::average(const Field<Type>& field) const // avoid divide-by-zero if (area()) { - return value / area(); + return value/area(); } else { @@ -119,7 +119,7 @@ void Foam::sampledSurface::project forAll(norm, faceI) { - res[faceI] = field[faceI] & (norm[faceI] / mag(norm[faceI])); + res[faceI] = field[faceI] & (norm[faceI]/mag(norm[faceI])); } } else @@ -208,5 +208,4 @@ Foam::sampledSurface::pointAverage } - // ************************************************************************* // diff --git a/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C b/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C index b117a4b2916e8ce97efac2759b293093e53dc366..e846221ce8243b9c9adc3591aef918a2af8fcdf4 100644 --- a/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C +++ b/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C @@ -301,8 +301,7 @@ bool Foam::sampledTriSurfaceMesh::update() } -Foam::tmp<Foam::scalarField> -Foam::sampledTriSurfaceMesh::sample +Foam::tmp<Foam::scalarField> Foam::sampledTriSurfaceMesh::sample ( const volScalarField& vField ) const @@ -311,8 +310,7 @@ Foam::sampledTriSurfaceMesh::sample } -Foam::tmp<Foam::vectorField> -Foam::sampledTriSurfaceMesh::sample +Foam::tmp<Foam::vectorField> Foam::sampledTriSurfaceMesh::sample ( const volVectorField& vField ) const @@ -320,8 +318,7 @@ Foam::sampledTriSurfaceMesh::sample return sampleField(vField); } -Foam::tmp<Foam::sphericalTensorField> -Foam::sampledTriSurfaceMesh::sample +Foam::tmp<Foam::sphericalTensorField> Foam::sampledTriSurfaceMesh::sample ( const volSphericalTensorField& vField ) const @@ -330,8 +327,7 @@ Foam::sampledTriSurfaceMesh::sample } -Foam::tmp<Foam::symmTensorField> -Foam::sampledTriSurfaceMesh::sample +Foam::tmp<Foam::symmTensorField> Foam::sampledTriSurfaceMesh::sample ( const volSymmTensorField& vField ) const @@ -340,8 +336,7 @@ Foam::sampledTriSurfaceMesh::sample } -Foam::tmp<Foam::tensorField> -Foam::sampledTriSurfaceMesh::sample +Foam::tmp<Foam::tensorField> Foam::sampledTriSurfaceMesh::sample ( const volTensorField& vField ) const @@ -350,8 +345,7 @@ Foam::sampledTriSurfaceMesh::sample } -Foam::tmp<Foam::scalarField> -Foam::sampledTriSurfaceMesh::interpolate +Foam::tmp<Foam::scalarField> Foam::sampledTriSurfaceMesh::interpolate ( const interpolation<scalar>& interpolator ) const @@ -360,8 +354,7 @@ Foam::sampledTriSurfaceMesh::interpolate } -Foam::tmp<Foam::vectorField> -Foam::sampledTriSurfaceMesh::interpolate +Foam::tmp<Foam::vectorField> Foam::sampledTriSurfaceMesh::interpolate ( const interpolation<vector>& interpolator ) const @@ -369,8 +362,7 @@ Foam::sampledTriSurfaceMesh::interpolate return interpolateField(interpolator); } -Foam::tmp<Foam::sphericalTensorField> -Foam::sampledTriSurfaceMesh::interpolate +Foam::tmp<Foam::sphericalTensorField> Foam::sampledTriSurfaceMesh::interpolate ( const interpolation<sphericalTensor>& interpolator ) const @@ -379,8 +371,7 @@ Foam::sampledTriSurfaceMesh::interpolate } -Foam::tmp<Foam::symmTensorField> -Foam::sampledTriSurfaceMesh::interpolate +Foam::tmp<Foam::symmTensorField> Foam::sampledTriSurfaceMesh::interpolate ( const interpolation<symmTensor>& interpolator ) const @@ -389,8 +380,7 @@ Foam::sampledTriSurfaceMesh::interpolate } -Foam::tmp<Foam::tensorField> -Foam::sampledTriSurfaceMesh::interpolate +Foam::tmp<Foam::tensorField> Foam::sampledTriSurfaceMesh::interpolate ( const interpolation<tensor>& interpolator ) const diff --git a/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.C b/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.C index 3c2d6b1b1c91d8d7d3ea469d0bac96b788d44a5a..0d9e1312ab7fdd1cec1ccffd92b5130e2dd83c4a 100644 --- a/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.C +++ b/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.C @@ -215,8 +215,7 @@ bool Foam::sampledThresholdCellFaces::update() } -Foam::tmp<Foam::scalarField> -Foam::sampledThresholdCellFaces::sample +Foam::tmp<Foam::scalarField> Foam::sampledThresholdCellFaces::sample ( const volScalarField& vField ) const @@ -225,8 +224,7 @@ Foam::sampledThresholdCellFaces::sample } -Foam::tmp<Foam::vectorField> -Foam::sampledThresholdCellFaces::sample +Foam::tmp<Foam::vectorField> Foam::sampledThresholdCellFaces::sample ( const volVectorField& vField ) const @@ -235,8 +233,7 @@ Foam::sampledThresholdCellFaces::sample } -Foam::tmp<Foam::sphericalTensorField> -Foam::sampledThresholdCellFaces::sample +Foam::tmp<Foam::sphericalTensorField> Foam::sampledThresholdCellFaces::sample ( const volSphericalTensorField& vField ) const @@ -245,8 +242,7 @@ Foam::sampledThresholdCellFaces::sample } -Foam::tmp<Foam::symmTensorField> -Foam::sampledThresholdCellFaces::sample +Foam::tmp<Foam::symmTensorField> Foam::sampledThresholdCellFaces::sample ( const volSymmTensorField& vField ) const @@ -255,8 +251,7 @@ Foam::sampledThresholdCellFaces::sample } -Foam::tmp<Foam::tensorField> -Foam::sampledThresholdCellFaces::sample +Foam::tmp<Foam::tensorField> Foam::sampledThresholdCellFaces::sample ( const volTensorField& vField ) const @@ -265,8 +260,7 @@ Foam::sampledThresholdCellFaces::sample } -Foam::tmp<Foam::scalarField> -Foam::sampledThresholdCellFaces::interpolate +Foam::tmp<Foam::scalarField> Foam::sampledThresholdCellFaces::interpolate ( const interpolation<scalar>& interpolator ) const @@ -275,8 +269,7 @@ Foam::sampledThresholdCellFaces::interpolate } -Foam::tmp<Foam::vectorField> -Foam::sampledThresholdCellFaces::interpolate +Foam::tmp<Foam::vectorField> Foam::sampledThresholdCellFaces::interpolate ( const interpolation<vector>& interpolator ) const @@ -294,8 +287,7 @@ Foam::sampledThresholdCellFaces::interpolate } -Foam::tmp<Foam::symmTensorField> -Foam::sampledThresholdCellFaces::interpolate +Foam::tmp<Foam::symmTensorField> Foam::sampledThresholdCellFaces::interpolate ( const interpolation<symmTensor>& interpolator ) const @@ -304,8 +296,7 @@ Foam::sampledThresholdCellFaces::interpolate } -Foam::tmp<Foam::tensorField> -Foam::sampledThresholdCellFaces::interpolate +Foam::tmp<Foam::tensorField> Foam::sampledThresholdCellFaces::interpolate ( const interpolation<tensor>& interpolator ) const diff --git a/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.H b/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.H index 47204a856de1b81d368e7b11a02c465d58f36eab..89317f09cd45600d3d63120d913adc1432a99c22 100644 --- a/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.H +++ b/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.H @@ -136,7 +136,6 @@ public: // Do nothing (and return false) if no update was needed virtual bool update(); - //- Points of surface virtual const pointField& points() const { @@ -150,16 +149,10 @@ public: } //- sample field on surface - virtual tmp<scalarField> sample - ( - const volScalarField& - ) const; + virtual tmp<scalarField> sample(const volScalarField&) const; //- sample field on surface - virtual tmp<vectorField> sample - ( - const volVectorField& - ) const; + virtual tmp<vectorField> sample( const volVectorField&) const; //- sample field on surface virtual tmp<sphericalTensorField> sample @@ -168,10 +161,7 @@ public: ) const; //- sample field on surface - virtual tmp<symmTensorField> sample - ( - const volSymmTensorField& - ) const; + virtual tmp<symmTensorField> sample(const volSymmTensorField&) const; //- sample field on surface virtual tmp<tensorField> sample @@ -179,7 +169,6 @@ public: const volTensorField& ) const; - //- interpolate field on surface virtual tmp<scalarField> interpolate (