diff --git a/src/dynamicMesh/Make/files b/src/dynamicMesh/Make/files index d87341be3e23180d22edb7b0099ca6721b3d8d45..4f5379232b79b394000d0ea90544989d017da3f6 100644 --- a/src/dynamicMesh/Make/files +++ b/src/dynamicMesh/Make/files @@ -109,19 +109,6 @@ motionSolvers/displacement/solidBody/solidBodyMotionSolver.C motionSolvers/displacement/solidBody/multiSolidBodyMotionSolver.C motionSolvers/displacement/codedPoints0/codedPoints0MotionSolver.C -solidBodyMotionFunctions = motionSolvers/displacement/solidBody/solidBodyMotionFunctions -$(solidBodyMotionFunctions)/solidBodyMotionFunction/solidBodyMotionFunction.C -$(solidBodyMotionFunctions)/solidBodyMotionFunction/solidBodyMotionFunctionNew.C -$(solidBodyMotionFunctions)/SDA/SDA.C -$(solidBodyMotionFunctions)/tabulated6DoFMotion/tabulated6DoFMotion.C -$(solidBodyMotionFunctions)/linearMotion/linearMotion.C -$(solidBodyMotionFunctions)/drivenLinearMotion/drivenLinearMotion.C -$(solidBodyMotionFunctions)/rotatingMotion/rotatingMotion.C -$(solidBodyMotionFunctions)/axisRotationMotion/axisRotationMotion.C -$(solidBodyMotionFunctions)/multiMotion/multiMotion.C -$(solidBodyMotionFunctions)/oscillatingLinearMotion/oscillatingLinearMotion.C -$(solidBodyMotionFunctions)/oscillatingRotatingMotion/oscillatingRotatingMotion.C - motionSolvers/displacement/solidBody/pointPatchFields/derived/solidBodyMotionDisplacement/solidBodyMotionDisplacementPointPatchVectorField.C createShellMesh/createShellMesh.C diff --git a/src/meshTools/Make/files b/src/meshTools/Make/files index 4a571b5fc28034d5f804073cc2099b7d1a5713a2..ad31ad0254d4e10d7149903c4a42526242d2d968 100644 --- a/src/meshTools/Make/files +++ b/src/meshTools/Make/files @@ -354,4 +354,18 @@ tetOverlapVolume/tetOverlapVolume.C triangulatedPatch/triangulatedPatch.C +solidBodyMotion = solidBodyMotionFunctions +$(solidBodyMotion)/solidBodyMotionFunction/solidBodyMotionFunction.C +$(solidBodyMotion)/solidBodyMotionFunction/solidBodyMotionFunctionNew.C +$(solidBodyMotion)/SDA/SDA.C +$(solidBodyMotion)/tabulated6DoFMotion/tabulated6DoFMotion.C +$(solidBodyMotion)/linearMotion/linearMotion.C +$(solidBodyMotion)/drivenLinearMotion/drivenLinearMotion.C +$(solidBodyMotion)/rotatingMotion/rotatingMotion.C +$(solidBodyMotion)/axisRotationMotion/axisRotationMotion.C +$(solidBodyMotion)/multiMotion/multiMotion.C +$(solidBodyMotion)/oscillatingLinearMotion/oscillatingLinearMotion.C +$(solidBodyMotion)/oscillatingRotatingMotion/oscillatingRotatingMotion.C + + LIB = $(FOAM_LIBBIN)/libmeshTools diff --git a/src/meshTools/Make/options b/src/meshTools/Make/options index 5b4f9ec84181988556c25393c12e10eb3e3b4531..9ee5884e5908ccdb6b1ba3acf323b8c524ec996a 100644 --- a/src/meshTools/Make/options +++ b/src/meshTools/Make/options @@ -1,7 +1,6 @@ EXE_INC = \ -I$(LIB_SRC)/fileFormats/lnInclude \ - -I$(LIB_SRC)/surfMesh/lnInclude \ - -I$(LIB_SRC)/dynamicMesh/lnInclude + -I$(LIB_SRC)/surfMesh/lnInclude LIB_LIBS = \ -lfileFormats \ diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/SDA/SDA.C b/src/meshTools/solidBodyMotionFunctions/SDA/SDA.C similarity index 100% rename from src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/SDA/SDA.C rename to src/meshTools/solidBodyMotionFunctions/SDA/SDA.C diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/SDA/SDA.H b/src/meshTools/solidBodyMotionFunctions/SDA/SDA.H similarity index 100% rename from src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/SDA/SDA.H rename to src/meshTools/solidBodyMotionFunctions/SDA/SDA.H diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/axisRotationMotion/axisRotationMotion.C b/src/meshTools/solidBodyMotionFunctions/axisRotationMotion/axisRotationMotion.C similarity index 100% rename from src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/axisRotationMotion/axisRotationMotion.C rename to src/meshTools/solidBodyMotionFunctions/axisRotationMotion/axisRotationMotion.C diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/axisRotationMotion/axisRotationMotion.H b/src/meshTools/solidBodyMotionFunctions/axisRotationMotion/axisRotationMotion.H similarity index 100% rename from src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/axisRotationMotion/axisRotationMotion.H rename to src/meshTools/solidBodyMotionFunctions/axisRotationMotion/axisRotationMotion.H diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/drivenLinearMotion/drivenLinearMotion.C b/src/meshTools/solidBodyMotionFunctions/drivenLinearMotion/drivenLinearMotion.C similarity index 100% rename from src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/drivenLinearMotion/drivenLinearMotion.C rename to src/meshTools/solidBodyMotionFunctions/drivenLinearMotion/drivenLinearMotion.C diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/drivenLinearMotion/drivenLinearMotion.H b/src/meshTools/solidBodyMotionFunctions/drivenLinearMotion/drivenLinearMotion.H similarity index 100% rename from src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/drivenLinearMotion/drivenLinearMotion.H rename to src/meshTools/solidBodyMotionFunctions/drivenLinearMotion/drivenLinearMotion.H diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/linearMotion/linearMotion.C b/src/meshTools/solidBodyMotionFunctions/linearMotion/linearMotion.C similarity index 100% rename from src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/linearMotion/linearMotion.C rename to src/meshTools/solidBodyMotionFunctions/linearMotion/linearMotion.C diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/linearMotion/linearMotion.H b/src/meshTools/solidBodyMotionFunctions/linearMotion/linearMotion.H similarity index 100% rename from src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/linearMotion/linearMotion.H rename to src/meshTools/solidBodyMotionFunctions/linearMotion/linearMotion.H diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/multiMotion/multiMotion.C b/src/meshTools/solidBodyMotionFunctions/multiMotion/multiMotion.C similarity index 100% rename from src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/multiMotion/multiMotion.C rename to src/meshTools/solidBodyMotionFunctions/multiMotion/multiMotion.C diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/multiMotion/multiMotion.H b/src/meshTools/solidBodyMotionFunctions/multiMotion/multiMotion.H similarity index 100% rename from src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/multiMotion/multiMotion.H rename to src/meshTools/solidBodyMotionFunctions/multiMotion/multiMotion.H diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/oscillatingLinearMotion/oscillatingLinearMotion.C b/src/meshTools/solidBodyMotionFunctions/oscillatingLinearMotion/oscillatingLinearMotion.C similarity index 100% rename from src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/oscillatingLinearMotion/oscillatingLinearMotion.C rename to src/meshTools/solidBodyMotionFunctions/oscillatingLinearMotion/oscillatingLinearMotion.C diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/oscillatingLinearMotion/oscillatingLinearMotion.H b/src/meshTools/solidBodyMotionFunctions/oscillatingLinearMotion/oscillatingLinearMotion.H similarity index 100% rename from src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/oscillatingLinearMotion/oscillatingLinearMotion.H rename to src/meshTools/solidBodyMotionFunctions/oscillatingLinearMotion/oscillatingLinearMotion.H diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/oscillatingRotatingMotion/oscillatingRotatingMotion.C b/src/meshTools/solidBodyMotionFunctions/oscillatingRotatingMotion/oscillatingRotatingMotion.C similarity index 100% rename from src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/oscillatingRotatingMotion/oscillatingRotatingMotion.C rename to src/meshTools/solidBodyMotionFunctions/oscillatingRotatingMotion/oscillatingRotatingMotion.C diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/oscillatingRotatingMotion/oscillatingRotatingMotion.H b/src/meshTools/solidBodyMotionFunctions/oscillatingRotatingMotion/oscillatingRotatingMotion.H similarity index 100% rename from src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/oscillatingRotatingMotion/oscillatingRotatingMotion.H rename to src/meshTools/solidBodyMotionFunctions/oscillatingRotatingMotion/oscillatingRotatingMotion.H diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.C b/src/meshTools/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.C similarity index 100% rename from src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.C rename to src/meshTools/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.C diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.H b/src/meshTools/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.H similarity index 100% rename from src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.H rename to src/meshTools/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.H diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.C b/src/meshTools/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.C similarity index 100% rename from src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.C rename to src/meshTools/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.C diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.H b/src/meshTools/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.H similarity index 81% rename from src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.H rename to src/meshTools/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.H index b6ad4c7a5b8a02892ed8cb0d499c9780e3a83859..7d98bbed5c3703334f46e5d442926190dde53af8 100644 --- a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.H +++ b/src/meshTools/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunction.H @@ -39,12 +39,12 @@ Description SourceFiles solidBodyMotionFunction.C - dynamicFvMeshNew.C + solidBodyMotionFunctionNew.C \*---------------------------------------------------------------------------*/ -#ifndef solidBodyMotionFunction_H -#define solidBodyMotionFunction_H +#ifndef Foam_solidBodyMotionFunction_H +#define Foam_solidBodyMotionFunction_H #include "Time.H" #include "dictionary.H" @@ -101,7 +101,7 @@ public: // Constructors - //- Construct from the SBMFCoeffs dictionary and Time + //- Construct from the coefficients dictionary and Time solidBodyMotionFunction ( const dictionary& SBMFCoeffs, @@ -114,10 +114,28 @@ public: // Selectors - //- Select constructed from the SBMFCoeffs dictionary and Time + //- Construct and dispatch motionType with dictionary and Time. + // Returns nullptr if motionType is empty static autoPtr<solidBodyMotionFunction> New ( - const dictionary& SBMFCoeffs, + const word& motionType, + const dictionary& dict, + const Time& runTime + ); + + //- Select "solidBodyMotionFunction" type from dictionary + //- and create with Time. + static autoPtr<solidBodyMotionFunction> New + ( + const dictionary& dict, + const Time& runTime + ); + + //- Select "solidBodyMotionFunction" type (if present) from dictionary + //- and create with Time. + static autoPtr<solidBodyMotionFunction> NewIfPresent + ( + const dictionary& dict, const Time& runTime ); diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C b/src/meshTools/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C similarity index 69% rename from src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C rename to src/meshTools/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C index 41f59990b36d1225979488e9decd9178a78530d7..b0d374ac8db1d35856a23036ca41c1b4f01fece6 100644 --- a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C +++ b/src/meshTools/solidBodyMotionFunctions/solidBodyMotionFunction/solidBodyMotionFunctionNew.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2019-2021 OpenCFD Ltd. + Copyright (C) 2019-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -30,15 +30,18 @@ License // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // -Foam::autoPtr<Foam::solidBodyMotionFunction> Foam::solidBodyMotionFunction::New +Foam::autoPtr<Foam::solidBodyMotionFunction> +Foam::solidBodyMotionFunction::New ( + const word& motionType, const dictionary& dict, const Time& runTime ) { - const word motionType(dict.get<word>("solidBodyMotionFunction")); - - Info<< "Selecting solid-body motion function " << motionType << endl; + if (motionType.empty()) + { + return nullptr; + } auto* ctorPtr = dictionaryConstructorTable(motionType); @@ -53,8 +56,45 @@ Foam::autoPtr<Foam::solidBodyMotionFunction> Foam::solidBodyMotionFunction::New ) << exit(FatalIOError); } + Info<< "Selecting solid-body motion function " << motionType << endl; + return autoPtr<solidBodyMotionFunction>(ctorPtr(dict, runTime)); } +Foam::autoPtr<Foam::solidBodyMotionFunction> +Foam::solidBodyMotionFunction::New +( + const dictionary& dict, + const Time& runTime +) +{ + return New + ( + dict.get<word>("solidBodyMotionFunction", keyType::LITERAL), + dict, + runTime + ); +} + + +Foam::autoPtr<Foam::solidBodyMotionFunction> +Foam::solidBodyMotionFunction::NewIfPresent +( + const dictionary& dict, + const Time& runTime +) +{ + word motionType; + dict.readIfPresent("solidBodyMotionFunction", motionType, keyType::LITERAL); + + if (motionType.empty()) + { + return nullptr; + } + + return New(motionType, dict, runTime); +} + + // ************************************************************************* // diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.C b/src/meshTools/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.C similarity index 100% rename from src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.C rename to src/meshTools/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.C diff --git a/src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.H b/src/meshTools/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.H similarity index 100% rename from src/dynamicMesh/motionSolvers/displacement/solidBody/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.H rename to src/meshTools/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.H diff --git a/src/meshTools/topoSet/cellSources/boundaryToCell/boundaryToCell.C b/src/meshTools/topoSet/cellSources/boundaryToCell/boundaryToCell.C index 2575d39c065a6c704b660d6864320c8a7ba94a95..b760079fb994a625430a6e3b508460055700e0b0 100644 --- a/src/meshTools/topoSet/cellSources/boundaryToCell/boundaryToCell.C +++ b/src/meshTools/topoSet/cellSources/boundaryToCell/boundaryToCell.C @@ -90,10 +90,10 @@ Foam::boundaryToCell::boundaryToCell(const polyMesh& mesh) Foam::boundaryToCell::boundaryToCell ( const polyMesh& mesh, - const dictionary& + const dictionary& dict ) : - topoSetCellSource(mesh) + topoSetCellSource(mesh, dict) {} diff --git a/src/meshTools/topoSet/cellSources/boxToCell/boxToCell.C b/src/meshTools/topoSet/cellSources/boxToCell/boxToCell.C index 6796fe2200b20c02e181b42b796fb8c41706fd6a..1b66a40cfed750140c370967f5cae07d89713ad7 100644 --- a/src/meshTools/topoSet/cellSources/boxToCell/boxToCell.C +++ b/src/meshTools/topoSet/cellSources/boxToCell/boxToCell.C @@ -92,7 +92,8 @@ static void readBoxDim(const dictionary& dict, treeBoundBox& bb) void Foam::boxToCell::combine(topoSet& set, const bool add) const { - const pointField& ctrs = mesh_.cellCentres(); + const tmp<pointField> tctrs(this->transform(mesh_.cellCentres())); + const pointField& ctrs = tctrs(); forAll(ctrs, elemi) { @@ -138,7 +139,7 @@ Foam::boxToCell::boxToCell const dictionary& dict ) : - topoSetCellSource(mesh), + topoSetCellSource(mesh, dict), bbs_() { // Accept 'boxes', 'box' or 'min/max' diff --git a/src/meshTools/topoSet/cellSources/cellToCell/cellToCell.C b/src/meshTools/topoSet/cellSources/cellToCell/cellToCell.C index a427b4dc210c417d74441bfb1783531058904633..e43ab9ee64072abc222800eb756dbf0de0b6b61e 100644 --- a/src/meshTools/topoSet/cellSources/cellToCell/cellToCell.C +++ b/src/meshTools/topoSet/cellSources/cellToCell/cellToCell.C @@ -70,7 +70,7 @@ Foam::cellToCell::cellToCell const dictionary& dict ) : - topoSetCellSource(mesh), + topoSetCellSource(mesh, dict), names_() { // Look for 'sets' or 'set' diff --git a/src/meshTools/topoSet/cellSources/clipPlaneToCell/clipPlaneToCell.C b/src/meshTools/topoSet/cellSources/clipPlaneToCell/clipPlaneToCell.C index 521ba39942c4f5f9f201cc8789003beea3572ef5..64d210dd997d1d1c22def884a404ae2382146ba5 100644 --- a/src/meshTools/topoSet/cellSources/clipPlaneToCell/clipPlaneToCell.C +++ b/src/meshTools/topoSet/cellSources/clipPlaneToCell/clipPlaneToCell.C @@ -69,7 +69,8 @@ void Foam::clipPlaneToCell::combine(topoSet& set, const bool add) const { // Cell centres above the plane - const pointField& ctrs = mesh_.cellCentres(); + const tmp<pointField> tctrs(this->transform(mesh_.cellCentres())); + const pointField& ctrs = tctrs(); forAll(ctrs, elemi) { @@ -102,12 +103,9 @@ Foam::clipPlaneToCell::clipPlaneToCell const dictionary& dict ) : - clipPlaneToCell - ( - mesh, - dict.get<vector>("point"), - dict.get<vector>("normal") - ) + topoSetCellSource(mesh, dict), + point_(dict.get<vector>("point")), + normal_(dict.get<vector>("normal")) {} diff --git a/src/meshTools/topoSet/cellSources/cylinderToCell/cylinderToCell.C b/src/meshTools/topoSet/cellSources/cylinderToCell/cylinderToCell.C index 3d2a6fb6870ca8bc01f0076c05560fb33b9ced44..ef53a72e770d43b19e4c8ff1ed7300e2037f3d0f 100644 --- a/src/meshTools/topoSet/cellSources/cylinderToCell/cylinderToCell.C +++ b/src/meshTools/topoSet/cellSources/cylinderToCell/cylinderToCell.C @@ -68,7 +68,8 @@ Foam::topoSetSource::addToUsageTable Foam::cylinderToCell::usage_ void Foam::cylinderToCell::combine(topoSet& set, const bool add) const { - const pointField& ctrs = mesh_.cellCentres(); + const tmp<pointField> tctrs(this->transform(mesh_.cellCentres())); + const pointField& ctrs = tctrs(); const vector axis = (point2_ - point1_); const scalar magAxis2 = magSqr(axis); @@ -127,12 +128,12 @@ Foam::cylinderToCell::cylinderToCell const dictionary& dict ) : - cylinderToCell + topoSetCellSource(mesh, dict), + point1_(dict.getCompat<point>("point1", {{"p1", -2112}})), + point2_(dict.getCompat<point>("point2", {{"p2", -2112}})), + radius_(dict.getCompat<scalar>("radius", {{"outerRadius", -2112}})), + innerRadius_ ( - mesh, - dict.getCompat<point>("point1", {{"p1", -2112}}), - dict.getCompat<point>("point2", {{"p2", -2112}}), - dict.getCompat<scalar>("radius", {{"outerRadius", -2112}}), dict.getCheckOrDefault<scalar>("innerRadius", 0, scalarMinMax::ge(0)) ) {} diff --git a/src/meshTools/topoSet/cellSources/faceToCell/faceToCell.C b/src/meshTools/topoSet/cellSources/faceToCell/faceToCell.C index 1fb53e60adbd66eb6133b1d6d9dc37d91976e239..ec52df9e2d4cf286cf70c38e5d6cf1685625ba8c 100644 --- a/src/meshTools/topoSet/cellSources/faceToCell/faceToCell.C +++ b/src/meshTools/topoSet/cellSources/faceToCell/faceToCell.C @@ -155,7 +155,7 @@ Foam::faceToCell::faceToCell const dictionary& dict ) : - topoSetCellSource(mesh), + topoSetCellSource(mesh, dict), names_(), option_(faceActionNames_.get("option", dict)) { diff --git a/src/meshTools/topoSet/cellSources/faceZoneToCell/faceZoneToCell.C b/src/meshTools/topoSet/cellSources/faceZoneToCell/faceZoneToCell.C index 3e31508d4cfa39e6d70ce9e01efe3518ae074a46..5132bffec77cabe23820f8bcff51dce3e2b7c492 100644 --- a/src/meshTools/topoSet/cellSources/faceZoneToCell/faceZoneToCell.C +++ b/src/meshTools/topoSet/cellSources/faceZoneToCell/faceZoneToCell.C @@ -214,7 +214,7 @@ Foam::faceZoneToCell::faceZoneToCell const dictionary& dict ) : - topoSetCellSource(mesh), + topoSetCellSource(mesh, dict), zoneMatcher_(), option_(faceActionNames_.get("option", dict)) { diff --git a/src/meshTools/topoSet/cellSources/fieldToCell/fieldToCell.C b/src/meshTools/topoSet/cellSources/fieldToCell/fieldToCell.C index f991f2f24b4ead3e7c0a18ff2f20a4c26203583e..6ce00a04843d1671b5299fb1d16e34ce6a95889c 100644 --- a/src/meshTools/topoSet/cellSources/fieldToCell/fieldToCell.C +++ b/src/meshTools/topoSet/cellSources/fieldToCell/fieldToCell.C @@ -148,13 +148,10 @@ Foam::fieldToCell::fieldToCell const dictionary& dict ) : - fieldToCell - ( - mesh, - dict.get<word>("field"), - dict.get<scalar>("min"), - dict.get<scalar>("max") - ) + topoSetCellSource(mesh, dict), + fieldName_(dict.get<word>("field")), + min_(dict.get<scalar>("min")), + max_(dict.get<scalar>("max")) {} diff --git a/src/meshTools/topoSet/cellSources/haloToCell/haloToCell.C b/src/meshTools/topoSet/cellSources/haloToCell/haloToCell.C index 0bce5d66b015d5bafaf86bc19f34fc2683b82421..9c08a2e3f24f04c9f14ac0052626c81c5a23de7e 100644 --- a/src/meshTools/topoSet/cellSources/haloToCell/haloToCell.C +++ b/src/meshTools/topoSet/cellSources/haloToCell/haloToCell.C @@ -198,7 +198,8 @@ Foam::haloToCell::haloToCell const dictionary& dict ) : - haloToCell(mesh, dict.getOrDefault<label>("steps", 1)) + topoSetCellSource(mesh, dict), + steps_(dict.getOrDefault<label>("steps", 1)) {} diff --git a/src/meshTools/topoSet/cellSources/labelToCell/labelToCell.C b/src/meshTools/topoSet/cellSources/labelToCell/labelToCell.C index 85e6a435e86e4a650be9031752a3e28c1492173b..0ce5f1253dd7eb4908f140ee360152deff18f6c7 100644 --- a/src/meshTools/topoSet/cellSources/labelToCell/labelToCell.C +++ b/src/meshTools/topoSet/cellSources/labelToCell/labelToCell.C @@ -94,7 +94,8 @@ Foam::labelToCell::labelToCell const dictionary& dict ) : - labelToCell(mesh, dict.get<labelList>("value")) + topoSetCellSource(mesh, dict), + labels_(dict.get<labelList>("value")) {} diff --git a/src/meshTools/topoSet/cellSources/nbrToCell/nbrToCell.C b/src/meshTools/topoSet/cellSources/nbrToCell/nbrToCell.C index 31b9d72fdb446ae03c1328c16fa7766d92a7da1f..0b6d34db8d8c3c21653b9d7ae20c085fc1eb314c 100644 --- a/src/meshTools/topoSet/cellSources/nbrToCell/nbrToCell.C +++ b/src/meshTools/topoSet/cellSources/nbrToCell/nbrToCell.C @@ -74,6 +74,7 @@ void Foam::nbrToCell::combine(topoSet& set, const bool add) const } const cellList& cells = mesh().cells(); + const polyBoundaryMesh& patches = mesh_.boundaryMesh(); boolList isCoupled(mesh_.nBoundaryFaces(), false); @@ -136,7 +137,8 @@ Foam::nbrToCell::nbrToCell const dictionary& dict ) : - nbrToCell(mesh, dict.getCheck<label>("neighbours", labelMinMax::ge(1))) + topoSetCellSource(mesh, dict), + minNbrs_(dict.getCheck<label>("neighbours", labelMinMax::ge(1))) {} diff --git a/src/meshTools/topoSet/cellSources/nearestToCell/nearestToCell.C b/src/meshTools/topoSet/cellSources/nearestToCell/nearestToCell.C index 5ee762e03909c77b145f307151adc08fb913f127..034d43fbd703dc012ccedcc23a57bf3c7ace8937 100644 --- a/src/meshTools/topoSet/cellSources/nearestToCell/nearestToCell.C +++ b/src/meshTools/topoSet/cellSources/nearestToCell/nearestToCell.C @@ -127,11 +127,8 @@ Foam::nearestToCell::nearestToCell const dictionary& dict ) : - nearestToCell - ( - mesh, - dict.get<pointField>("points") - ) + topoSetCellSource(mesh, dict), + points_(dict.get<pointField>("points")) {} diff --git a/src/meshTools/topoSet/cellSources/patchToCell/patchToCell.C b/src/meshTools/topoSet/cellSources/patchToCell/patchToCell.C index 39e5e54733c7e83351ab050bcb8ebcac5ef11b04..753dfd6e369d7d7286fbe2a635c9861f8d6507f4 100644 --- a/src/meshTools/topoSet/cellSources/patchToCell/patchToCell.C +++ b/src/meshTools/topoSet/cellSources/patchToCell/patchToCell.C @@ -125,7 +125,7 @@ Foam::patchToCell::patchToCell const dictionary& dict ) : - topoSetCellSource(mesh), + topoSetCellSource(mesh, dict), selectedPatches_() { // Look for 'patches' and 'patch', but accept 'name' as well diff --git a/src/meshTools/topoSet/cellSources/pointToCell/pointToCell.C b/src/meshTools/topoSet/cellSources/pointToCell/pointToCell.C index cc373c079065b6a327a5d50bc43c95eeba1060f3..17b26421bb9984a99d08163600e2167db207b6cc 100644 --- a/src/meshTools/topoSet/cellSources/pointToCell/pointToCell.C +++ b/src/meshTools/topoSet/cellSources/pointToCell/pointToCell.C @@ -135,7 +135,7 @@ Foam::pointToCell::pointToCell const dictionary& dict ) : - topoSetCellSource(mesh), + topoSetCellSource(mesh, dict), names_(), option_(pointActionNames_.get("option", dict)) { diff --git a/src/meshTools/topoSet/cellSources/regionToCell/regionToCell.C b/src/meshTools/topoSet/cellSources/regionToCell/regionToCell.C index 0089668c738eaa70c28a1acd8b0fe35a8003635c..c83ec7ec74e2b4124768d90976e7a44c5350014d 100644 --- a/src/meshTools/topoSet/cellSources/regionToCell/regionToCell.C +++ b/src/meshTools/topoSet/cellSources/regionToCell/regionToCell.C @@ -403,7 +403,7 @@ Foam::regionToCell::regionToCell const dictionary& dict ) : - topoSetCellSource(mesh), + topoSetCellSource(mesh, dict), setName_(dict.getOrDefault<word>("set", "none")), insidePoints_ ( diff --git a/src/meshTools/topoSet/cellSources/rotatedBoxToCell/rotatedBoxToCell.C b/src/meshTools/topoSet/cellSources/rotatedBoxToCell/rotatedBoxToCell.C index e422dfa6063854cf268ceb5ad5be0d29c0075675..fda69b76622a6ac150537684583bfe80bee48c5b 100644 --- a/src/meshTools/topoSet/cellSources/rotatedBoxToCell/rotatedBoxToCell.C +++ b/src/meshTools/topoSet/cellSources/rotatedBoxToCell/rotatedBoxToCell.C @@ -96,7 +96,8 @@ void Foam::rotatedBoxToCell::combine(topoSet& set, const bool add) const // Check whether cell centre is inside all faces of box. - const pointField& ctrs = mesh_.cellCentres(); + const tmp<pointField> tctrs(this->transform(mesh_.cellCentres())); + const pointField& ctrs = tctrs(); forAll(ctrs, celli) { @@ -146,14 +147,11 @@ Foam::rotatedBoxToCell::rotatedBoxToCell const dictionary& dict ) : - rotatedBoxToCell - ( - mesh, - dict.get<point>("origin"), - dict.get<vector>("i"), - dict.get<vector>("j"), - dict.get<vector>("k") - ) + topoSetCellSource(mesh, dict), + origin_(dict.get<point>("origin")), + i_(dict.get<vector>("i")), + j_(dict.get<vector>("j")), + k_(dict.get<vector>("k")) {} diff --git a/src/meshTools/topoSet/cellSources/searchableSurfaceToCell/searchableSurfaceToCell.C b/src/meshTools/topoSet/cellSources/searchableSurfaceToCell/searchableSurfaceToCell.C index 657ccad736aaf551739366b00674b05220251f2b..331254810fece7761da29a947b64dde0b255e394 100644 --- a/src/meshTools/topoSet/cellSources/searchableSurfaceToCell/searchableSurfaceToCell.C +++ b/src/meshTools/topoSet/cellSources/searchableSurfaceToCell/searchableSurfaceToCell.C @@ -102,9 +102,13 @@ void Foam::searchableSurfaceToCell::combine(topoSet& set, const bool add) const { return; } - const pointField& ctrs = mesh_.cellCentres(); + + const tmp<pointField> tctrs(this->transform(mesh_.cellCentres())); + const pointField& ctrs = tctrs(); + const searchableSurface& s = *surf_; + // Cell centres within the enclosing volumes List<volumeType> volTypes; @@ -130,7 +134,7 @@ Foam::searchableSurfaceToCell::searchableSurfaceToCell const dictionary& dict ) : - topoSetCellSource(mesh), + topoSetCellSource(mesh, dict), surf_ ( searchableSurface::New diff --git a/src/meshTools/topoSet/cellSources/shapeToCell/shapeToCell.C b/src/meshTools/topoSet/cellSources/shapeToCell/shapeToCell.C index c9fba49e035b82ea57ba67cf52ca332f1c5a5258..e36ef939babddb1830eef601ba4b465f3bdc62b3 100644 --- a/src/meshTools/topoSet/cellSources/shapeToCell/shapeToCell.C +++ b/src/meshTools/topoSet/cellSources/shapeToCell/shapeToCell.C @@ -116,7 +116,8 @@ Foam::shapeToCell::shapeToCell const dictionary& dict ) : - shapeToCell(mesh, dict.getCompat<word>("shape", {{"type", 1806}})) + topoSetCellSource(mesh, dict), + shape_(dict.getCompat<word>("shape", {{"type", 1806}})) {} diff --git a/src/meshTools/topoSet/cellSources/sphereToCell/sphereToCell.C b/src/meshTools/topoSet/cellSources/sphereToCell/sphereToCell.C index f4b7012d71f3cf357ee540d8774ced090367987d..abbc2d1a2e7bdbb1b7cc7a718b965f0622702c3e 100644 --- a/src/meshTools/topoSet/cellSources/sphereToCell/sphereToCell.C +++ b/src/meshTools/topoSet/cellSources/sphereToCell/sphereToCell.C @@ -68,7 +68,8 @@ Foam::topoSetSource::addToUsageTable Foam::sphereToCell::usage_ void Foam::sphereToCell::combine(topoSet& set, const bool add) const { - const pointField& ctrs = mesh_.cellCentres(); + const tmp<pointField> tctrs(this->transform(mesh_.cellCentres())); + const pointField& ctrs = tctrs(); const scalar orad2 = sqr(radius_); const scalar irad2 = innerRadius_ > 0 ? sqr(innerRadius_) : -1; @@ -110,11 +111,11 @@ Foam::sphereToCell::sphereToCell const dictionary& dict ) : - sphereToCell + topoSetCellSource(mesh, dict), + origin_(dict.getCompat<vector>("origin", {{"centre", -1806}})), + radius_(dict.getCheck<scalar>("radius", scalarMinMax::ge(0))), + innerRadius_ ( - mesh, - dict.getCompat<vector>("origin", {{"centre", -1806}}), - dict.getCheck<scalar>("radius", scalarMinMax::ge(0)), dict.getCheckOrDefault<scalar>("innerRadius", 0, scalarMinMax::ge(0)) ) {} diff --git a/src/meshTools/topoSet/cellSources/surfaceToCell/surfaceToCell.C b/src/meshTools/topoSet/cellSources/surfaceToCell/surfaceToCell.C index cec0c476d1e3eff57e9134021b8c2ddb3f149539..af18f129c3c4006adc29bc70234917f1f528422d 100644 --- a/src/meshTools/topoSet/cellSources/surfaceToCell/surfaceToCell.C +++ b/src/meshTools/topoSet/cellSources/surfaceToCell/surfaceToCell.C @@ -434,7 +434,7 @@ Foam::surfaceToCell::surfaceToCell const dictionary& dict ) : - topoSetCellSource(mesh), + topoSetCellSource(mesh, dict), surfName_(dict.get<fileName>("file").expand()), outsidePoints_(dict.get<pointField>("outsidePoints")), includeCut_(dict.get<bool>("includeCut")), diff --git a/src/meshTools/topoSet/cellSources/targetVolumeToCell/targetVolumeToCell.C b/src/meshTools/topoSet/cellSources/targetVolumeToCell/targetVolumeToCell.C index e222c5d481790cf5b544c52c60573866c293716b..81f0710165efe746dcbafc2c4e445dea8f70040c 100644 --- a/src/meshTools/topoSet/cellSources/targetVolumeToCell/targetVolumeToCell.C +++ b/src/meshTools/topoSet/cellSources/targetVolumeToCell/targetVolumeToCell.C @@ -301,13 +301,10 @@ Foam::targetVolumeToCell::targetVolumeToCell const dictionary& dict ) : - targetVolumeToCell - ( - mesh, - dict.getCheck<scalar>("volume", scalarMinMax::ge(0)), - dict.get<vector>("normal"), - dict.getOrDefault<word>("set", "") - ) + topoSetCellSource(mesh, dict), + vol_(dict.getCheck<scalar>("volume", scalarMinMax::ge(0))), + normal_(dict.get<vector>("normal")), + maskSetName_(dict.getOrDefault<word>("set", "")) {} diff --git a/src/meshTools/topoSet/cellSources/zoneToCell/zoneToCell.C b/src/meshTools/topoSet/cellSources/zoneToCell/zoneToCell.C index 37777f051306cc7264cd1d6b94c122fdd9cf2251..774a8929e5742115f9c174472e3f975a0563528c 100644 --- a/src/meshTools/topoSet/cellSources/zoneToCell/zoneToCell.C +++ b/src/meshTools/topoSet/cellSources/zoneToCell/zoneToCell.C @@ -181,7 +181,7 @@ Foam::zoneToCell::zoneToCell const dictionary& dict ) : - topoSetCellSource(mesh), + topoSetCellSource(mesh, dict), zoneMatcher_() { // Look for 'zones' and 'zone', but accept 'name' as well diff --git a/src/meshTools/topoSet/cellZoneSources/setToCellZone/setToCellZone.C b/src/meshTools/topoSet/cellZoneSources/setToCellZone/setToCellZone.C index 9cd63b354813a0e526cc71e8756de5896d3cb02f..d0e4d3f3025c5038bbf1690b416bfea868dd2f65 100644 --- a/src/meshTools/topoSet/cellZoneSources/setToCellZone/setToCellZone.C +++ b/src/meshTools/topoSet/cellZoneSources/setToCellZone/setToCellZone.C @@ -71,7 +71,7 @@ Foam::setToCellZone::setToCellZone const dictionary& dict ) : - topoSetCellZoneSource(mesh), + topoSetCellZoneSource(mesh, dict), setName_(dict.get<word>("set")) {} diff --git a/src/meshTools/topoSet/faceSources/boundaryToFace/boundaryToFace.C b/src/meshTools/topoSet/faceSources/boundaryToFace/boundaryToFace.C index 5badb76d4f8d8d3360c1c14f56e9e80c7795d0b8..cb80cbc90e30016707d0804bf496e8e33f7401ab 100644 --- a/src/meshTools/topoSet/faceSources/boundaryToFace/boundaryToFace.C +++ b/src/meshTools/topoSet/faceSources/boundaryToFace/boundaryToFace.C @@ -91,10 +91,10 @@ Foam::boundaryToFace::boundaryToFace(const polyMesh& mesh) Foam::boundaryToFace::boundaryToFace ( const polyMesh& mesh, - const dictionary& + const dictionary& dict ) : - topoSetFaceSource(mesh) + topoSetFaceSource(mesh, dict) {} diff --git a/src/meshTools/topoSet/faceSources/boxToFace/boxToFace.C b/src/meshTools/topoSet/faceSources/boxToFace/boxToFace.C index b277a6e90c16428c48d8017b9b6a028bbe536567..9f5e75829304b603b4b2a451747a50221f9d4f77 100644 --- a/src/meshTools/topoSet/faceSources/boxToFace/boxToFace.C +++ b/src/meshTools/topoSet/faceSources/boxToFace/boxToFace.C @@ -92,7 +92,8 @@ static void readBoxDim(const dictionary& dict, treeBoundBox& bb) void Foam::boxToFace::combine(topoSet& set, const bool add) const { - const pointField& ctrs = mesh_.faceCentres(); + const tmp<pointField> tctrs(this->transform(mesh_.faceCentres())); + const pointField& ctrs = tctrs(); forAll(ctrs, elemi) { @@ -138,7 +139,7 @@ Foam::boxToFace::boxToFace const dictionary& dict ) : - topoSetFaceSource(mesh), + topoSetFaceSource(mesh, dict), bbs_() { // Accept 'boxes', 'box' or 'min/max' diff --git a/src/meshTools/topoSet/faceSources/cellToFace/cellToFace.C b/src/meshTools/topoSet/faceSources/cellToFace/cellToFace.C index b66de8c2d6655faaaf893e3fc79a00f2e35b3d7e..7c4a4c4be33e848e32980be9ae3d9f11863e5342 100644 --- a/src/meshTools/topoSet/faceSources/cellToFace/cellToFace.C +++ b/src/meshTools/topoSet/faceSources/cellToFace/cellToFace.C @@ -233,7 +233,7 @@ Foam::cellToFace::cellToFace const dictionary& dict ) : - topoSetFaceSource(mesh), + topoSetFaceSource(mesh, dict), names_(), option_(cellActionNames_.get("option", dict)) { diff --git a/src/meshTools/topoSet/faceSources/clipPlaneToFace/clipPlaneToFace.C b/src/meshTools/topoSet/faceSources/clipPlaneToFace/clipPlaneToFace.C index 004a4d859a2626c96d74857ee52cf8ba3718ae41..64a8f83ff2812ff24bcbf0c8c15237985ee1e885 100644 --- a/src/meshTools/topoSet/faceSources/clipPlaneToFace/clipPlaneToFace.C +++ b/src/meshTools/topoSet/faceSources/clipPlaneToFace/clipPlaneToFace.C @@ -69,7 +69,8 @@ void Foam::clipPlaneToFace::combine(topoSet& set, const bool add) const { // Face centres above the plane - const pointField& ctrs = mesh_.faceCentres(); + const tmp<pointField> tctrs(this->transform(mesh_.faceCentres())); + const pointField& ctrs = tctrs(); forAll(ctrs, elemi) { @@ -102,12 +103,9 @@ Foam::clipPlaneToFace::clipPlaneToFace const dictionary& dict ) : - clipPlaneToFace - ( - mesh, - dict.get<vector>("point"), - dict.get<vector>("normal") - ) + topoSetFaceSource(mesh, dict), + point_(dict.get<vector>("point")), + normal_(dict.get<vector>("normal")) {} diff --git a/src/meshTools/topoSet/faceSources/cylinderToFace/cylinderToFace.C b/src/meshTools/topoSet/faceSources/cylinderToFace/cylinderToFace.C index 48100d38036020a7830d434e731b7a3cb8b251f5..c3710f3d086513a8782bf0ad969209d07a400665 100644 --- a/src/meshTools/topoSet/faceSources/cylinderToFace/cylinderToFace.C +++ b/src/meshTools/topoSet/faceSources/cylinderToFace/cylinderToFace.C @@ -68,7 +68,8 @@ Foam::topoSetSource::addToUsageTable Foam::cylinderToFace::usage_ void Foam::cylinderToFace::combine(topoSet& set, const bool add) const { - const pointField& ctrs = mesh_.faceCentres(); + const tmp<pointField> tctrs(this->transform(mesh_.faceCentres())); + const pointField& ctrs = tctrs(); const vector axis = (point2_ - point1_); const scalar magAxis2 = magSqr(axis); @@ -127,12 +128,12 @@ Foam::cylinderToFace::cylinderToFace const dictionary& dict ) : - cylinderToFace + topoSetFaceSource(mesh, dict), + point1_(dict.getCompat<point>("point1", {{"p1", -2112}})), + point2_(dict.getCompat<point>("point2", {{"p2", -2112}})), + radius_(dict.getCompat<scalar>("radius", {{"outerRadius", -2112}})), + innerRadius_ ( - mesh, - dict.getCompat<point>("point1", {{"p1", -2112}}), - dict.getCompat<point>("point2", {{"p2", -2112}}), - dict.getCompat<scalar>("radius", {{"outerRadius", -2112}}), dict.getCheckOrDefault<scalar>("innerRadius", 0, scalarMinMax::ge(0)) ) {} diff --git a/src/meshTools/topoSet/faceSources/faceToFace/faceToFace.C b/src/meshTools/topoSet/faceSources/faceToFace/faceToFace.C index 4abc17fac603ff80f8999cce31643dc620aa0411..8fbcf20838c9ff05172d549ea7d61bc4b5d53136 100644 --- a/src/meshTools/topoSet/faceSources/faceToFace/faceToFace.C +++ b/src/meshTools/topoSet/faceSources/faceToFace/faceToFace.C @@ -70,7 +70,7 @@ Foam::faceToFace::faceToFace const dictionary& dict ) : - topoSetFaceSource(mesh), + topoSetFaceSource(mesh, dict), names_() { // Look for 'sets' or 'set' diff --git a/src/meshTools/topoSet/faceSources/holeToFace/holeToFace.C b/src/meshTools/topoSet/faceSources/holeToFace/holeToFace.C index 8ec3dac42c1938d0f378c9e69811d716bb01ca9a..3816a19a6dfa8e92fbfdaf9154bb40ae01334591 100644 --- a/src/meshTools/topoSet/faceSources/holeToFace/holeToFace.C +++ b/src/meshTools/topoSet/faceSources/holeToFace/holeToFace.C @@ -1095,7 +1095,7 @@ Foam::holeToFace::holeToFace const dictionary& dict ) : - topoSetFaceSource(mesh), + topoSetFaceSource(mesh, dict), zonePoints_(dict.get<List<pointField>>("points")), blockedFaceNames_(), blockedCellNames_(), diff --git a/src/meshTools/topoSet/faceSources/labelToFace/labelToFace.C b/src/meshTools/topoSet/faceSources/labelToFace/labelToFace.C index 148b225d6c8e58eaad672a03b651d12155d4d31d..dee5b38b17a0c22eea93a813203d1ca18d107820 100644 --- a/src/meshTools/topoSet/faceSources/labelToFace/labelToFace.C +++ b/src/meshTools/topoSet/faceSources/labelToFace/labelToFace.C @@ -94,11 +94,8 @@ Foam::labelToFace::labelToFace const dictionary& dict ) : - labelToFace - ( - mesh, - dict.get<labelList>("value") - ) + topoSetFaceSource(mesh, dict), + labels_(dict.get<labelList>("value")) {} diff --git a/src/meshTools/topoSet/faceSources/normalToFace/normalToFace.C b/src/meshTools/topoSet/faceSources/normalToFace/normalToFace.C index b376426f9a3ca9c9c44ec71d052cc3f547ae5c53..077b981e02b813dd90697b0d70c9edeef2fe1457 100644 --- a/src/meshTools/topoSet/faceSources/normalToFace/normalToFace.C +++ b/src/meshTools/topoSet/faceSources/normalToFace/normalToFace.C @@ -100,12 +100,9 @@ Foam::normalToFace::normalToFace Foam::normalToFace::normalToFace(const polyMesh& mesh, const dictionary& dict) : - normalToFace - ( - mesh, - dict.get<vector>("normal"), - dict.get<scalar>("cos") - ) + topoSetFaceSource(mesh, dict), + normal_(dict.get<vector>("normal")), + tol_(dict.get<scalar>("cos")) { setNormal(); } diff --git a/src/meshTools/topoSet/faceSources/patchToFace/patchToFace.C b/src/meshTools/topoSet/faceSources/patchToFace/patchToFace.C index 8fe00702f55344591b02e026b50f012ddf8f4fa3..a52e9168eaae1816d659709304362f1db7a8741c 100644 --- a/src/meshTools/topoSet/faceSources/patchToFace/patchToFace.C +++ b/src/meshTools/topoSet/faceSources/patchToFace/patchToFace.C @@ -121,7 +121,7 @@ Foam::patchToFace::patchToFace const dictionary& dict ) : - topoSetFaceSource(mesh), + topoSetFaceSource(mesh, dict), selectedPatches_() { // Look for 'patches' and 'patch', but accept 'name' as well diff --git a/src/meshTools/topoSet/faceSources/pointToFace/pointToFace.C b/src/meshTools/topoSet/faceSources/pointToFace/pointToFace.C index cf0b8f5a14ca35ce8f8504697140e7bbac4f430a..9633b6b424846f8c06ee7bfe17cf4cfb2f2652a5 100644 --- a/src/meshTools/topoSet/faceSources/pointToFace/pointToFace.C +++ b/src/meshTools/topoSet/faceSources/pointToFace/pointToFace.C @@ -181,7 +181,7 @@ Foam::pointToFace::pointToFace const dictionary& dict ) : - topoSetFaceSource(mesh), + topoSetFaceSource(mesh, dict), names_(), option_(pointActionNames_.get("option", dict)) { diff --git a/src/meshTools/topoSet/faceSources/regionToFace/regionToFace.C b/src/meshTools/topoSet/faceSources/regionToFace/regionToFace.C index 53aae6f23efb99687b7178d5e85f128a63a349c7..8bb3e8815ff3864d4191e8eae22253b7fb44592d 100644 --- a/src/meshTools/topoSet/faceSources/regionToFace/regionToFace.C +++ b/src/meshTools/topoSet/faceSources/regionToFace/regionToFace.C @@ -227,7 +227,7 @@ Foam::regionToFace::regionToFace const dictionary& dict ) : - topoSetFaceSource(mesh), + topoSetFaceSource(mesh, dict), setName_(dict.get<word>("set")), nearPoint_(dict.get<point>("nearPoint")) {} diff --git a/src/meshTools/topoSet/faceSources/searchableSurfaceToFace/searchableSurfaceToFace.C b/src/meshTools/topoSet/faceSources/searchableSurfaceToFace/searchableSurfaceToFace.C index 2299b79483b7b5da772071238e9bfecf7e412a73..2a0f54c234b8ed08b5afbe646283ff2b27ff1e51 100644 --- a/src/meshTools/topoSet/faceSources/searchableSurfaceToFace/searchableSurfaceToFace.C +++ b/src/meshTools/topoSet/faceSources/searchableSurfaceToFace/searchableSurfaceToFace.C @@ -102,7 +102,9 @@ void Foam::searchableSurfaceToFace::combine(topoSet& set, const bool add) const { return; } - const pointField& ctrs = mesh_.faceCentres(); + const tmp<pointField> tctrs(this->transform(mesh_.faceCentres())); + const pointField& ctrs = tctrs(); + const searchableSurface& s = *surf_; // Face centres within the enclosing volumes @@ -130,7 +132,7 @@ Foam::searchableSurfaceToFace::searchableSurfaceToFace const dictionary& dict ) : - topoSetFaceSource(mesh), + topoSetFaceSource(mesh, dict), surf_ ( searchableSurface::New diff --git a/src/meshTools/topoSet/faceSources/sphereToFace/sphereToFace.C b/src/meshTools/topoSet/faceSources/sphereToFace/sphereToFace.C index f7b0079c089464745bf75d0435930514bbae2e6f..51ef63778def515902d9d1ad8b9d6df728f2ce11 100644 --- a/src/meshTools/topoSet/faceSources/sphereToFace/sphereToFace.C +++ b/src/meshTools/topoSet/faceSources/sphereToFace/sphereToFace.C @@ -67,7 +67,8 @@ Foam::topoSetSource::addToUsageTable Foam::sphereToFace::usage_ void Foam::sphereToFace::combine(topoSet& set, const bool add) const { - const pointField& ctrs = mesh_.faceCentres(); + const tmp<pointField> tctrs(this->transform(mesh_.faceCentres())); + const pointField& ctrs = tctrs(); const scalar orad2 = sqr(radius_); const scalar irad2 = innerRadius_ > 0 ? sqr(innerRadius_) : -1; @@ -109,11 +110,11 @@ Foam::sphereToFace::sphereToFace const dictionary& dict ) : - sphereToFace + topoSetFaceSource(mesh, dict), + origin_(dict.getCompat<vector>("origin", {{"centre", -1806}})), + radius_(dict.getCheck<scalar>("radius", scalarMinMax::ge(0))), + innerRadius_ ( - mesh, - dict.getCompat<vector>("origin", {{"centre", -1806}}), - dict.getCheck<scalar>("radius", scalarMinMax::ge(0)), dict.getCheckOrDefault<scalar>("innerRadius", 0, scalarMinMax::ge(0)) ) {} diff --git a/src/meshTools/topoSet/faceSources/zoneToFace/zoneToFace.C b/src/meshTools/topoSet/faceSources/zoneToFace/zoneToFace.C index 3ce8d9d7afe40cb639046de77d3ecce974ae8ac7..a4c7ee20499799f5703f648a1e82815fe7c9a27b 100644 --- a/src/meshTools/topoSet/faceSources/zoneToFace/zoneToFace.C +++ b/src/meshTools/topoSet/faceSources/zoneToFace/zoneToFace.C @@ -183,7 +183,7 @@ Foam::zoneToFace::zoneToFace const dictionary& dict ) : - topoSetFaceSource(mesh), + topoSetFaceSource(mesh, dict), zoneMatcher_() { // Look for 'zones' and 'zone', but accept 'name' as well diff --git a/src/meshTools/topoSet/faceZoneSources/cellToFaceZone/cellToFaceZone.C b/src/meshTools/topoSet/faceZoneSources/cellToFaceZone/cellToFaceZone.C index cf2680c76f0056852181cc6a9927e5b8a72097fe..ed0586fba1d90c4750c104f5fb1cafdc925ae861 100644 --- a/src/meshTools/topoSet/faceZoneSources/cellToFaceZone/cellToFaceZone.C +++ b/src/meshTools/topoSet/faceZoneSources/cellToFaceZone/cellToFaceZone.C @@ -160,7 +160,7 @@ Foam::cellToFaceZone::cellToFaceZone const dictionary& dict ) : - topoSetFaceZoneSource(mesh), + topoSetFaceZoneSource(mesh, dict), names_(), flip_(dict.getOrDefault("flip", false)) { diff --git a/src/meshTools/topoSet/faceZoneSources/faceZoneToFaceZone/faceZoneToFaceZone.C b/src/meshTools/topoSet/faceZoneSources/faceZoneToFaceZone/faceZoneToFaceZone.C index b2d44b12d6704f1666051e2df882cc973b49fac7..4e0f039624a17f1ab44a79fee4bbae71dc97787b 100644 --- a/src/meshTools/topoSet/faceZoneSources/faceZoneToFaceZone/faceZoneToFaceZone.C +++ b/src/meshTools/topoSet/faceZoneSources/faceZoneToFaceZone/faceZoneToFaceZone.C @@ -81,7 +81,7 @@ Foam::faceZoneToFaceZone::faceZoneToFaceZone const dictionary& dict ) : - topoSetFaceZoneSource(mesh), + topoSetFaceZoneSource(mesh, dict), setName_(dict.get<word>("zone")) {} diff --git a/src/meshTools/topoSet/faceZoneSources/planeToFaceZone/planeToFaceZone.C b/src/meshTools/topoSet/faceZoneSources/planeToFaceZone/planeToFaceZone.C index c7cdff5f780793a8185fd900e2d643eca11c4224..273cbfd8acc5bc6c9cda3fd71e77209440d5f7ad 100644 --- a/src/meshTools/topoSet/faceZoneSources/planeToFaceZone/planeToFaceZone.C +++ b/src/meshTools/topoSet/faceZoneSources/planeToFaceZone/planeToFaceZone.C @@ -388,13 +388,10 @@ Foam::planeToFaceZone::planeToFaceZone const dictionary& dict ) : - planeToFaceZone - ( - mesh, - dict.get<vector>("point"), - dict.get<vector>("normal"), - faceActionNames_.getOrDefault("option", dict, faceAction::ALL) - ) + topoSetFaceZoneSource(mesh, dict), + point_(dict.get<vector>("point")), + normal_(dict.get<vector>("normal")), + option_(faceActionNames_.getOrDefault("option", dict, faceAction::ALL)) {} diff --git a/src/meshTools/topoSet/faceZoneSources/searchableSurfaceToFaceZone/searchableSurfaceToFaceZone.C b/src/meshTools/topoSet/faceZoneSources/searchableSurfaceToFaceZone/searchableSurfaceToFaceZone.C index 170ecd7206b56ae9db8ed0a5f0f17d23dee7bac1..0c3c0c4532bff80d058ee14f0ce3d5309df0038f 100644 --- a/src/meshTools/topoSet/faceZoneSources/searchableSurfaceToFaceZone/searchableSurfaceToFaceZone.C +++ b/src/meshTools/topoSet/faceZoneSources/searchableSurfaceToFaceZone/searchableSurfaceToFaceZone.C @@ -109,7 +109,7 @@ Foam::searchableSurfaceToFaceZone::searchableSurfaceToFaceZone const dictionary& dict ) : - topoSetFaceZoneSource(mesh), + topoSetFaceZoneSource(mesh, dict), surfacePtr_ ( searchableSurface::New diff --git a/src/meshTools/topoSet/faceZoneSources/setAndNormalToFaceZone/setAndNormalToFaceZone.C b/src/meshTools/topoSet/faceZoneSources/setAndNormalToFaceZone/setAndNormalToFaceZone.C index b0eeb21b338627acd9dd7e4ec0d88f61d45b52a4..21e51ff5cc986338b2ce5ba409a802accb9651ea 100644 --- a/src/meshTools/topoSet/faceZoneSources/setAndNormalToFaceZone/setAndNormalToFaceZone.C +++ b/src/meshTools/topoSet/faceZoneSources/setAndNormalToFaceZone/setAndNormalToFaceZone.C @@ -83,7 +83,7 @@ Foam::setAndNormalToFaceZone::setAndNormalToFaceZone const dictionary& dict ) : - topoSetFaceZoneSource(mesh), + topoSetFaceZoneSource(mesh, dict), setName_(dict.get<word>("faceSet")), normal_(dict.get<vector>("normal")) {} diff --git a/src/meshTools/topoSet/faceZoneSources/setToFaceZone/setToFaceZone.C b/src/meshTools/topoSet/faceZoneSources/setToFaceZone/setToFaceZone.C index a460bfb649df63a80658cb05cb3196c8221ef0c5..7e47c0598e10ff1194c635f46d7f80e6e5dfc704 100644 --- a/src/meshTools/topoSet/faceZoneSources/setToFaceZone/setToFaceZone.C +++ b/src/meshTools/topoSet/faceZoneSources/setToFaceZone/setToFaceZone.C @@ -72,7 +72,7 @@ Foam::setToFaceZone::setToFaceZone const dictionary& dict ) : - topoSetFaceZoneSource(mesh), + topoSetFaceZoneSource(mesh, dict), setName_(dict.get<word>("faceSet")) { if (dict.found("cellSet")) diff --git a/src/meshTools/topoSet/faceZoneSources/setsToFaceZone/setsToFaceZone.C b/src/meshTools/topoSet/faceZoneSources/setsToFaceZone/setsToFaceZone.C index 642cf82bca87d430819136afd125496bc7b716bd..ecbbb7f469b50c605105d506ef39a95036cd74d5 100644 --- a/src/meshTools/topoSet/faceZoneSources/setsToFaceZone/setsToFaceZone.C +++ b/src/meshTools/topoSet/faceZoneSources/setsToFaceZone/setsToFaceZone.C @@ -77,7 +77,7 @@ Foam::setsToFaceZone::setsToFaceZone const dictionary& dict ) : - topoSetFaceZoneSource(mesh), + topoSetFaceZoneSource(mesh, dict), faceSetName_(dict.get<word>("faceSet")), cellSetName_(dict.get<word>("cellSet")), flip_(dict.getOrDefault("flip", false)) diff --git a/src/meshTools/topoSet/pointSources/boxToPoint/boxToPoint.C b/src/meshTools/topoSet/pointSources/boxToPoint/boxToPoint.C index b7fe126f18fce8a969589789e4ff57d9ce09637d..d2c6237d6f5e6d25ed713f3216934257e16c0839 100644 --- a/src/meshTools/topoSet/pointSources/boxToPoint/boxToPoint.C +++ b/src/meshTools/topoSet/pointSources/boxToPoint/boxToPoint.C @@ -92,7 +92,8 @@ static void readBoxDim(const dictionary& dict, treeBoundBox& bb) void Foam::boxToPoint::combine(topoSet& set, const bool add) const { - const pointField& ctrs = mesh_.points(); + const tmp<pointField> tctrs(this->transform(mesh_.points())); + const pointField& ctrs = tctrs(); forAll(ctrs, elemi) { @@ -138,7 +139,7 @@ Foam::boxToPoint::boxToPoint const dictionary& dict ) : - topoSetPointSource(mesh), + topoSetPointSource(mesh, dict), bbs_() { // Accept 'boxes', 'box' or 'min/max' diff --git a/src/meshTools/topoSet/pointSources/cellToPoint/cellToPoint.C b/src/meshTools/topoSet/pointSources/cellToPoint/cellToPoint.C index 39cccb0cdc37acc6b6b60900426639c31515dd13..4cf1f0b7f003acee4827bac95d180b1a86202ec6 100644 --- a/src/meshTools/topoSet/pointSources/cellToPoint/cellToPoint.C +++ b/src/meshTools/topoSet/pointSources/cellToPoint/cellToPoint.C @@ -109,7 +109,7 @@ Foam::cellToPoint::cellToPoint const dictionary& dict ) : - topoSetPointSource(mesh), + topoSetPointSource(mesh, dict), names_(), option_(cellActionNames_.get("option", dict)) { diff --git a/src/meshTools/topoSet/pointSources/clipPlaneToPoint/clipPlaneToPoint.C b/src/meshTools/topoSet/pointSources/clipPlaneToPoint/clipPlaneToPoint.C index 336983da349c9cd37370be6cf0d43b1ca056f004..c2e26b4fddfbc0c5b992bdc359604419a7334bcb 100644 --- a/src/meshTools/topoSet/pointSources/clipPlaneToPoint/clipPlaneToPoint.C +++ b/src/meshTools/topoSet/pointSources/clipPlaneToPoint/clipPlaneToPoint.C @@ -69,7 +69,8 @@ void Foam::clipPlaneToPoint::combine(topoSet& set, const bool add) const { // Mesh points above plane - const pointField& ctrs = mesh_.points(); + const tmp<pointField> tctrs(this->transform(mesh_.points())); + const pointField& ctrs = tctrs(); forAll(ctrs, elemi) { @@ -102,12 +103,9 @@ Foam::clipPlaneToPoint::clipPlaneToPoint const dictionary& dict ) : - clipPlaneToPoint - ( - mesh, - dict.get<vector>("point"), - dict.get<vector>("normal") - ) + topoSetPointSource(mesh, dict), + point_(dict.get<vector>("point")), + normal_(dict.get<vector>("normal")) {} diff --git a/src/meshTools/topoSet/pointSources/cylinderToPoint/cylinderToPoint.C b/src/meshTools/topoSet/pointSources/cylinderToPoint/cylinderToPoint.C index 99e58047f58951dc708d5ebb7068a4d1c05e8a20..23ec1d5232294d699d2678cb141c4db5d4d89642 100644 --- a/src/meshTools/topoSet/pointSources/cylinderToPoint/cylinderToPoint.C +++ b/src/meshTools/topoSet/pointSources/cylinderToPoint/cylinderToPoint.C @@ -68,7 +68,8 @@ Foam::topoSetSource::addToUsageTable Foam::cylinderToPoint::usage_ void Foam::cylinderToPoint::combine(topoSet& set, const bool add) const { - const pointField& ctrs = mesh_.points(); + const tmp<pointField> tctrs(this->transform(mesh_.points())); + const pointField& ctrs = tctrs(); const vector axis = (point2_ - point1_); const scalar magAxis2 = magSqr(axis); @@ -119,12 +120,12 @@ Foam::cylinderToPoint::cylinderToPoint const dictionary& dict ) : - cylinderToPoint + topoSetPointSource(mesh, dict), + point1_(dict.getCompat<point>("point1", {{"p1", -2112}})), + point2_(dict.getCompat<point>("point2", {{"p2", -2112}})), + radius_(dict.getCompat<scalar>("radius", {{"outerRadius", -2112}})), + innerRadius_ ( - mesh, - dict.getCompat<point>("point1", {{"p1", -2112}}), - dict.getCompat<point>("point2", {{"p2", -2112}}), - dict.getCompat<scalar>("radius", {{"outerRadius", -2112}}), dict.getCheckOrDefault<scalar>("innerRadius", 0, scalarMinMax::ge(0)) ) {} diff --git a/src/meshTools/topoSet/pointSources/faceToPoint/faceToPoint.C b/src/meshTools/topoSet/pointSources/faceToPoint/faceToPoint.C index 86d20e9f909fc07dc99bb0b2226ee6120aeb533f..0de8f548ccd487ecbc86c975386dfb8899fb6c3c 100644 --- a/src/meshTools/topoSet/pointSources/faceToPoint/faceToPoint.C +++ b/src/meshTools/topoSet/pointSources/faceToPoint/faceToPoint.C @@ -103,7 +103,7 @@ Foam::faceToPoint::faceToPoint const dictionary& dict ) : - topoSetPointSource(mesh), + topoSetPointSource(mesh, dict), names_(), option_(faceActionNames_.get("option", dict)) { diff --git a/src/meshTools/topoSet/pointSources/labelToPoint/labelToPoint.C b/src/meshTools/topoSet/pointSources/labelToPoint/labelToPoint.C index 4b3eb85c442ffbc74a8b6d062f0ead313e498acf..e6c9de9cf33141c9858f85fd85e5b244676cb7c7 100644 --- a/src/meshTools/topoSet/pointSources/labelToPoint/labelToPoint.C +++ b/src/meshTools/topoSet/pointSources/labelToPoint/labelToPoint.C @@ -94,7 +94,8 @@ Foam::labelToPoint::labelToPoint const dictionary& dict ) : - labelToPoint(mesh, dict.get<labelList>("value")) + topoSetPointSource(mesh, dict), + labels_(dict.get<labelList>("value")) {} diff --git a/src/meshTools/topoSet/pointSources/nearestToPoint/nearestToPoint.C b/src/meshTools/topoSet/pointSources/nearestToPoint/nearestToPoint.C index b5ec828161a6aa6bd7ca9bec7797c488b1088707..cf17eef6b44e225e3e9834316cdead940811370a 100644 --- a/src/meshTools/topoSet/pointSources/nearestToPoint/nearestToPoint.C +++ b/src/meshTools/topoSet/pointSources/nearestToPoint/nearestToPoint.C @@ -146,7 +146,8 @@ Foam::nearestToPoint::nearestToPoint const dictionary& dict ) : - nearestToPoint(mesh, dict.get<pointField>("points")) + topoSetPointSource(mesh, dict), + points_(dict.get<pointField>("points")) {} diff --git a/src/meshTools/topoSet/pointSources/pointToPoint/pointToPoint.C b/src/meshTools/topoSet/pointSources/pointToPoint/pointToPoint.C index ddb9810c92b7835f1e456d83a6d4a4668fdc6225..6b8abbbdbb4652ef6d72cde26045e38fce99a910 100644 --- a/src/meshTools/topoSet/pointSources/pointToPoint/pointToPoint.C +++ b/src/meshTools/topoSet/pointSources/pointToPoint/pointToPoint.C @@ -70,7 +70,7 @@ Foam::pointToPoint::pointToPoint const dictionary& dict ) : - topoSetPointSource(mesh), + topoSetPointSource(mesh, dict), names_() { // Look for 'sets' or 'set' diff --git a/src/meshTools/topoSet/pointSources/searchableSurfaceToPoint/searchableSurfaceToPoint.C b/src/meshTools/topoSet/pointSources/searchableSurfaceToPoint/searchableSurfaceToPoint.C index 4b5e73446757a96933ac2f5128f78f4445bb8f43..15a82782dafb2b508d6306cc6d3937925dd31d8e 100644 --- a/src/meshTools/topoSet/pointSources/searchableSurfaceToPoint/searchableSurfaceToPoint.C +++ b/src/meshTools/topoSet/pointSources/searchableSurfaceToPoint/searchableSurfaceToPoint.C @@ -102,12 +102,15 @@ void Foam::searchableSurfaceToPoint::combine(topoSet& set, const bool add) const { return; } + const tmp<pointField> tctrs(this->transform(mesh_.points())); + const pointField& ctrs = tctrs(); + const searchableSurface& s = *surf_; // Mesh points within the enclosing volumes List<volumeType> volTypes; - s.getVolumeType(mesh_.points(), volTypes); + s.getVolumeType(ctrs, volTypes); const label len = volTypes.size(); for (label id=0; id < len; ++id) @@ -129,7 +132,7 @@ Foam::searchableSurfaceToPoint::searchableSurfaceToPoint const dictionary& dict ) : - topoSetPointSource(mesh), + topoSetPointSource(mesh, dict), surf_ ( searchableSurface::New diff --git a/src/meshTools/topoSet/pointSources/sphereToPoint/sphereToPoint.C b/src/meshTools/topoSet/pointSources/sphereToPoint/sphereToPoint.C index e564b7892550889d2fe24a036debd0d27343daf4..ccecc0062b55eed3774166bb66288e92d1e53d49 100644 --- a/src/meshTools/topoSet/pointSources/sphereToPoint/sphereToPoint.C +++ b/src/meshTools/topoSet/pointSources/sphereToPoint/sphereToPoint.C @@ -67,7 +67,8 @@ Foam::topoSetSource::addToUsageTable Foam::sphereToPoint::usage_ void Foam::sphereToPoint::combine(topoSet& set, const bool add) const { - const pointField& ctrs = mesh_.points(); + const tmp<pointField> tctrs(this->transform(mesh_.points())); + const pointField& ctrs = tctrs(); const scalar orad2 = sqr(radius_); const scalar irad2 = innerRadius_ > 0 ? sqr(innerRadius_) : -1; @@ -109,11 +110,11 @@ Foam::sphereToPoint::sphereToPoint const dictionary& dict ) : - sphereToPoint + topoSetPointSource(mesh, dict), + origin_(dict.getCompat<vector>("origin", {{"centre", -1806}})), + radius_(dict.getCheck<scalar>("radius", scalarMinMax::ge(0))), + innerRadius_ ( - mesh, - dict.getCompat<vector>("origin", {{"centre", -1806}}), - dict.getCheck<scalar>("radius", scalarMinMax::ge(0)), dict.getCheckOrDefault<scalar>("innerRadius", 0, scalarMinMax::ge(0)) ) {} diff --git a/src/meshTools/topoSet/pointSources/surfaceToPoint/surfaceToPoint.C b/src/meshTools/topoSet/pointSources/surfaceToPoint/surfaceToPoint.C index d6e94acab1b2fd4255cb7977777905e3ad602528..22afa0c3cc4eaf56e9352911e42608365137ca83 100644 --- a/src/meshTools/topoSet/pointSources/surfaceToPoint/surfaceToPoint.C +++ b/src/meshTools/topoSet/pointSources/surfaceToPoint/surfaceToPoint.C @@ -153,7 +153,7 @@ Foam::surfaceToPoint::surfaceToPoint const dictionary& dict ) : - topoSetPointSource(mesh), + topoSetPointSource(mesh, dict), surfName_(dict.get<fileName>("file").expand()), surfType_(dict.getOrDefault<word>("fileType", word::null)), scale_(dict.getOrDefault<scalar>("scale", -1)), diff --git a/src/meshTools/topoSet/pointSources/zoneToPoint/zoneToPoint.C b/src/meshTools/topoSet/pointSources/zoneToPoint/zoneToPoint.C index 44627db683ad89abf95febd22f075d003a14c236..b7138e750496848163ab5607dc4b8557884c220c 100644 --- a/src/meshTools/topoSet/pointSources/zoneToPoint/zoneToPoint.C +++ b/src/meshTools/topoSet/pointSources/zoneToPoint/zoneToPoint.C @@ -183,7 +183,7 @@ Foam::zoneToPoint::zoneToPoint const dictionary& dict ) : - topoSetPointSource(mesh), + topoSetPointSource(mesh, dict), zoneMatcher_() { // Look for 'zones' and 'zone', but accept 'name' as well diff --git a/src/meshTools/topoSet/pointZoneSources/setToPointZone/setToPointZone.C b/src/meshTools/topoSet/pointZoneSources/setToPointZone/setToPointZone.C index 1fcc0cf0fd54fa11591164a9523a21d7b7f3e0ed..1d03c80dc356fce6ea29942fc88b0c20f49af5f2 100644 --- a/src/meshTools/topoSet/pointZoneSources/setToPointZone/setToPointZone.C +++ b/src/meshTools/topoSet/pointZoneSources/setToPointZone/setToPointZone.C @@ -71,7 +71,7 @@ Foam::setToPointZone::setToPointZone const dictionary& dict ) : - topoSetPointZoneSource(mesh), + topoSetPointZoneSource(mesh, dict), setName_(dict.get<word>("set")) {} diff --git a/src/meshTools/topoSet/topoSetSource/topoSetSource.C b/src/meshTools/topoSet/topoSetSource/topoSetSource.C index ffc15dc29fe437e8dd625df46cf8e719d7364df3..16a7cd1d2d8a9eed57f29812b9e33300a0909cc1 100644 --- a/src/meshTools/topoSet/topoSetSource/topoSetSource.C +++ b/src/meshTools/topoSet/topoSetSource/topoSetSource.C @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2018-2022 OpenCFD Ltd. + Copyright (C) 2018-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -31,6 +31,7 @@ License #include "polyMesh.H" #include "bitSet.H" #include "topoSet.H" +#include "transformField.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -252,7 +253,8 @@ Foam::topoSetSource::topoSetSource ) : mesh_(mesh), - verbose_(verbose) + verbose_(verbose), + transformPtr_(nullptr) {} @@ -262,10 +264,14 @@ Foam::topoSetSource::topoSetSource const dictionary& dict ) : - topoSetSource(mesh) -{ - verbose(dict); -} + mesh_(mesh), + verbose_(dict.getOrDefault<bool>("verbose", true)), + transformPtr_ + ( + // Uses "solidBodyMotionFunction" if present + solidBodyMotionFunction::NewIfPresent(dict, mesh.time()) + ) +{} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // @@ -274,11 +280,28 @@ void Foam::topoSetSource::verbose(const dictionary& dict) { bool flag(verbose_); - if (dict.readIfPresent("verbose", flag)) + if (dict.readIfPresent("verbose", flag, keyType::LITERAL)) { verbose_ = flag; } } +Foam::tmp<Foam::pointField> Foam::topoSetSource::transform +( + const pointField& points +) const +{ + if (transformPtr_) + { + return transformPoints(transformPtr_->transformation(), points); + } + else + { + // No transform - return reference to input points + return points; + } +} + + // ************************************************************************* // diff --git a/src/meshTools/topoSet/topoSetSource/topoSetSource.H b/src/meshTools/topoSet/topoSetSource/topoSetSource.H index 7be8160002973658f9cc86e1e1048d4d0e08aab6..68b07a71083992aa7c5ae8a612449ec1d3485ffb 100644 --- a/src/meshTools/topoSet/topoSetSource/topoSetSource.H +++ b/src/meshTools/topoSet/topoSetSource/topoSetSource.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2018-2022 OpenCFD Ltd. + Copyright (C) 2018-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -48,7 +48,7 @@ SourceFiles #include "autoPtr.H" #include "Enum.H" #include "HashTable.H" -#include "runTimeSelectionTables.H" +#include "solidBodyMotionFunction.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -168,6 +168,9 @@ protected: //- Output verbosity (default: true) bool verbose_; + //- Optional transformation for geometric data + autoPtr<solidBodyMotionFunction> transformPtr_; + // Protected Member Functions @@ -386,6 +389,14 @@ public: ) const = 0; + //- True if coordinate transform is active. + bool hasTransform() const noexcept { return bool(transformPtr_); } + + //- Coordinate transform (optionally) coordinates. + //- Returns reference to input data if no transform is active. + tmp<pointField> transform(const pointField& points) const; + + // Housekeeping //- Deprecated(2018-07) convert string to action