From 1dbed003456e682cb9fed14a19c5511c75a04635 Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Thu, 11 Jan 2018 09:13:08 +0000 Subject: [PATCH 01/23] ENH: ParticleFunctionObjects: Added PatchCollisionDensity object This function object will write a paraview-viewable field showing the area-density of parcel collisions on every patch face. It also outputs the rate of collisions hitting each patch face, calculated over an interval equal to the time elapsed since the last output. It has an optional entry to specify a minimum incident speed below which a collision is not counted. It can be enabled in the cloud properties file as follows: cloudFunctions { patchCollisionDensity1 { type patchCollisionDensity; minSpeed 1e-3; // (optional) } } This work was supported by Anton Kidess, at Hilti --- .../include/makeParcelCloudFunctionObjects.H | 4 +- .../PatchCollisionDensity.C | 168 ++++++++++++++++++ .../PatchCollisionDensity.H | 152 ++++++++++++++++ 3 files changed, 323 insertions(+), 1 deletion(-) create mode 100644 src/lagrangian/intermediate/submodels/CloudFunctionObjects/PatchCollisionDensity/PatchCollisionDensity.C create mode 100644 src/lagrangian/intermediate/submodels/CloudFunctionObjects/PatchCollisionDensity/PatchCollisionDensity.H diff --git a/src/lagrangian/intermediate/parcels/include/makeParcelCloudFunctionObjects.H b/src/lagrangian/intermediate/parcels/include/makeParcelCloudFunctionObjects.H index e56970999c..69618baabf 100644 --- a/src/lagrangian/intermediate/parcels/include/makeParcelCloudFunctionObjects.H +++ b/src/lagrangian/intermediate/parcels/include/makeParcelCloudFunctionObjects.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -34,6 +34,7 @@ License #include "ParticleErosion.H" #include "ParticleTracks.H" #include "ParticleTrap.H" +#include "PatchCollisionDensity.H" #include "PatchPostProcessing.H" #include "VoidFraction.H" @@ -48,6 +49,7 @@ License makeCloudFunctionObjectType(ParticleErosion, CloudType); \ makeCloudFunctionObjectType(ParticleTracks, CloudType); \ makeCloudFunctionObjectType(ParticleTrap, CloudType); \ + makeCloudFunctionObjectType(PatchCollisionDensity, CloudType); \ makeCloudFunctionObjectType(PatchPostProcessing, CloudType); \ makeCloudFunctionObjectType(VoidFraction, CloudType); diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/PatchCollisionDensity/PatchCollisionDensity.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/PatchCollisionDensity/PatchCollisionDensity.C new file mode 100644 index 0000000000..111ffcbedf --- /dev/null +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/PatchCollisionDensity/PatchCollisionDensity.C @@ -0,0 +1,168 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2018 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "PatchCollisionDensity.H" +#include "Pstream.H" +#include "stringListOps.H" +#include "ListOps.H" +#include "ListListOps.H" + +// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // + +template +void Foam::PatchCollisionDensity::write() +{ + const scalarField z(this->owner().mesh().nCells(), 0); + + volScalarField + ( + IOobject + ( + this->owner().name() + ":collisionDensity", + this->owner().mesh().time().timeName(), + this->owner().mesh() + ), + this->owner().mesh(), + dimless/dimArea, + z, + collisionDensity_ + ) + .write(); + + volScalarField + ( + IOobject + ( + this->owner().name() + ":collisionDensityRate", + this->owner().mesh().time().timeName(), + this->owner().mesh() + ), + this->owner().mesh(), + dimless/dimArea/dimTime, + z, + (collisionDensity_ - collisionDensity0_) + /(this->owner().mesh().time().value() - time0_) + ) + .write(); + + collisionDensity0_ == collisionDensity_; + time0_ = this->owner().mesh().time().value(); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::PatchCollisionDensity::PatchCollisionDensity +( + const dictionary& dict, + CloudType& owner, + const word& modelName +) +: + CloudFunctionObject(dict, owner, modelName, typeName), + minSpeed_(dict.lookupOrDefault("minSpeed", -1)), + collisionDensity_ + ( + this->owner().mesh().boundary(), + volScalarField::Internal::null(), + calculatedFvPatchField::typeName + ), + collisionDensity0_ + ( + this->owner().mesh().boundary(), + volScalarField::Internal::null(), + calculatedFvPatchField::typeName + ), + time0_(this->owner().mesh().time().value()) +{ + collisionDensity_ == 0; + collisionDensity0_ == 0; + + IOobject io + ( + this->owner().name() + ":collisionDensity", + this->owner().mesh().time().timeName(), + this->owner().mesh(), + IOobject::MUST_READ, + IOobject::NO_WRITE + ); + + if (io.typeHeaderOk()) + { + const volScalarField collisionDensity(io, this->owner().mesh()); + collisionDensity_ == collisionDensity.boundaryField(); + collisionDensity0_ == collisionDensity.boundaryField(); + } +} + + +template +Foam::PatchCollisionDensity::PatchCollisionDensity +( + const PatchCollisionDensity& ppm +) +: + CloudFunctionObject(ppm), + minSpeed_(ppm.minSpeed_), + collisionDensity_(ppm.collisionDensity_), + collisionDensity0_(ppm.collisionDensity0_), + time0_(ppm.time0_) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::PatchCollisionDensity::~PatchCollisionDensity() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +void Foam::PatchCollisionDensity::postPatch +( + const parcelType& p, + const polyPatch& pp, + bool& +) +{ + const label patchi = pp.index(); + const label patchFacei = p.face() - pp.start(); + + vector nw, Up; + this->owner().patchData(p, pp, nw, Up); + + const scalar speed = (p.U() - Up) & nw; + if (speed > minSpeed_) + { + collisionDensity_[patchi][patchFacei] += + 1/this->owner().mesh().magSf().boundaryField()[patchi][patchFacei]; + } +} + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/PatchCollisionDensity/PatchCollisionDensity.H b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/PatchCollisionDensity/PatchCollisionDensity.H new file mode 100644 index 0000000000..8cb4d76bb4 --- /dev/null +++ b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/PatchCollisionDensity/PatchCollisionDensity.H @@ -0,0 +1,152 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2018 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::PatchCollisionDensity + +Description + Function object which generates fields of the number and rate of collisions + per unit area on all patches. Can optionally take a minimum speed below + which a collision is not counted. + + Example usage: + \verbatim + patchCollisionDensity1 + { + type patchCollisionDensity; + minSpeed 1e-3; + } + \endverbatim + +SourceFiles + PatchCollisionDensity.C + +\*---------------------------------------------------------------------------*/ + +#ifndef PatchCollisionDensity_H +#define PatchCollisionDensity_H + +#include "CloudFunctionObject.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class PatchCollisionDensity Declaration +\*---------------------------------------------------------------------------*/ + +template +class PatchCollisionDensity +: + public CloudFunctionObject +{ + // Private data + + typedef typename CloudType::particleType parcelType; + + //- The threshold for a collision + const scalar minSpeed_; + + //- The field of the number of collisions per unit area + volScalarField::Boundary collisionDensity_; + + //- The field of the number of collisions per unit area at the last + // output + volScalarField::Boundary collisionDensity0_; + + //- The time at the last output + scalar time0_; + + +protected: + + // Protected Member Functions + + //- Write post-processing info + void write(); + + +public: + + //- Runtime type information + TypeName("patchCollisionDensity"); + + + // Constructors + + //- Construct from dictionary + PatchCollisionDensity + ( + const dictionary& dict, + CloudType& owner, + const word& modelName + ); + + //- Construct copy + PatchCollisionDensity(const PatchCollisionDensity& ppm); + + //- Construct and return a clone + virtual autoPtr> clone() const + { + return autoPtr> + ( + new PatchCollisionDensity(*this) + ); + } + + + //- Destructor + virtual ~PatchCollisionDensity(); + + + // Member Functions + + // Evaluation + + //- Post-patch hook + virtual void postPatch + ( + const parcelType& p, + const polyPatch& pp, + bool& keepParticle + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "PatchCollisionDensity.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // From e2c6985ea51298556927d90e11dc90bd75c9dcc1 Mon Sep 17 00:00:00 2001 From: Andrew Heather Date: Thu, 17 May 2018 11:08:00 +0100 Subject: [PATCH 02/23] ENH: turbulenceFields FO - added turbulence intensity to list of available fields --- .../field/turbulenceFields/turbulenceFields.C | 14 ++++- .../field/turbulenceFields/turbulenceFields.H | 11 +++- .../turbulenceFieldsTemplates.C | 51 ++++++++++++------- 3 files changed, 54 insertions(+), 22 deletions(-) diff --git a/src/functionObjects/field/turbulenceFields/turbulenceFields.C b/src/functionObjects/field/turbulenceFields/turbulenceFields.C index 054ad322cb..0fc33a74e7 100644 --- a/src/functionObjects/field/turbulenceFields/turbulenceFields.C +++ b/src/functionObjects/field/turbulenceFields/turbulenceFields.C @@ -61,7 +61,8 @@ Foam::functionObjects::turbulenceFields::compressibleFieldNames_ { compressibleField::cfAlphaEff, "alphaEff" }, { compressibleField::cfR, "R" }, { compressibleField::cfDevRhoReff, "devRhoReff" }, - { compressibleField::cfL, "L" } + { compressibleField::cfL, "L" }, + { compressibleField::cfI, "I" } }; @@ -80,6 +81,7 @@ Foam::functionObjects::turbulenceFields::incompressibleFieldNames_ { incompressibleField::ifR, "R" }, { incompressibleField::ifDevReff, "devReff" }, { incompressibleField::ifL, "L" }, + { incompressibleField::ifI, "I" } }; @@ -236,6 +238,11 @@ bool Foam::functionObjects::turbulenceFields::execute() processField(f, L(model)); break; } + case cfI: + { + processField(f, I(model)); + break; + } default: { FatalErrorInFunction @@ -298,6 +305,11 @@ bool Foam::functionObjects::turbulenceFields::execute() processField(f, L(model)); break; } + case ifI: + { + processField(f, I(model)); + break; + } default: { FatalErrorInFunction diff --git a/src/functionObjects/field/turbulenceFields/turbulenceFields.H b/src/functionObjects/field/turbulenceFields/turbulenceFields.H index a4ae31d199..881a772f3b 100644 --- a/src/functionObjects/field/turbulenceFields/turbulenceFields.H +++ b/src/functionObjects/field/turbulenceFields/turbulenceFields.H @@ -76,6 +76,7 @@ Usage devReff | Deviatoric part of the effective Reynolds stress devRhoReff | Divergence of the Reynolds stress L | turbulence length scale + I | turbulence intensity \endplaintable See also @@ -125,7 +126,8 @@ public: cfAlphaEff, cfR, cfDevRhoReff, - cfL + cfL, + cfI }; static const Enum compressibleFieldNames_; @@ -139,7 +141,8 @@ public: ifNuEff, ifR, ifDevReff, - ifL + ifL, + ifI }; static const Enum incompressibleFieldNames_; @@ -179,6 +182,10 @@ protected: template tmp L(const Model& model) const; + //- Return I calculated from k and U + template + tmp I(const Model& model) const; + private: diff --git a/src/functionObjects/field/turbulenceFields/turbulenceFieldsTemplates.C b/src/functionObjects/field/turbulenceFields/turbulenceFieldsTemplates.C index ec6b70d92d..4ded70c6be 100644 --- a/src/functionObjects/field/turbulenceFields/turbulenceFieldsTemplates.C +++ b/src/functionObjects/field/turbulenceFields/turbulenceFieldsTemplates.C @@ -85,19 +85,16 @@ Foam::functionObjects::turbulenceFields::omega const volScalarField k(model.k()); const volScalarField epsilon(model.epsilon()); - return tmp + return tmp::New ( - new volScalarField + IOobject ( - IOobject - ( - "omega.tmp", - k.mesh().time().timeName(), - k.mesh() - ), - epsilon/(Cmu*k), - epsilon.boundaryField().types() - ) + "omega.tmp", + k.mesh().time().timeName(), + k.mesh() + ), + epsilon/(Cmu*k), + epsilon.boundaryField().types() ); } @@ -109,9 +106,10 @@ Foam::functionObjects::turbulenceFields::nuTilda const Model& model ) const { - return tmp + return tmp::New ( - new volScalarField("nuTilda.tmp", model.k()/omega(model)) + "nuTilda.tmp", + model.k()/omega(model) ); } @@ -130,15 +128,30 @@ Foam::functionObjects::turbulenceFields::L const volScalarField epsilon(model.epsilon()); const dimensionedScalar eps0("eps0", epsilon.dimensions(), SMALL); - return tmp + return tmp::New ( - new volScalarField - ( - "L.tmp", - pow(Cmu, 0.75)*pow(k, 1.5)/(epsilon + eps0) - ) + "L.tmp", + pow(Cmu, 0.75)*pow(k, 1.5)/(epsilon + eps0) ); } +template +Foam::tmp +Foam::functionObjects::turbulenceFields::I +( + const Model& model +) const +{ + // Assume k is available + const volScalarField uPrime(sqrt((2.0/3.0)*model.k())); + const dimensionedScalar U0("U0", dimVelocity, SMALL); + + return tmp::New + ( + "I.tmp", + uPrime/max(max(uPrime, mag(model.U())), U0) + ); +} + // ************************************************************************* // From dde93671ee577b5e085886e054293da713e90265 Mon Sep 17 00:00:00 2001 From: Andrew Heather Date: Thu, 17 May 2018 11:51:31 +0100 Subject: [PATCH 03/23] ENH: forces FO - updated reading of nu --- src/functionObjects/forces/forces/forces.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/functionObjects/forces/forces/forces.C b/src/functionObjects/forces/forces/forces.C index f1a945b302..84015def87 100644 --- a/src/functionObjects/forces/forces/forces.C +++ b/src/functionObjects/forces/forces/forces.C @@ -353,7 +353,7 @@ Foam::functionObjects::forces::devRhoReff() const const dictionary& transportProperties = lookupObject("transportProperties"); - dimensionedScalar nu(transportProperties.lookup("nu")); + dimensionedScalar nu("nu", dimViscosity, transportProperties); const volVectorField& U = lookupObject(UName_); From 0c5a87ceba87ad8c265de2206510b944ec952540 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Mon, 27 Nov 2017 11:37:03 +0000 Subject: [PATCH 04/23] ENH: cylinderToFace, cylinderAnnulusToFace: New face sources Face equivalents of cylinderToCell and cylinderAnnulusToCell. Tested-by: Henry Weller --- src/meshTools/Make/files | 2 + .../sets/cellSources/boxToCell/boxToCell.C | 17 +- .../sets/cellSources/boxToCell/boxToCell.H | 5 +- .../sets/cellSources/cellToCell/cellToCell.C | 16 +- .../cylinderAnnulusToCell.C | 3 +- .../cylinderToCell/cylinderToCell.C | 3 +- .../sets/cellSources/faceToCell/faceToCell.C | 6 +- .../faceZoneToCell/faceZoneToCell.C | 4 - .../cellSources/fieldToCell/fieldToCell.C | 31 ---- .../cellSources/labelToCell/labelToCell.C | 16 +- .../sets/cellSources/nbrToCell/nbrToCell.C | 16 +- .../cellSources/nearestToCell/nearestToCell.C | 13 +- .../cellSources/pointToCell/pointToCell.C | 6 +- .../cellSources/regionToCell/regionToCell.C | 13 +- .../rotatedBoxToCell/rotatedBoxToCell.C | 16 +- .../cellSources/shapeToCell/shapeToCell.C | 13 +- .../cellSources/sphereToCell/sphereToCell.C | 3 +- .../targetVolumeToCell/targetVolumeToCell.C | 16 +- .../sets/cellSources/zoneToCell/zoneToCell.C | 16 +- .../setToCellZone/setToCellZone.C | 16 +- .../boundaryToFace/boundaryToFace.C | 16 +- .../sets/faceSources/boxToFace/boxToFace.C | 16 +- .../sets/faceSources/boxToFace/boxToFace.H | 4 +- .../sets/faceSources/cellToFace/cellToFace.C | 2 +- .../cylinderAnnulusToFace.C | 160 ++++++++++++++++++ .../cylinderAnnulusToFace.H | 137 +++++++++++++++ .../cylinderToFace/cylinderToFace.C | 149 ++++++++++++++++ .../cylinderToFace/cylinderToFace.H | 133 +++++++++++++++ .../sets/faceSources/faceToFace/faceToFace.C | 16 +- .../faceSources/labelToFace/labelToFace.C | 16 +- .../faceSources/normalToFace/normalToFace.C | 16 +- .../faceSources/patchToFace/patchToFace.C | 14 +- .../faceSources/pointToFace/pointToFace.C | 6 +- .../faceSources/regionToFace/regionToFace.C | 15 +- .../sets/faceSources/zoneToFace/zoneToFace.C | 16 +- .../faceZoneToFaceZone/faceZoneToFaceZone.C | 16 +- .../searchableSurfaceToFaceZone.C | 3 +- .../setToFaceZone/setToFaceZone.C | 16 +- .../setsToFaceZone/setsToFaceZone.C | 5 +- .../sets/pointSources/boxToPoint/boxToPoint.C | 16 +- .../pointSources/cellToPoint/cellToPoint.C | 6 +- .../pointSources/faceToPoint/faceToPoint.C | 6 +- .../pointSources/labelToPoint/labelToPoint.C | 16 +- .../nearestToPoint/nearestToPoint.C | 13 +- .../pointSources/pointToPoint/pointToPoint.C | 16 +- .../pointSources/zoneToPoint/zoneToPoint.C | 15 +- .../setToPointZone/setToPointZone.C | 16 +- 47 files changed, 699 insertions(+), 392 deletions(-) create mode 100644 src/meshTools/sets/faceSources/cylinderAnnulusToFace/cylinderAnnulusToFace.C create mode 100644 src/meshTools/sets/faceSources/cylinderAnnulusToFace/cylinderAnnulusToFace.H create mode 100644 src/meshTools/sets/faceSources/cylinderToFace/cylinderToFace.C create mode 100644 src/meshTools/sets/faceSources/cylinderToFace/cylinderToFace.H diff --git a/src/meshTools/Make/files b/src/meshTools/Make/files index d9a73c1254..45f839d1a0 100644 --- a/src/meshTools/Make/files +++ b/src/meshTools/Make/files @@ -170,6 +170,8 @@ $(faceSources)/boundaryToFace/boundaryToFace.C $(faceSources)/zoneToFace/zoneToFace.C $(faceSources)/boxToFace/boxToFace.C $(faceSources)/regionToFace/regionToFace.C +$(faceSources)/cylinderToFace/cylinderToFace.C +$(faceSources)/cylinderAnnulusToFace/cylinderAnnulusToFace.C pointSources = sets/pointSources $(pointSources)/labelToPoint/labelToPoint.C diff --git a/src/meshTools/sets/cellSources/boxToCell/boxToCell.C b/src/meshTools/sets/cellSources/boxToCell/boxToCell.C index bd01674c0a..60a7b7436b 100644 --- a/src/meshTools/sets/cellSources/boxToCell/boxToCell.C +++ b/src/meshTools/sets/cellSources/boxToCell/boxToCell.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,20 +25,15 @@ License #include "boxToCell.H" #include "polyMesh.H" - #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -defineTypeNameAndDebug(boxToCell, 0); - -addToRunTimeSelectionTable(topoSetSource, boxToCell, word); - -addToRunTimeSelectionTable(topoSetSource, boxToCell, istream); - + defineTypeNameAndDebug(boxToCell, 0); + addToRunTimeSelectionTable(topoSetSource, boxToCell, word); + addToRunTimeSelectionTable(topoSetSource, boxToCell, istream); } @@ -72,7 +67,6 @@ void Foam::boxToCell::combine(topoSet& set, const bool add) const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::boxToCell::boxToCell ( const polyMesh& mesh, @@ -84,7 +78,6 @@ Foam::boxToCell::boxToCell {} -// Construct from dictionary Foam::boxToCell::boxToCell ( const polyMesh& mesh, @@ -101,7 +94,6 @@ Foam::boxToCell::boxToCell {} -// Construct from Istream Foam::boxToCell::boxToCell ( const polyMesh& mesh, @@ -112,6 +104,7 @@ Foam::boxToCell::boxToCell bbs_(1, treeBoundBox(checkIs(is))) {} + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::boxToCell::~boxToCell() diff --git a/src/meshTools/sets/cellSources/boxToCell/boxToCell.H b/src/meshTools/sets/cellSources/boxToCell/boxToCell.H index 1f100c77f9..24a8b48273 100644 --- a/src/meshTools/sets/cellSources/boxToCell/boxToCell.H +++ b/src/meshTools/sets/cellSources/boxToCell/boxToCell.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -51,13 +51,11 @@ class boxToCell : public topoSetSource { - // Private data //- Add usage string static addToUsageTable usage_; - //- Bounding box. treeBoundBoxList bbs_; @@ -112,7 +110,6 @@ public: const topoSetSource::setAction action, topoSet& ) const; - }; diff --git a/src/meshTools/sets/cellSources/cellToCell/cellToCell.C b/src/meshTools/sets/cellSources/cellToCell/cellToCell.C index f7394cf43c..4644f755af 100644 --- a/src/meshTools/sets/cellSources/cellToCell/cellToCell.C +++ b/src/meshTools/sets/cellSources/cellToCell/cellToCell.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-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,20 +26,15 @@ License #include "cellToCell.H" #include "polyMesh.H" #include "cellSet.H" - #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -defineTypeNameAndDebug(cellToCell, 0); - -addToRunTimeSelectionTable(topoSetSource, cellToCell, word); - -addToRunTimeSelectionTable(topoSetSource, cellToCell, istream); - + defineTypeNameAndDebug(cellToCell, 0); + addToRunTimeSelectionTable(topoSetSource, cellToCell, word); + addToRunTimeSelectionTable(topoSetSource, cellToCell, istream); } @@ -53,7 +48,6 @@ Foam::topoSetSource::addToUsageTable Foam::cellToCell::usage_ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::cellToCell::cellToCell ( const polyMesh& mesh, @@ -65,7 +59,6 @@ Foam::cellToCell::cellToCell {} -// Construct from dictionary Foam::cellToCell::cellToCell ( const polyMesh& mesh, @@ -77,7 +70,6 @@ Foam::cellToCell::cellToCell {} -// Construct from Istream Foam::cellToCell::cellToCell ( const polyMesh& mesh, diff --git a/src/meshTools/sets/cellSources/cylinderAnnulusToCell/cylinderAnnulusToCell.C b/src/meshTools/sets/cellSources/cylinderAnnulusToCell/cylinderAnnulusToCell.C index 06d89f6e3e..a566caf656 100644 --- a/src/meshTools/sets/cellSources/cylinderAnnulusToCell/cylinderAnnulusToCell.C +++ b/src/meshTools/sets/cellSources/cylinderAnnulusToCell/cylinderAnnulusToCell.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -107,7 +107,6 @@ Foam::cylinderAnnulusToCell::cylinderAnnulusToCell {} -// Construct from Istream Foam::cylinderAnnulusToCell::cylinderAnnulusToCell ( const polyMesh& mesh, diff --git a/src/meshTools/sets/cellSources/cylinderToCell/cylinderToCell.C b/src/meshTools/sets/cellSources/cylinderToCell/cylinderToCell.C index 787c73da69..6094b9c02f 100644 --- a/src/meshTools/sets/cellSources/cylinderToCell/cylinderToCell.C +++ b/src/meshTools/sets/cellSources/cylinderToCell/cylinderToCell.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -102,7 +102,6 @@ Foam::cylinderToCell::cylinderToCell {} -// Construct from Istream Foam::cylinderToCell::cylinderToCell ( const polyMesh& mesh, diff --git a/src/meshTools/sets/cellSources/faceToCell/faceToCell.C b/src/meshTools/sets/cellSources/faceToCell/faceToCell.C index 5a9b3a3f63..5847c624dd 100644 --- a/src/meshTools/sets/cellSources/faceToCell/faceToCell.C +++ b/src/meshTools/sets/cellSources/faceToCell/faceToCell.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,7 +26,6 @@ License #include "faceToCell.H" #include "polyMesh.H" #include "faceSet.H" - #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -148,7 +147,6 @@ void Foam::faceToCell::combine(topoSet& set, const bool add) const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::faceToCell::faceToCell ( const polyMesh& mesh, @@ -162,7 +160,6 @@ Foam::faceToCell::faceToCell {} -// Construct from dictionary Foam::faceToCell::faceToCell ( const polyMesh& mesh, @@ -175,7 +172,6 @@ Foam::faceToCell::faceToCell {} -// Construct from Istream Foam::faceToCell::faceToCell ( const polyMesh& mesh, diff --git a/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C b/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C index 7640e05192..96ddde1489 100644 --- a/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C +++ b/src/meshTools/sets/cellSources/faceZoneToCell/faceZoneToCell.C @@ -25,7 +25,6 @@ License #include "faceZoneToCell.H" #include "polyMesh.H" - #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -105,7 +104,6 @@ void Foam::faceZoneToCell::combine(topoSet& set, const bool add) const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::faceZoneToCell::faceZoneToCell ( const polyMesh& mesh, @@ -119,7 +117,6 @@ Foam::faceZoneToCell::faceZoneToCell {} -// Construct from dictionary Foam::faceZoneToCell::faceZoneToCell ( const polyMesh& mesh, @@ -132,7 +129,6 @@ Foam::faceZoneToCell::faceZoneToCell {} -// Construct from Istream Foam::faceZoneToCell::faceZoneToCell ( const polyMesh& mesh, diff --git a/src/meshTools/sets/cellSources/fieldToCell/fieldToCell.C b/src/meshTools/sets/cellSources/fieldToCell/fieldToCell.C index 08ce936c46..c3914d5bb9 100644 --- a/src/meshTools/sets/cellSources/fieldToCell/fieldToCell.C +++ b/src/meshTools/sets/cellSources/fieldToCell/fieldToCell.C @@ -93,7 +93,6 @@ void Foam::fieldToCell::applyToSet // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::fieldToCell::fieldToCell ( const polyMesh& mesh, @@ -109,7 +108,6 @@ Foam::fieldToCell::fieldToCell {} -// Construct from dictionary Foam::fieldToCell::fieldToCell ( const polyMesh& mesh, @@ -123,7 +121,6 @@ Foam::fieldToCell::fieldToCell {} -// Construct from Istream Foam::fieldToCell::fieldToCell ( const polyMesh& mesh, @@ -151,34 +148,6 @@ void Foam::fieldToCell::applyToSet topoSet& set ) const { - -// // Construct temporary fvMesh from polyMesh -// fvMesh fMesh -// ( -// mesh(), // IOobject -// mesh().points(), -// mesh().faces(), -// mesh().cells() -// ); -// -// const polyBoundaryMesh& patches = mesh().boundaryMesh(); -// -// List newPatches(patches.size()); -// forAll(patches, patchi) -// { -// const polyPatch& pp = patches[patchi]; -// -// newPatches[patchi] = -// patches[patchi].clone -// ( -// fMesh.boundaryMesh(), -// patchi, -// pp.size(), -// pp.start() -// ).ptr(); -// } -// fMesh.addFvPatches(newPatches); - // Try to load field IOobject fieldObject ( diff --git a/src/meshTools/sets/cellSources/labelToCell/labelToCell.C b/src/meshTools/sets/cellSources/labelToCell/labelToCell.C index f7b350046c..2f71548cde 100644 --- a/src/meshTools/sets/cellSources/labelToCell/labelToCell.C +++ b/src/meshTools/sets/cellSources/labelToCell/labelToCell.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-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,20 +25,15 @@ License #include "labelToCell.H" #include "polyMesh.H" - #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -defineTypeNameAndDebug(labelToCell, 0); - -addToRunTimeSelectionTable(topoSetSource, labelToCell, word); - -addToRunTimeSelectionTable(topoSetSource, labelToCell, istream); - + defineTypeNameAndDebug(labelToCell, 0); + addToRunTimeSelectionTable(topoSetSource, labelToCell, word); + addToRunTimeSelectionTable(topoSetSource, labelToCell, istream); } @@ -63,7 +58,6 @@ void Foam::labelToCell::combine(topoSet& set, const bool add) const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::labelToCell::labelToCell ( const polyMesh& mesh, @@ -75,7 +69,6 @@ Foam::labelToCell::labelToCell {} -// Construct from dictionary Foam::labelToCell::labelToCell ( const polyMesh& mesh, @@ -87,7 +80,6 @@ Foam::labelToCell::labelToCell {} -// Construct from Istream Foam::labelToCell::labelToCell ( const polyMesh& mesh, diff --git a/src/meshTools/sets/cellSources/nbrToCell/nbrToCell.C b/src/meshTools/sets/cellSources/nbrToCell/nbrToCell.C index cb52cb01db..85f5f494b3 100644 --- a/src/meshTools/sets/cellSources/nbrToCell/nbrToCell.C +++ b/src/meshTools/sets/cellSources/nbrToCell/nbrToCell.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,20 +25,15 @@ License #include "nbrToCell.H" #include "polyMesh.H" - #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -defineTypeNameAndDebug(nbrToCell, 0); - -addToRunTimeSelectionTable(topoSetSource, nbrToCell, word); - -addToRunTimeSelectionTable(topoSetSource, nbrToCell, istream); - + defineTypeNameAndDebug(nbrToCell, 0); + addToRunTimeSelectionTable(topoSetSource, nbrToCell, word); + addToRunTimeSelectionTable(topoSetSource, nbrToCell, istream); } @@ -104,7 +99,6 @@ void Foam::nbrToCell::combine(topoSet& set, const bool add) const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::nbrToCell::nbrToCell ( const polyMesh& mesh, @@ -116,7 +110,6 @@ Foam::nbrToCell::nbrToCell {} -// Construct from dictionary Foam::nbrToCell::nbrToCell ( const polyMesh& mesh, @@ -128,7 +121,6 @@ Foam::nbrToCell::nbrToCell {} -// Construct from Istream Foam::nbrToCell::nbrToCell ( const polyMesh& mesh, diff --git a/src/meshTools/sets/cellSources/nearestToCell/nearestToCell.C b/src/meshTools/sets/cellSources/nearestToCell/nearestToCell.C index cb10f3a049..d7e2e11f8f 100644 --- a/src/meshTools/sets/cellSources/nearestToCell/nearestToCell.C +++ b/src/meshTools/sets/cellSources/nearestToCell/nearestToCell.C @@ -32,13 +32,9 @@ License namespace Foam { - -defineTypeNameAndDebug(nearestToCell, 0); - -addToRunTimeSelectionTable(topoSetSource, nearestToCell, word); - -addToRunTimeSelectionTable(topoSetSource, nearestToCell, istream); - + defineTypeNameAndDebug(nearestToCell, 0); + addToRunTimeSelectionTable(topoSetSource, nearestToCell, word); + addToRunTimeSelectionTable(topoSetSource, nearestToCell, istream); } @@ -84,7 +80,6 @@ void Foam::nearestToCell::combine(topoSet& set, const bool add) const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::nearestToCell::nearestToCell ( const polyMesh& mesh, @@ -96,7 +91,6 @@ Foam::nearestToCell::nearestToCell {} -// Construct from dictionary Foam::nearestToCell::nearestToCell ( const polyMesh& mesh, @@ -108,7 +102,6 @@ Foam::nearestToCell::nearestToCell {} -// Construct from Istream Foam::nearestToCell::nearestToCell ( const polyMesh& mesh, diff --git a/src/meshTools/sets/cellSources/pointToCell/pointToCell.C b/src/meshTools/sets/cellSources/pointToCell/pointToCell.C index cfafa4d2e7..415969ad8a 100644 --- a/src/meshTools/sets/cellSources/pointToCell/pointToCell.C +++ b/src/meshTools/sets/cellSources/pointToCell/pointToCell.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,7 +26,6 @@ License #include "pointToCell.H" #include "polyMesh.H" #include "pointSet.H" - #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -105,7 +104,6 @@ void Foam::pointToCell::combine(topoSet& set, const bool add) const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::pointToCell::pointToCell ( const polyMesh& mesh, @@ -119,7 +117,6 @@ Foam::pointToCell::pointToCell {} -// Construct from dictionary Foam::pointToCell::pointToCell ( const polyMesh& mesh, @@ -132,7 +129,6 @@ Foam::pointToCell::pointToCell {} -// Construct from Istream Foam::pointToCell::pointToCell ( const polyMesh& mesh, diff --git a/src/meshTools/sets/cellSources/regionToCell/regionToCell.C b/src/meshTools/sets/cellSources/regionToCell/regionToCell.C index e85fef3cc2..804808d97e 100644 --- a/src/meshTools/sets/cellSources/regionToCell/regionToCell.C +++ b/src/meshTools/sets/cellSources/regionToCell/regionToCell.C @@ -34,13 +34,9 @@ License namespace Foam { - -defineTypeNameAndDebug(regionToCell, 0); - -addToRunTimeSelectionTable(topoSetSource, regionToCell, word); - -addToRunTimeSelectionTable(topoSetSource, regionToCell, istream); - + defineTypeNameAndDebug(regionToCell, 0); + addToRunTimeSelectionTable(topoSetSource, regionToCell, word); + addToRunTimeSelectionTable(topoSetSource, regionToCell, istream); } @@ -385,7 +381,6 @@ void Foam::regionToCell::combine(topoSet& set, const bool add) const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::regionToCell::regionToCell ( const polyMesh& mesh, @@ -401,7 +396,6 @@ Foam::regionToCell::regionToCell {} -// Construct from dictionary Foam::regionToCell::regionToCell ( const polyMesh& mesh, @@ -420,7 +414,6 @@ Foam::regionToCell::regionToCell {} -// Construct from Istream Foam::regionToCell::regionToCell ( const polyMesh& mesh, diff --git a/src/meshTools/sets/cellSources/rotatedBoxToCell/rotatedBoxToCell.C b/src/meshTools/sets/cellSources/rotatedBoxToCell/rotatedBoxToCell.C index 2e0d9bd223..799d4d5237 100644 --- a/src/meshTools/sets/cellSources/rotatedBoxToCell/rotatedBoxToCell.C +++ b/src/meshTools/sets/cellSources/rotatedBoxToCell/rotatedBoxToCell.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,20 +26,15 @@ License #include "rotatedBoxToCell.H" #include "polyMesh.H" #include "cellModel.H" - #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -defineTypeNameAndDebug(rotatedBoxToCell, 0); - -addToRunTimeSelectionTable(topoSetSource, rotatedBoxToCell, word); - -addToRunTimeSelectionTable(topoSetSource, rotatedBoxToCell, istream); - + defineTypeNameAndDebug(rotatedBoxToCell, 0); + addToRunTimeSelectionTable(topoSetSource, rotatedBoxToCell, word); + addToRunTimeSelectionTable(topoSetSource, rotatedBoxToCell, istream); } @@ -117,7 +112,6 @@ void Foam::rotatedBoxToCell::combine(topoSet& set, const bool add) const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::rotatedBoxToCell::rotatedBoxToCell ( const polyMesh& mesh, @@ -135,7 +129,6 @@ Foam::rotatedBoxToCell::rotatedBoxToCell {} -// Construct from dictionary Foam::rotatedBoxToCell::rotatedBoxToCell ( const polyMesh& mesh, @@ -150,7 +143,6 @@ Foam::rotatedBoxToCell::rotatedBoxToCell {} -// Construct from Istream Foam::rotatedBoxToCell::rotatedBoxToCell(const polyMesh& mesh, Istream& is) : topoSetSource(mesh), diff --git a/src/meshTools/sets/cellSources/shapeToCell/shapeToCell.C b/src/meshTools/sets/cellSources/shapeToCell/shapeToCell.C index f98f9be081..961c678708 100644 --- a/src/meshTools/sets/cellSources/shapeToCell/shapeToCell.C +++ b/src/meshTools/sets/cellSources/shapeToCell/shapeToCell.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,20 +28,15 @@ License #include "unitConversion.H" #include "hexMatcher.H" #include "cellFeatures.H" - #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -defineTypeNameAndDebug(shapeToCell, 0); - -addToRunTimeSelectionTable(topoSetSource, shapeToCell, word); - -addToRunTimeSelectionTable(topoSetSource, shapeToCell, istream); - + defineTypeNameAndDebug(shapeToCell, 0); + addToRunTimeSelectionTable(topoSetSource, shapeToCell, word); + addToRunTimeSelectionTable(topoSetSource, shapeToCell, istream); } diff --git a/src/meshTools/sets/cellSources/sphereToCell/sphereToCell.C b/src/meshTools/sets/cellSources/sphereToCell/sphereToCell.C index d3c7cfc3ae..cd356da905 100644 --- a/src/meshTools/sets/cellSources/sphereToCell/sphereToCell.C +++ b/src/meshTools/sets/cellSources/sphereToCell/sphereToCell.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -91,7 +91,6 @@ Foam::sphereToCell::sphereToCell {} -// Construct from Istream Foam::sphereToCell::sphereToCell ( const polyMesh& mesh, diff --git a/src/meshTools/sets/cellSources/targetVolumeToCell/targetVolumeToCell.C b/src/meshTools/sets/cellSources/targetVolumeToCell/targetVolumeToCell.C index b8e633b9f8..4ab71b43d0 100644 --- a/src/meshTools/sets/cellSources/targetVolumeToCell/targetVolumeToCell.C +++ b/src/meshTools/sets/cellSources/targetVolumeToCell/targetVolumeToCell.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -28,20 +28,15 @@ License #include "globalMeshData.H" #include "plane.H" #include "cellSet.H" - #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -defineTypeNameAndDebug(targetVolumeToCell, 0); - -addToRunTimeSelectionTable(topoSetSource, targetVolumeToCell, word); - -addToRunTimeSelectionTable(topoSetSource, targetVolumeToCell, istream); - + defineTypeNameAndDebug(targetVolumeToCell, 0); + addToRunTimeSelectionTable(topoSetSource, targetVolumeToCell, word); + addToRunTimeSelectionTable(topoSetSource, targetVolumeToCell, istream); } @@ -269,7 +264,6 @@ void Foam::targetVolumeToCell::combine(topoSet& set, const bool add) const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::targetVolumeToCell::targetVolumeToCell ( const polyMesh& mesh, @@ -283,7 +277,6 @@ Foam::targetVolumeToCell::targetVolumeToCell {} -// Construct from dictionary Foam::targetVolumeToCell::targetVolumeToCell ( const polyMesh& mesh, @@ -297,7 +290,6 @@ Foam::targetVolumeToCell::targetVolumeToCell {} -// Construct from Istream Foam::targetVolumeToCell::targetVolumeToCell ( const polyMesh& mesh, diff --git a/src/meshTools/sets/cellSources/zoneToCell/zoneToCell.C b/src/meshTools/sets/cellSources/zoneToCell/zoneToCell.C index 56ed36a172..612da1e918 100644 --- a/src/meshTools/sets/cellSources/zoneToCell/zoneToCell.C +++ b/src/meshTools/sets/cellSources/zoneToCell/zoneToCell.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,20 +25,15 @@ License #include "zoneToCell.H" #include "polyMesh.H" - #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -defineTypeNameAndDebug(zoneToCell, 0); - -addToRunTimeSelectionTable(topoSetSource, zoneToCell, word); - -addToRunTimeSelectionTable(topoSetSource, zoneToCell, istream); - + defineTypeNameAndDebug(zoneToCell, 0); + addToRunTimeSelectionTable(topoSetSource, zoneToCell, word); + addToRunTimeSelectionTable(topoSetSource, zoneToCell, istream); } @@ -92,7 +87,6 @@ void Foam::zoneToCell::combine(topoSet& set, const bool add) const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::zoneToCell::zoneToCell ( const polyMesh& mesh, @@ -104,7 +98,6 @@ Foam::zoneToCell::zoneToCell {} -// Construct from dictionary Foam::zoneToCell::zoneToCell ( const polyMesh& mesh, @@ -116,7 +109,6 @@ Foam::zoneToCell::zoneToCell {} -// Construct from Istream Foam::zoneToCell::zoneToCell ( const polyMesh& mesh, diff --git a/src/meshTools/sets/cellZoneSources/setToCellZone/setToCellZone.C b/src/meshTools/sets/cellZoneSources/setToCellZone/setToCellZone.C index afd7f70331..db01c78169 100644 --- a/src/meshTools/sets/cellZoneSources/setToCellZone/setToCellZone.C +++ b/src/meshTools/sets/cellZoneSources/setToCellZone/setToCellZone.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,20 +26,15 @@ License #include "setToCellZone.H" #include "polyMesh.H" #include "cellZoneSet.H" - #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -defineTypeNameAndDebug(setToCellZone, 0); - -addToRunTimeSelectionTable(topoSetSource, setToCellZone, word); - -addToRunTimeSelectionTable(topoSetSource, setToCellZone, istream); - + defineTypeNameAndDebug(setToCellZone, 0); + addToRunTimeSelectionTable(topoSetSource, setToCellZone, word); + addToRunTimeSelectionTable(topoSetSource, setToCellZone, istream); } @@ -53,7 +48,6 @@ Foam::topoSetSource::addToUsageTable Foam::setToCellZone::usage_ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::setToCellZone::setToCellZone ( const polyMesh& mesh, @@ -65,7 +59,6 @@ Foam::setToCellZone::setToCellZone {} -// Construct from dictionary Foam::setToCellZone::setToCellZone ( const polyMesh& mesh, @@ -77,7 +70,6 @@ Foam::setToCellZone::setToCellZone {} -// Construct from Istream Foam::setToCellZone::setToCellZone ( const polyMesh& mesh, diff --git a/src/meshTools/sets/faceSources/boundaryToFace/boundaryToFace.C b/src/meshTools/sets/faceSources/boundaryToFace/boundaryToFace.C index 7ae3ab1a6c..a1085fdbf2 100644 --- a/src/meshTools/sets/faceSources/boundaryToFace/boundaryToFace.C +++ b/src/meshTools/sets/faceSources/boundaryToFace/boundaryToFace.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,20 +25,15 @@ License #include "boundaryToFace.H" #include "polyMesh.H" - #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -defineTypeNameAndDebug(boundaryToFace, 0); - -addToRunTimeSelectionTable(topoSetSource, boundaryToFace, word); - -addToRunTimeSelectionTable(topoSetSource, boundaryToFace, istream); - + defineTypeNameAndDebug(boundaryToFace, 0); + addToRunTimeSelectionTable(topoSetSource, boundaryToFace, word); + addToRunTimeSelectionTable(topoSetSource, boundaryToFace, istream); } @@ -68,21 +63,18 @@ void Foam::boundaryToFace::combine(topoSet& set, const bool add) const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::boundaryToFace::boundaryToFace(const polyMesh& mesh) : topoSetSource(mesh) {} -// Construct from dictionary Foam::boundaryToFace::boundaryToFace(const polyMesh& mesh, const dictionary&) : topoSetSource(mesh) {} -// Construct from Istream Foam::boundaryToFace::boundaryToFace ( const polyMesh& mesh, diff --git a/src/meshTools/sets/faceSources/boxToFace/boxToFace.C b/src/meshTools/sets/faceSources/boxToFace/boxToFace.C index 5ad4d8e5e1..c15b2963ad 100644 --- a/src/meshTools/sets/faceSources/boxToFace/boxToFace.C +++ b/src/meshTools/sets/faceSources/boxToFace/boxToFace.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,20 +25,15 @@ License #include "boxToFace.H" #include "polyMesh.H" - #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -defineTypeNameAndDebug(boxToFace, 0); - -addToRunTimeSelectionTable(topoSetSource, boxToFace, word); - -addToRunTimeSelectionTable(topoSetSource, boxToFace, istream); - + defineTypeNameAndDebug(boxToFace, 0); + addToRunTimeSelectionTable(topoSetSource, boxToFace, word); + addToRunTimeSelectionTable(topoSetSource, boxToFace, istream); } @@ -72,7 +67,6 @@ void Foam::boxToFace::combine(topoSet& set, const bool add) const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::boxToFace::boxToFace ( const polyMesh& mesh, @@ -84,7 +78,6 @@ Foam::boxToFace::boxToFace {} -// Construct from dictionary Foam::boxToFace::boxToFace ( const polyMesh& mesh, @@ -101,7 +94,6 @@ Foam::boxToFace::boxToFace {} -// Construct from Istream Foam::boxToFace::boxToFace ( const polyMesh& mesh, diff --git a/src/meshTools/sets/faceSources/boxToFace/boxToFace.H b/src/meshTools/sets/faceSources/boxToFace/boxToFace.H index f3b4d4707d..2cde01e1f9 100644 --- a/src/meshTools/sets/faceSources/boxToFace/boxToFace.H +++ b/src/meshTools/sets/faceSources/boxToFace/boxToFace.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -51,7 +51,6 @@ class boxToFace : public topoSetSource { - // Private data //- Add usage string @@ -111,7 +110,6 @@ public: const topoSetSource::setAction action, topoSet& ) const; - }; diff --git a/src/meshTools/sets/faceSources/cellToFace/cellToFace.C b/src/meshTools/sets/faceSources/cellToFace/cellToFace.C index ac8336a6b8..62912ef7f4 100644 --- a/src/meshTools/sets/faceSources/cellToFace/cellToFace.C +++ b/src/meshTools/sets/faceSources/cellToFace/cellToFace.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/meshTools/sets/faceSources/cylinderAnnulusToFace/cylinderAnnulusToFace.C b/src/meshTools/sets/faceSources/cylinderAnnulusToFace/cylinderAnnulusToFace.C new file mode 100644 index 0000000000..0dbbe7c9ff --- /dev/null +++ b/src/meshTools/sets/faceSources/cylinderAnnulusToFace/cylinderAnnulusToFace.C @@ -0,0 +1,160 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2017 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "cylinderAnnulusToFace.H" +#include "polyMesh.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(cylinderAnnulusToFace, 0); + addToRunTimeSelectionTable(topoSetSource, cylinderAnnulusToFace, word); + addToRunTimeSelectionTable(topoSetSource, cylinderAnnulusToFace, istream); +} + + +Foam::topoSetSource::addToUsageTable Foam::cylinderAnnulusToFace::usage_ +( + cylinderAnnulusToFace::typeName, + "\n Usage: cylinderAnnulusToFace (p1X p1Y p1Z) (p2X p2Y p2Z)" + " outerRadius innerRadius\n\n" + " Select all faces with face centre within bounding cylinder annulus\n\n" +); + + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +void Foam::cylinderAnnulusToFace::combine(topoSet& set, const bool add) const +{ + const vector axis = p2_ - p1_; + const scalar orad2 = sqr(outerRadius_); + const scalar irad2 = sqr(innerRadius_); + const scalar magAxis2 = magSqr(axis); + + const pointField& ctrs = mesh_.faceCentres(); + + forAll(ctrs, facei) + { + vector d = ctrs[facei] - p1_; + scalar magD = d & axis; + + if ((magD > 0) && (magD < magAxis2)) + { + scalar d2 = (d & d) - sqr(magD)/magAxis2; + if ((d2 < orad2) && (d2 > irad2)) + { + addOrDelete(set, facei, add); + } + } + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::cylinderAnnulusToFace::cylinderAnnulusToFace +( + const polyMesh& mesh, + const vector& p1, + const vector& p2, + const scalar outerRadius, + const scalar innerRadius +) +: + topoSetSource(mesh), + p1_(p1), + p2_(p2), + outerRadius_(outerRadius), + innerRadius_(innerRadius) +{} + + +Foam::cylinderAnnulusToFace::cylinderAnnulusToFace +( + const polyMesh& mesh, + const dictionary& dict +) +: + topoSetSource(mesh), + p1_(dict.lookup("p1")), + p2_(dict.lookup("p2")), + outerRadius_(readScalar(dict.lookup("outerRadius"))), + innerRadius_(readScalar(dict.lookup("innerRadius"))) +{} + + +Foam::cylinderAnnulusToFace::cylinderAnnulusToFace +( + const polyMesh& mesh, + Istream& is +) +: + topoSetSource(mesh), + p1_(checkIs(is)), + p2_(checkIs(is)), + outerRadius_(readScalar(checkIs(is))), + innerRadius_(readScalar(checkIs(is))) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::cylinderAnnulusToFace::~cylinderAnnulusToFace() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::cylinderAnnulusToFace::applyToSet +( + const topoSetSource::setAction action, + topoSet& set +) const +{ + if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD)) + { + Info<< " Adding faces with centre within cylinder annulus," + << " with p1 = " + << p1_ << ", p2 = " << p2_ << " and outer radius = " << outerRadius_ + << " and inner radius = " << innerRadius_ + << endl; + + combine(set, true); + } + else if (action == topoSetSource::DELETE) + { + Info<< " Removing faces with centre within cylinder, with p1 = " + << p1_ << ", p2 = " << p2_ << " and outer radius = " << outerRadius_ + << " and inner radius " << innerRadius_ + << endl; + + combine(set, false); + } +} + + +// ************************************************************************* // diff --git a/src/meshTools/sets/faceSources/cylinderAnnulusToFace/cylinderAnnulusToFace.H b/src/meshTools/sets/faceSources/cylinderAnnulusToFace/cylinderAnnulusToFace.H new file mode 100644 index 0000000000..3149a60429 --- /dev/null +++ b/src/meshTools/sets/faceSources/cylinderAnnulusToFace/cylinderAnnulusToFace.H @@ -0,0 +1,137 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2017 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::cylinderAnnulusToFace + +Description + A topoSetSource to select faces based on face centres inside a + cylinder annulus. + +SourceFiles + cylinderAnnulusToFace.C + +\*---------------------------------------------------------------------------*/ + +#ifndef cylinderAnnulusToFace_H +#define cylinderAnnulusToFace_H + +#include "topoSetSource.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class cylinderAnnulusToFace Declaration +\*---------------------------------------------------------------------------*/ + +class cylinderAnnulusToFace +: + public topoSetSource +{ + + // Private data + + //- Add usage string + static addToUsageTable usage_; + + //- First point on cylinder axis + vector p1_; + + //- Second point on cylinder axis + vector p2_; + + //- Outer Radius + scalar outerRadius_; + + //- Inner Radius + scalar innerRadius_; + + + // Private Member Functions + + void combine(topoSet& set, const bool add) const; + + +public: + + //- Runtime type information + TypeName("cylinderAnnulusToFace"); + + + // Constructors + + //- Construct from components + cylinderAnnulusToFace + ( + const polyMesh& mesh, + const vector& p1, + const vector& p2, + const scalar outerRadius, + const scalar innerRadius + ); + + //- Construct from dictionary + cylinderAnnulusToFace + ( + const polyMesh& mesh, + const dictionary& dict + ); + + //- Construct from Istream + cylinderAnnulusToFace + ( + const polyMesh& mesh, + Istream& + ); + + + // Destructor + virtual ~cylinderAnnulusToFace(); + + // Member Functions + + virtual sourceType setType() const + { + return CELLSETSOURCE; + } + + virtual void applyToSet + ( + const topoSetSource::setAction action, + topoSet& + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/meshTools/sets/faceSources/cylinderToFace/cylinderToFace.C b/src/meshTools/sets/faceSources/cylinderToFace/cylinderToFace.C new file mode 100644 index 0000000000..a360e4f926 --- /dev/null +++ b/src/meshTools/sets/faceSources/cylinderToFace/cylinderToFace.C @@ -0,0 +1,149 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2017 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +\*---------------------------------------------------------------------------*/ + +#include "cylinderToFace.H" +#include "polyMesh.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(cylinderToFace, 0); + addToRunTimeSelectionTable(topoSetSource, cylinderToFace, word); + addToRunTimeSelectionTable(topoSetSource, cylinderToFace, istream); +} + + +Foam::topoSetSource::addToUsageTable Foam::cylinderToFace::usage_ +( + cylinderToFace::typeName, + "\n Usage: cylinderToFace (p1X p1Y p1Z) (p2X p2Y p2Z) radius\n\n" + " Select all faces with face centre within bounding cylinder\n\n" +); + + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +void Foam::cylinderToFace::combine(topoSet& set, const bool add) const +{ + const vector axis = p2_ - p1_; + const scalar rad2 = sqr(radius_); + const scalar magAxis2 = magSqr(axis); + + const pointField& ctrs = mesh_.faceCentres(); + + forAll(ctrs, facei) + { + vector d = ctrs[facei] - p1_; + scalar magD = d & axis; + + if ((magD > 0) && (magD < magAxis2)) + { + scalar d2 = (d & d) - sqr(magD)/magAxis2; + if (d2 < rad2) + { + addOrDelete(set, facei, add); + } + } + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::cylinderToFace::cylinderToFace +( + const polyMesh& mesh, + const vector& p1, + const vector& p2, + const scalar radius +) +: + topoSetSource(mesh), + p1_(p1), + p2_(p2), + radius_(radius) +{} + + +Foam::cylinderToFace::cylinderToFace +( + const polyMesh& mesh, + const dictionary& dict +) +: + topoSetSource(mesh), + p1_(dict.lookup("p1")), + p2_(dict.lookup("p2")), + radius_(readScalar(dict.lookup("radius"))) +{} + + +Foam::cylinderToFace::cylinderToFace +( + const polyMesh& mesh, + Istream& is +) +: + topoSetSource(mesh), + p1_(checkIs(is)), + p2_(checkIs(is)), + radius_(readScalar(checkIs(is))) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::cylinderToFace::~cylinderToFace() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::cylinderToFace::applyToSet +( + const topoSetSource::setAction action, + topoSet& set +) const +{ + if ((action == topoSetSource::NEW) || (action == topoSetSource::ADD)) + { + Info<< " Adding faces with centre within cylinder, with p1 = " + << p1_ << ", p2 = " << p2_ << " and radius = " << radius_ << endl; + + combine(set, true); + } + else if (action == topoSetSource::DELETE) + { + Info<< " Removing faces with centre within cylinder, with p1 = " + << p1_ << ", p2 = " << p2_ << " and radius = " << radius_ << endl; + + combine(set, false); + } +} + + +// ************************************************************************* // diff --git a/src/meshTools/sets/faceSources/cylinderToFace/cylinderToFace.H b/src/meshTools/sets/faceSources/cylinderToFace/cylinderToFace.H new file mode 100644 index 0000000000..b51083aebf --- /dev/null +++ b/src/meshTools/sets/faceSources/cylinderToFace/cylinderToFace.H @@ -0,0 +1,133 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2017 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see . + +Class + Foam::cylinderToFace + +Description + A topoSetSource to select faces based on face centres inside a cylinder. + +SourceFiles + cylinderToFace.C + +\*---------------------------------------------------------------------------*/ + +#ifndef cylinderToFace_H +#define cylinderToFace_H + +#include "topoSetSource.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class cylinderToFace Declaration +\*---------------------------------------------------------------------------*/ + +class cylinderToFace +: + public topoSetSource +{ + + // Private data + + //- Add usage string + static addToUsageTable usage_; + + //- First point on cylinder axis + vector p1_; + + //- Second point on cylinder axis + vector p2_; + + //- Radius + scalar radius_; + + + // Private Member Functions + + void combine(topoSet& set, const bool add) const; + + +public: + + //- Runtime type information + TypeName("cylinderToFace"); + + + // Constructors + + //- Construct from components + cylinderToFace + ( + const polyMesh& mesh, + const vector& p1, + const vector& p2, + const scalar radius + ); + + //- Construct from dictionary + cylinderToFace + ( + const polyMesh& mesh, + const dictionary& dict + ); + + //- Construct from Istream + cylinderToFace + ( + const polyMesh& mesh, + Istream& + ); + + + //- Destructor + virtual ~cylinderToFace(); + + + // Member Functions + + virtual sourceType setType() const + { + return CELLSETSOURCE; + } + + virtual void applyToSet + ( + const topoSetSource::setAction action, + topoSet& + ) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/meshTools/sets/faceSources/faceToFace/faceToFace.C b/src/meshTools/sets/faceSources/faceToFace/faceToFace.C index 1e05fdefde..fb78cb52ed 100644 --- a/src/meshTools/sets/faceSources/faceToFace/faceToFace.C +++ b/src/meshTools/sets/faceSources/faceToFace/faceToFace.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-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,20 +26,15 @@ License #include "faceToFace.H" #include "polyMesh.H" #include "faceSet.H" - #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -defineTypeNameAndDebug(faceToFace, 0); - -addToRunTimeSelectionTable(topoSetSource, faceToFace, word); - -addToRunTimeSelectionTable(topoSetSource, faceToFace, istream); - + defineTypeNameAndDebug(faceToFace, 0); + addToRunTimeSelectionTable(topoSetSource, faceToFace, word); + addToRunTimeSelectionTable(topoSetSource, faceToFace, istream); } @@ -53,7 +48,6 @@ Foam::topoSetSource::addToUsageTable Foam::faceToFace::usage_ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::faceToFace::faceToFace ( const polyMesh& mesh, @@ -65,7 +59,6 @@ Foam::faceToFace::faceToFace {} -// Construct from dictionary Foam::faceToFace::faceToFace ( const polyMesh& mesh, @@ -77,7 +70,6 @@ Foam::faceToFace::faceToFace {} -// Construct from Istream Foam::faceToFace::faceToFace ( const polyMesh& mesh, diff --git a/src/meshTools/sets/faceSources/labelToFace/labelToFace.C b/src/meshTools/sets/faceSources/labelToFace/labelToFace.C index ca61be9071..9f7efd81e9 100644 --- a/src/meshTools/sets/faceSources/labelToFace/labelToFace.C +++ b/src/meshTools/sets/faceSources/labelToFace/labelToFace.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-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,20 +25,15 @@ License #include "labelToFace.H" #include "polyMesh.H" - #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -defineTypeNameAndDebug(labelToFace, 0); - -addToRunTimeSelectionTable(topoSetSource, labelToFace, word); - -addToRunTimeSelectionTable(topoSetSource, labelToFace, istream); - + defineTypeNameAndDebug(labelToFace, 0); + addToRunTimeSelectionTable(topoSetSource, labelToFace, word); + addToRunTimeSelectionTable(topoSetSource, labelToFace, istream); } @@ -63,7 +58,6 @@ void Foam::labelToFace::combine(topoSet& set, const bool add) const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::labelToFace::labelToFace ( const polyMesh& mesh, @@ -75,7 +69,6 @@ Foam::labelToFace::labelToFace {} -// Construct from dictionary Foam::labelToFace::labelToFace ( const polyMesh& mesh, @@ -87,7 +80,6 @@ Foam::labelToFace::labelToFace {} -// Construct from Istream Foam::labelToFace::labelToFace ( const polyMesh& mesh, diff --git a/src/meshTools/sets/faceSources/normalToFace/normalToFace.C b/src/meshTools/sets/faceSources/normalToFace/normalToFace.C index 576aeae449..9cfdc240ee 100644 --- a/src/meshTools/sets/faceSources/normalToFace/normalToFace.C +++ b/src/meshTools/sets/faceSources/normalToFace/normalToFace.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,20 +26,15 @@ License #include "normalToFace.H" #include "polyMesh.H" #include "faceSet.H" - #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -defineTypeNameAndDebug(normalToFace, 0); - -addToRunTimeSelectionTable(topoSetSource, normalToFace, word); - -addToRunTimeSelectionTable(topoSetSource, normalToFace, istream); - + defineTypeNameAndDebug(normalToFace, 0); + addToRunTimeSelectionTable(topoSetSource, normalToFace, word); + addToRunTimeSelectionTable(topoSetSource, normalToFace, istream); } @@ -71,7 +66,6 @@ void Foam::normalToFace::setNormal() // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::normalToFace::normalToFace ( const polyMesh& mesh, @@ -87,7 +81,6 @@ Foam::normalToFace::normalToFace } -// Construct from dictionary Foam::normalToFace::normalToFace(const polyMesh& mesh, const dictionary& dict) : topoSetSource(mesh), @@ -98,7 +91,6 @@ Foam::normalToFace::normalToFace(const polyMesh& mesh, const dictionary& dict) } -// Construct from Istream Foam::normalToFace::normalToFace(const polyMesh& mesh, Istream& is) : topoSetSource(mesh), diff --git a/src/meshTools/sets/faceSources/patchToFace/patchToFace.C b/src/meshTools/sets/faceSources/patchToFace/patchToFace.C index 26f7d7459c..94d3170143 100644 --- a/src/meshTools/sets/faceSources/patchToFace/patchToFace.C +++ b/src/meshTools/sets/faceSources/patchToFace/patchToFace.C @@ -25,20 +25,15 @@ License #include "patchToFace.H" #include "polyMesh.H" - #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -defineTypeNameAndDebug(patchToFace, 0); - -addToRunTimeSelectionTable(topoSetSource, patchToFace, word); - -addToRunTimeSelectionTable(topoSetSource, patchToFace, istream); - + defineTypeNameAndDebug(patchToFace, 0); + addToRunTimeSelectionTable(topoSetSource, patchToFace, word); + addToRunTimeSelectionTable(topoSetSource, patchToFace, istream); } @@ -90,7 +85,6 @@ void Foam::patchToFace::combine(topoSet& set, const bool add) const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::patchToFace::patchToFace ( const polyMesh& mesh, @@ -102,7 +96,6 @@ Foam::patchToFace::patchToFace {} -// Construct from dictionary Foam::patchToFace::patchToFace ( const polyMesh& mesh, @@ -114,7 +107,6 @@ Foam::patchToFace::patchToFace {} -// Construct from Istream Foam::patchToFace::patchToFace ( const polyMesh& mesh, diff --git a/src/meshTools/sets/faceSources/pointToFace/pointToFace.C b/src/meshTools/sets/faceSources/pointToFace/pointToFace.C index 31e5322a39..2ecc19a91b 100644 --- a/src/meshTools/sets/faceSources/pointToFace/pointToFace.C +++ b/src/meshTools/sets/faceSources/pointToFace/pointToFace.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,7 +26,6 @@ License #include "pointToFace.H" #include "polyMesh.H" #include "pointSet.H" - #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -146,7 +145,6 @@ void Foam::pointToFace::combine(topoSet& set, const bool add) const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::pointToFace::pointToFace ( const polyMesh& mesh, @@ -160,7 +158,6 @@ Foam::pointToFace::pointToFace {} -// Construct from dictionary Foam::pointToFace::pointToFace ( const polyMesh& mesh, @@ -173,7 +170,6 @@ Foam::pointToFace::pointToFace {} -// Construct from Istream Foam::pointToFace::pointToFace ( const polyMesh& mesh, diff --git a/src/meshTools/sets/faceSources/regionToFace/regionToFace.C b/src/meshTools/sets/faceSources/regionToFace/regionToFace.C index 29548096e7..e9fbf00645 100644 --- a/src/meshTools/sets/faceSources/regionToFace/regionToFace.C +++ b/src/meshTools/sets/faceSources/regionToFace/regionToFace.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -37,13 +37,9 @@ License namespace Foam { - -defineTypeNameAndDebug(regionToFace, 0); - -addToRunTimeSelectionTable(topoSetSource, regionToFace, word); - -addToRunTimeSelectionTable(topoSetSource, regionToFace, istream); - + defineTypeNameAndDebug(regionToFace, 0); + addToRunTimeSelectionTable(topoSetSource, regionToFace, word); + addToRunTimeSelectionTable(topoSetSource, regionToFace, istream); } @@ -176,7 +172,6 @@ void Foam::regionToFace::combine(topoSet& set, const bool add) const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::regionToFace::regionToFace ( const polyMesh& mesh, @@ -190,7 +185,6 @@ Foam::regionToFace::regionToFace {} -// Construct from dictionary Foam::regionToFace::regionToFace ( const polyMesh& mesh, @@ -203,7 +197,6 @@ Foam::regionToFace::regionToFace {} -// Construct from Istream Foam::regionToFace::regionToFace ( const polyMesh& mesh, diff --git a/src/meshTools/sets/faceSources/zoneToFace/zoneToFace.C b/src/meshTools/sets/faceSources/zoneToFace/zoneToFace.C index fa29739e75..9285cc1e74 100644 --- a/src/meshTools/sets/faceSources/zoneToFace/zoneToFace.C +++ b/src/meshTools/sets/faceSources/zoneToFace/zoneToFace.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,20 +25,15 @@ License #include "zoneToFace.H" #include "polyMesh.H" - #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -defineTypeNameAndDebug(zoneToFace, 0); - -addToRunTimeSelectionTable(topoSetSource, zoneToFace, word); - -addToRunTimeSelectionTable(topoSetSource, zoneToFace, istream); - + defineTypeNameAndDebug(zoneToFace, 0); + addToRunTimeSelectionTable(topoSetSource, zoneToFace, word); + addToRunTimeSelectionTable(topoSetSource, zoneToFace, istream); } @@ -92,7 +87,6 @@ void Foam::zoneToFace::combine(topoSet& set, const bool add) const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::zoneToFace::zoneToFace ( const polyMesh& mesh, @@ -104,7 +98,6 @@ Foam::zoneToFace::zoneToFace {} -// Construct from dictionary Foam::zoneToFace::zoneToFace ( const polyMesh& mesh, @@ -116,7 +109,6 @@ Foam::zoneToFace::zoneToFace {} -// Construct from Istream Foam::zoneToFace::zoneToFace ( const polyMesh& mesh, diff --git a/src/meshTools/sets/faceZoneSources/faceZoneToFaceZone/faceZoneToFaceZone.C b/src/meshTools/sets/faceZoneSources/faceZoneToFaceZone/faceZoneToFaceZone.C index e3f36bb25c..fe0ee3c5d2 100644 --- a/src/meshTools/sets/faceZoneSources/faceZoneToFaceZone/faceZoneToFaceZone.C +++ b/src/meshTools/sets/faceZoneSources/faceZoneToFaceZone/faceZoneToFaceZone.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,20 +26,15 @@ License #include "faceZoneToFaceZone.H" #include "polyMesh.H" #include "faceZoneSet.H" - #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -defineTypeNameAndDebug(faceZoneToFaceZone, 0); - -addToRunTimeSelectionTable(topoSetSource, faceZoneToFaceZone, word); - -addToRunTimeSelectionTable(topoSetSource, faceZoneToFaceZone, istream); - + defineTypeNameAndDebug(faceZoneToFaceZone, 0); + addToRunTimeSelectionTable(topoSetSource, faceZoneToFaceZone, word); + addToRunTimeSelectionTable(topoSetSource, faceZoneToFaceZone, istream); } @@ -53,7 +48,6 @@ Foam::topoSetSource::addToUsageTable Foam::faceZoneToFaceZone::usage_ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::faceZoneToFaceZone::faceZoneToFaceZone ( const polyMesh& mesh, @@ -65,7 +59,6 @@ Foam::faceZoneToFaceZone::faceZoneToFaceZone {} -// Construct from dictionary Foam::faceZoneToFaceZone::faceZoneToFaceZone ( const polyMesh& mesh, @@ -77,7 +70,6 @@ Foam::faceZoneToFaceZone::faceZoneToFaceZone {} -// Construct from Istream Foam::faceZoneToFaceZone::faceZoneToFaceZone ( const polyMesh& mesh, diff --git a/src/meshTools/sets/faceZoneSources/searchableSurfaceToFaceZone/searchableSurfaceToFaceZone.C b/src/meshTools/sets/faceZoneSources/searchableSurfaceToFaceZone/searchableSurfaceToFaceZone.C index 50b423a4ad..8739feb065 100644 --- a/src/meshTools/sets/faceZoneSources/searchableSurfaceToFaceZone/searchableSurfaceToFaceZone.C +++ b/src/meshTools/sets/faceZoneSources/searchableSurfaceToFaceZone/searchableSurfaceToFaceZone.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -57,7 +57,6 @@ Foam::topoSetSource::addToUsageTable Foam::searchableSurfaceToFaceZone::usage_ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from dictionary Foam::searchableSurfaceToFaceZone::searchableSurfaceToFaceZone ( const polyMesh& mesh, diff --git a/src/meshTools/sets/faceZoneSources/setToFaceZone/setToFaceZone.C b/src/meshTools/sets/faceZoneSources/setToFaceZone/setToFaceZone.C index 821d0777f2..b9b418f2f2 100644 --- a/src/meshTools/sets/faceZoneSources/setToFaceZone/setToFaceZone.C +++ b/src/meshTools/sets/faceZoneSources/setToFaceZone/setToFaceZone.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,20 +26,15 @@ License #include "setToFaceZone.H" #include "polyMesh.H" #include "faceZoneSet.H" - #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -defineTypeNameAndDebug(setToFaceZone, 0); - -addToRunTimeSelectionTable(topoSetSource, setToFaceZone, word); - -addToRunTimeSelectionTable(topoSetSource, setToFaceZone, istream); - + defineTypeNameAndDebug(setToFaceZone, 0); + addToRunTimeSelectionTable(topoSetSource, setToFaceZone, word); + addToRunTimeSelectionTable(topoSetSource, setToFaceZone, istream); } @@ -54,7 +49,6 @@ Foam::topoSetSource::addToUsageTable Foam::setToFaceZone::usage_ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::setToFaceZone::setToFaceZone ( const polyMesh& mesh, @@ -66,7 +60,6 @@ Foam::setToFaceZone::setToFaceZone {} -// Construct from dictionary Foam::setToFaceZone::setToFaceZone ( const polyMesh& mesh, @@ -78,7 +71,6 @@ Foam::setToFaceZone::setToFaceZone {} -// Construct from Istream Foam::setToFaceZone::setToFaceZone ( const polyMesh& mesh, diff --git a/src/meshTools/sets/faceZoneSources/setsToFaceZone/setsToFaceZone.C b/src/meshTools/sets/faceZoneSources/setsToFaceZone/setsToFaceZone.C index 89d666e810..70892ab62f 100644 --- a/src/meshTools/sets/faceZoneSources/setsToFaceZone/setsToFaceZone.C +++ b/src/meshTools/sets/faceZoneSources/setsToFaceZone/setsToFaceZone.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -51,7 +51,6 @@ Foam::topoSetSource::addToUsageTable Foam::setsToFaceZone::usage_ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::setsToFaceZone::setsToFaceZone ( const polyMesh& mesh, @@ -67,7 +66,6 @@ Foam::setsToFaceZone::setsToFaceZone {} -// Construct from dictionary Foam::setsToFaceZone::setsToFaceZone ( const polyMesh& mesh, @@ -81,7 +79,6 @@ Foam::setsToFaceZone::setsToFaceZone {} -// Construct from Istream Foam::setsToFaceZone::setsToFaceZone ( const polyMesh& mesh, diff --git a/src/meshTools/sets/pointSources/boxToPoint/boxToPoint.C b/src/meshTools/sets/pointSources/boxToPoint/boxToPoint.C index c11a49064f..7f55b9eb07 100644 --- a/src/meshTools/sets/pointSources/boxToPoint/boxToPoint.C +++ b/src/meshTools/sets/pointSources/boxToPoint/boxToPoint.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,20 +25,15 @@ License #include "boxToPoint.H" #include "polyMesh.H" - #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -defineTypeNameAndDebug(boxToPoint, 0); - -addToRunTimeSelectionTable(topoSetSource, boxToPoint, word); - -addToRunTimeSelectionTable(topoSetSource, boxToPoint, istream); - + defineTypeNameAndDebug(boxToPoint, 0); + addToRunTimeSelectionTable(topoSetSource, boxToPoint, word); + addToRunTimeSelectionTable(topoSetSource, boxToPoint, istream); } @@ -71,7 +66,6 @@ void Foam::boxToPoint::combine(topoSet& set, const bool add) const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::boxToPoint::boxToPoint ( const polyMesh& mesh, @@ -83,7 +77,6 @@ Foam::boxToPoint::boxToPoint {} -// Construct from dictionary Foam::boxToPoint::boxToPoint ( const polyMesh& mesh, @@ -100,7 +93,6 @@ Foam::boxToPoint::boxToPoint {} -// Construct from Istream Foam::boxToPoint::boxToPoint ( const polyMesh& mesh, diff --git a/src/meshTools/sets/pointSources/cellToPoint/cellToPoint.C b/src/meshTools/sets/pointSources/cellToPoint/cellToPoint.C index 244dc1bba1..bd17ab30eb 100644 --- a/src/meshTools/sets/pointSources/cellToPoint/cellToPoint.C +++ b/src/meshTools/sets/pointSources/cellToPoint/cellToPoint.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,7 +26,6 @@ License #include "cellToPoint.H" #include "polyMesh.H" #include "cellSet.H" - #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -84,7 +83,6 @@ void Foam::cellToPoint::combine(topoSet& set, const bool add) const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::cellToPoint::cellToPoint ( const polyMesh& mesh, @@ -98,7 +96,6 @@ Foam::cellToPoint::cellToPoint {} -// Construct from dictionary Foam::cellToPoint::cellToPoint ( const polyMesh& mesh, @@ -111,7 +108,6 @@ Foam::cellToPoint::cellToPoint {} -// Construct from Istream Foam::cellToPoint::cellToPoint ( const polyMesh& mesh, diff --git a/src/meshTools/sets/pointSources/faceToPoint/faceToPoint.C b/src/meshTools/sets/pointSources/faceToPoint/faceToPoint.C index 6e8392f885..1010ae8000 100644 --- a/src/meshTools/sets/pointSources/faceToPoint/faceToPoint.C +++ b/src/meshTools/sets/pointSources/faceToPoint/faceToPoint.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-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,7 +26,6 @@ License #include "faceToPoint.H" #include "polyMesh.H" #include "faceSet.H" - #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -77,7 +76,6 @@ void Foam::faceToPoint::combine(topoSet& set, const bool add) const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::faceToPoint::faceToPoint ( const polyMesh& mesh, @@ -91,7 +89,6 @@ Foam::faceToPoint::faceToPoint {} -// Construct from dictionary Foam::faceToPoint::faceToPoint ( const polyMesh& mesh, @@ -104,7 +101,6 @@ Foam::faceToPoint::faceToPoint {} -// Construct from Istream Foam::faceToPoint::faceToPoint ( const polyMesh& mesh, diff --git a/src/meshTools/sets/pointSources/labelToPoint/labelToPoint.C b/src/meshTools/sets/pointSources/labelToPoint/labelToPoint.C index cd8cd3aec2..1eed085308 100644 --- a/src/meshTools/sets/pointSources/labelToPoint/labelToPoint.C +++ b/src/meshTools/sets/pointSources/labelToPoint/labelToPoint.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-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,20 +25,15 @@ License #include "labelToPoint.H" #include "polyMesh.H" - #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -defineTypeNameAndDebug(labelToPoint, 0); - -addToRunTimeSelectionTable(topoSetSource, labelToPoint, word); - -addToRunTimeSelectionTable(topoSetSource, labelToPoint, istream); - + defineTypeNameAndDebug(labelToPoint, 0); + addToRunTimeSelectionTable(topoSetSource, labelToPoint, word); + addToRunTimeSelectionTable(topoSetSource, labelToPoint, istream); } @@ -63,7 +58,6 @@ void Foam::labelToPoint::combine(topoSet& set, const bool add) const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::labelToPoint::labelToPoint ( const polyMesh& mesh, @@ -75,7 +69,6 @@ Foam::labelToPoint::labelToPoint {} -// Construct from dictionary Foam::labelToPoint::labelToPoint ( const polyMesh& mesh, @@ -87,7 +80,6 @@ Foam::labelToPoint::labelToPoint {} -// Construct from Istream Foam::labelToPoint::labelToPoint ( const polyMesh& mesh, diff --git a/src/meshTools/sets/pointSources/nearestToPoint/nearestToPoint.C b/src/meshTools/sets/pointSources/nearestToPoint/nearestToPoint.C index 0f5d134ae9..339c9fac7c 100644 --- a/src/meshTools/sets/pointSources/nearestToPoint/nearestToPoint.C +++ b/src/meshTools/sets/pointSources/nearestToPoint/nearestToPoint.C @@ -32,13 +32,9 @@ License namespace Foam { - -defineTypeNameAndDebug(nearestToPoint, 0); - -addToRunTimeSelectionTable(topoSetSource, nearestToPoint, word); - -addToRunTimeSelectionTable(topoSetSource, nearestToPoint, istream); - + defineTypeNameAndDebug(nearestToPoint, 0); + addToRunTimeSelectionTable(topoSetSource, nearestToPoint, word); + addToRunTimeSelectionTable(topoSetSource, nearestToPoint, istream); } @@ -104,7 +100,6 @@ void Foam::nearestToPoint::combine(topoSet& set, const bool add) const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::nearestToPoint::nearestToPoint ( const polyMesh& mesh, @@ -116,7 +111,6 @@ Foam::nearestToPoint::nearestToPoint {} -// Construct from dictionary Foam::nearestToPoint::nearestToPoint ( const polyMesh& mesh, @@ -128,7 +122,6 @@ Foam::nearestToPoint::nearestToPoint {} -// Construct from Istream Foam::nearestToPoint::nearestToPoint ( const polyMesh& mesh, diff --git a/src/meshTools/sets/pointSources/pointToPoint/pointToPoint.C b/src/meshTools/sets/pointSources/pointToPoint/pointToPoint.C index ecad9fa04b..3a72bdda6c 100644 --- a/src/meshTools/sets/pointSources/pointToPoint/pointToPoint.C +++ b/src/meshTools/sets/pointSources/pointToPoint/pointToPoint.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-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,20 +26,15 @@ License #include "pointToPoint.H" #include "polyMesh.H" #include "pointSet.H" - #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -defineTypeNameAndDebug(pointToPoint, 0); - -addToRunTimeSelectionTable(topoSetSource, pointToPoint, word); - -addToRunTimeSelectionTable(topoSetSource, pointToPoint, istream); - + defineTypeNameAndDebug(pointToPoint, 0); + addToRunTimeSelectionTable(topoSetSource, pointToPoint, word); + addToRunTimeSelectionTable(topoSetSource, pointToPoint, istream); } @@ -53,7 +48,6 @@ Foam::topoSetSource::addToUsageTable Foam::pointToPoint::usage_ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::pointToPoint::pointToPoint ( const polyMesh& mesh, @@ -65,7 +59,6 @@ Foam::pointToPoint::pointToPoint {} -// Construct from dictionary Foam::pointToPoint::pointToPoint ( const polyMesh& mesh, @@ -77,7 +70,6 @@ Foam::pointToPoint::pointToPoint {} -// Construct from Istream Foam::pointToPoint::pointToPoint ( const polyMesh& mesh, diff --git a/src/meshTools/sets/pointSources/zoneToPoint/zoneToPoint.C b/src/meshTools/sets/pointSources/zoneToPoint/zoneToPoint.C index 8e9f620973..cdb7eb28d9 100644 --- a/src/meshTools/sets/pointSources/zoneToPoint/zoneToPoint.C +++ b/src/meshTools/sets/pointSources/zoneToPoint/zoneToPoint.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -32,13 +32,9 @@ License namespace Foam { - -defineTypeNameAndDebug(zoneToPoint, 0); - -addToRunTimeSelectionTable(topoSetSource, zoneToPoint, word); - -addToRunTimeSelectionTable(topoSetSource, zoneToPoint, istream); - + defineTypeNameAndDebug(zoneToPoint, 0); + addToRunTimeSelectionTable(topoSetSource, zoneToPoint, word); + addToRunTimeSelectionTable(topoSetSource, zoneToPoint, istream); } @@ -92,7 +88,6 @@ void Foam::zoneToPoint::combine(topoSet& set, const bool add) const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::zoneToPoint::zoneToPoint ( const polyMesh& mesh, @@ -104,7 +99,6 @@ Foam::zoneToPoint::zoneToPoint {} -// Construct from dictionary Foam::zoneToPoint::zoneToPoint ( const polyMesh& mesh, @@ -116,7 +110,6 @@ Foam::zoneToPoint::zoneToPoint {} -// Construct from Istream Foam::zoneToPoint::zoneToPoint ( const polyMesh& mesh, diff --git a/src/meshTools/sets/pointZoneSources/setToPointZone/setToPointZone.C b/src/meshTools/sets/pointZoneSources/setToPointZone/setToPointZone.C index b272752adc..b44321f048 100644 --- a/src/meshTools/sets/pointZoneSources/setToPointZone/setToPointZone.C +++ b/src/meshTools/sets/pointZoneSources/setToPointZone/setToPointZone.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,20 +26,15 @@ License #include "setToPointZone.H" #include "polyMesh.H" #include "pointZoneSet.H" - #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { - -defineTypeNameAndDebug(setToPointZone, 0); - -addToRunTimeSelectionTable(topoSetSource, setToPointZone, word); - -addToRunTimeSelectionTable(topoSetSource, setToPointZone, istream); - + defineTypeNameAndDebug(setToPointZone, 0); + addToRunTimeSelectionTable(topoSetSource, setToPointZone, word); + addToRunTimeSelectionTable(topoSetSource, setToPointZone, istream); } @@ -53,7 +48,6 @@ Foam::topoSetSource::addToUsageTable Foam::setToPointZone::usage_ // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -// Construct from components Foam::setToPointZone::setToPointZone ( const polyMesh& mesh, @@ -65,7 +59,6 @@ Foam::setToPointZone::setToPointZone {} -// Construct from dictionary Foam::setToPointZone::setToPointZone ( const polyMesh& mesh, @@ -77,7 +70,6 @@ Foam::setToPointZone::setToPointZone {} -// Construct from Istream Foam::setToPointZone::setToPointZone ( const polyMesh& mesh, From 87504d501a8abcfa735cb85ede2523335bfc25fa Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 2 May 2018 10:55:47 +0100 Subject: [PATCH 05/23] BUG: regionToCell: incorrect indexing of remote values. Fixes #818. --- .../sets/cellSources/regionToCell/regionToCell.C | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/meshTools/sets/cellSources/regionToCell/regionToCell.C b/src/meshTools/sets/cellSources/regionToCell/regionToCell.C index e85fef3cc2..8d5b736b00 100644 --- a/src/meshTools/sets/cellSources/regionToCell/regionToCell.C +++ b/src/meshTools/sets/cellSources/regionToCell/regionToCell.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2015-2018 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -90,11 +90,7 @@ void Foam::regionToCell::markRegionFaces { label facei = pp.start()+i; label bFacei = facei-mesh_.nInternalFaces(); - if - ( - selectedCell[faceCells[i]] - != selectedCell[nbrSelected[bFacei]] - ) + if (selectedCell[faceCells[i]] != nbrSelected[bFacei]) { regionFace[facei] = true; } From 4d72c2aac0dcbc20fbf6ec66208ed62c450f29bb Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 8 Jan 2018 10:51:00 +0100 Subject: [PATCH 06/23] COMP: incorrect executable path sphereSurfactantFoam (closes #695) --- applications/solvers/finiteArea/sphereSurfactantFoam/Make/files | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/applications/solvers/finiteArea/sphereSurfactantFoam/Make/files b/applications/solvers/finiteArea/sphereSurfactantFoam/Make/files index 574a497031..d10d3fe682 100644 --- a/applications/solvers/finiteArea/sphereSurfactantFoam/Make/files +++ b/applications/solvers/finiteArea/sphereSurfactantFoam/Make/files @@ -1,3 +1,3 @@ surfactantFoam.C -EXE = $(FOAM_USER_APPBIN)/sphereSurfactantFoam +EXE = $(FOAM_APPBIN)/sphereSurfactantFoam From bab508821e23f0934b9308fa88a0c1513a79a8f7 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Wed, 31 Jan 2018 16:44:58 +0000 Subject: [PATCH 07/23] BUG: EulerDdtScheme: Corrected fvcDdt dimensions for multiphase moving-mesh cases Resolves bug-report https://bugs.openfoam.org/view.php?id=2822 --- .../finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C index 1c328d3f47..20a045815c 100644 --- a/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C +++ b/src/finiteVolume/finiteVolume/ddtSchemes/EulerDdtScheme/EulerDdtScheme.C @@ -261,7 +261,7 @@ EulerDdtScheme::fvcDdt new GeometricField ( ddtIOobject, - rDeltaT.value()* + rDeltaT* ( alpha() *rho() From 83d935d517a90824da5d7952cadf7be430d77dbe Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Tue, 6 Feb 2018 11:48:15 +0000 Subject: [PATCH 08/23] ENH: error: exit with the given error number rather than 1 Resolves patch request https://bugs.openfoam.org/view.php?id=2827 --- src/OpenFOAM/db/error/error.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenFOAM/db/error/error.C b/src/OpenFOAM/db/error/error.C index 89e83c6223..6f618860d9 100644 --- a/src/OpenFOAM/db/error/error.C +++ b/src/OpenFOAM/db/error/error.C @@ -236,7 +236,7 @@ void Foam::error::exit(const int errNo) { Perr<< endl << *this << endl << "\nFOAM exiting\n" << endl; - ::exit(1); + ::exit(errNo); } } From 1513a049e06e4c7465c81d6f8958852614582354 Mon Sep 17 00:00:00 2001 From: mattijs Date: Thu, 10 May 2018 11:12:19 +0100 Subject: [PATCH 09/23] BUG: swirl: decide based on global properties. Fixes #824. --- ...lFlowRateInletVelocityFvPatchVectorField.C | 83 ++++++++++--------- 1 file changed, 44 insertions(+), 39 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C index ebe4ebdd58..89c1ce0008 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C @@ -75,7 +75,7 @@ swirlFlowRateInletVelocityFvPatchVectorField dict.lookupOrDefault ( "axis", - patch().size() + returnReduce(patch().size(), maxOp