From 496e1cd0d217a468b4a67c8cfffd5d666fd3c466 Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Mon, 1 Oct 2018 22:55:59 +0200 Subject: [PATCH] STYLE: enforce Cartesian transform (issue #1027) - searchable surfaces - pointToPointPlanarInterpolation - sampled planes - surfaceMeshConvert, surfaceMeshExport, surfaceMeshImport --- .../surfaceMeshConvert/coordinateSystems | 46 +++++++-------- .../surfaceMeshConvert/surfaceMeshConvert.C | 57 ++++++++++--------- .../surfaceMeshExport/surfaceMeshExport.C | 51 +++++++++-------- .../surfaceMeshImport/surfaceMeshImport.C | 56 +++++++++--------- .../searchableRotatedBox.C | 1 - .../searchableRotatedBox.H | 5 +- .../searchableSurfaceCollection.C | 11 +--- .../searchableSurfaceCollection.H | 10 ++-- .../pointToPointPlanarInterpolation.C | 29 ++++------ .../pointToPointPlanarInterpolation.H | 12 ++-- .../sampledPlane/sampledPlane.C | 10 ++-- .../plane/surfMeshSamplePlane.C | 10 ++-- 12 files changed, 149 insertions(+), 149 deletions(-) diff --git a/applications/utilities/surface/surfaceMeshConvert/coordinateSystems b/applications/utilities/surface/surfaceMeshConvert/coordinateSystems index c527806a21..9f46501ae7 100644 --- a/applications/utilities/surface/surfaceMeshConvert/coordinateSystems +++ b/applications/utilities/surface/surfaceMeshConvert/coordinateSystems @@ -9,74 +9,74 @@ FoamFile { version 2.0; format ascii; - class IOPtrList; + class coordinateSystems; object coordinateSystems; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -7 + ( -system_9 +_9 { type cartesian; origin (1.03291515 -0.114391257 -0.0826236662); - e3 (1 0 0); e1 (0 1 0); - // STARCDRotation (0 90 90); + e3 (1 0 0); + // rotation { type starcd; angles (0 90 90); } } -system_10 +_10 { type cartesian; origin (0.623151719 -0.286472935 -0.113933262); - e3 (0.99508851 0.09829095 0.01173645); e1 (0.01179356 0 -0.99993045); - // STARCDRotation (5.6403745 -0.0664172952 89.3275351); + e3 (0.99508851 0.09829095 0.01173645); + // rotation { type starcd; angles (5.6403745 -0.0664172952 89.3275351); } } -system_15 +_15 { type cartesian; origin (0.644772231 -0.240036493 0.155972187); - e3 (-0.01346388 -0.90616979 -0.42269969); e1 (0.00627978 0.42265304 -0.90626981); - // STARCDRotation (-90.8512386 0 115.005148); + e3 (-0.01346388 -0.90616979 -0.42269969); + // rotation { type starcd; angles (-90.8512386 0 115.005148); } } -system_16 +_16 { type cartesian; origin (0.540824938 -0.240036415 0.15928296); - e3 (-0.01346388 -0.90616979 -0.42269969); e1 (0.00627978 0.42265304 -0.90626981); - // STARCDRotation (-90.8512386 0 115.005148); + e3 (-0.01346388 -0.90616979 -0.42269969); + // rotation { type starcd; angles (-90.8512386 0 115.005148); } } -system_17 +_17 { type cartesian; origin (0.436877646 -0.240036339 0.162593737); - e3 (-0.01346388 -0.90616979 -0.42269969); e1 (0.00627978 0.42265304 -0.90626981); - // STARCDRotation (-90.8512386 0 115.005148); + e3 (-0.01346388 -0.90616979 -0.42269969); + // rotation { type starcd; angles (-90.8512386 0 115.005148); } } -system_18 +_18 { type cartesian; origin (0.332930354 -0.240036261 0.16590451); - e3 (-0.01346388 -0.90616979 -0.42269969); e1 (0.00627978 0.42265304 -0.90626981); - // STARCDRotation (-90.8512386 0 115.005148); + e3 (-0.01346388 -0.90616979 -0.42269969); + // rotation { type starcd; angles (-90.8512386 0 115.005148); } } -system_21 +_21 { type cartesian; origin (0.55863733 -0.300866705 0.00317260982); - e3 (0.42110287 0.02470132 -0.90667647); e1 (0.90646036 0.02342535 0.42164069); - // STARCDRotation (-178.185897 -0.71772221 -155.059695); + e3 (0.42110287 0.02470132 -0.90667647); + // rotation { type starcd; angles (-178.185897 -0.71772221 -155.059695); } } ) diff --git a/applications/utilities/surface/surfaceMeshConvert/surfaceMeshConvert.C b/applications/utilities/surface/surfaceMeshConvert/surfaceMeshConvert.C index 0ca90a5b7a..a030599286 100644 --- a/applications/utilities/surface/surfaceMeshConvert/surfaceMeshConvert.C +++ b/applications/utilities/surface/surfaceMeshConvert/surfaceMeshConvert.C @@ -66,6 +66,7 @@ Note #include "MeshedSurfaces.H" #include "coordinateSystems.H" +#include "cartesianCS.H" using namespace Foam; @@ -146,9 +147,9 @@ int main(int argc, char *argv[]) } - // get the coordinate transformations - autoPtr fromCsys; - autoPtr toCsys; + // The coordinate transformations (must be cartesian) + autoPtr fromCsys; + autoPtr toCsys; if (args.found("from") || args.found("to")) { @@ -174,46 +175,47 @@ int main(int argc, char *argv[]) << exit(FatalError); } - coordinateSystems csLst(ioCsys); + coordinateSystems globalCoords(ioCsys); if (args.found("from")) { - const word csName = args["from"]; + const word csName(args["from"]); + const auto* csPtr = globalCoords.lookupPtr(csName); - const label csIndex = csLst.findIndex(csName); - if (csIndex < 0) + if (!csPtr) { FatalErrorInFunction << "Cannot find -from " << csName << nl - << "available coordinateSystems: " << csLst.toc() << nl + << "available coordinateSystems: " + << flatOutput(globalCoords.names()) << nl << exit(FatalError); } - fromCsys.reset(new coordinateSystem(csLst[csIndex])); + fromCsys = autoPtr::New(*csPtr); } if (args.found("to")) { - const word csName = args["to"]; + const word csName(args["to"]); + const auto* csPtr = globalCoords.lookupPtr(csName); - const label csIndex = csLst.findIndex(csName); - if (csIndex < 0) + if (!csPtr) { FatalErrorInFunction << "Cannot find -to " << csName << nl - << "available coordinateSystems: " << csLst.toc() << nl + << "available coordinateSystems: " + << flatOutput(globalCoords.names()) << nl << exit(FatalError); } - toCsys.reset(new coordinateSystem(csLst[csIndex])); + toCsys = autoPtr::New(*csPtr); } - - // maybe fix this later - if (fromCsys.valid() && toCsys.valid()) + // Maybe fix this later + if (fromCsys && toCsys) { FatalErrorInFunction - << "Only allowed '-from' or '-to' option at the moment." + << "Only allowed '-from' or '-to' option at the moment." << exit(FatalError); } } @@ -230,29 +232,30 @@ int main(int argc, char *argv[]) scalar scaleIn = 0; if (args.readIfPresent("scaleIn", scaleIn) && scaleIn > 0) { - Info<< " -scaleIn " << scaleIn << endl; + Info<< "scale input " << scaleIn << endl; surf.scalePoints(scaleIn); } - - if (fromCsys.valid()) + if (fromCsys) { - Info<< " -from " << fromCsys().name() << endl; - tmp tpf = fromCsys().localPosition(surf.points()); + Info<< "move points from coordinate system: " + << fromCsys->name() << endl; + tmp tpf = fromCsys->localPosition(surf.points()); surf.movePoints(tpf()); } - if (toCsys.valid()) + if (toCsys) { - Info<< " -to " << toCsys().name() << endl; - tmp tpf = toCsys().globalPosition(surf.points()); + Info<< "move points to coordinate system: " + << toCsys->name() << endl; + tmp tpf = toCsys->globalPosition(surf.points()); surf.movePoints(tpf()); } scalar scaleOut = 0; if (args.readIfPresent("scaleOut", scaleOut) && scaleOut > 0) { - Info<< " -scaleOut " << scaleOut << endl; + Info<< "scale output " << scaleOut << endl; surf.scalePoints(scaleOut); } diff --git a/applications/utilities/surface/surfaceMeshExport/surfaceMeshExport.C b/applications/utilities/surface/surfaceMeshExport/surfaceMeshExport.C index 65abe34eb9..62e515e2eb 100644 --- a/applications/utilities/surface/surfaceMeshExport/surfaceMeshExport.C +++ b/applications/utilities/surface/surfaceMeshExport/surfaceMeshExport.C @@ -67,6 +67,7 @@ Note #include "MeshedSurfaces.H" #include "coordinateSystems.H" +#include "cartesianCS.H" using namespace Foam; @@ -135,9 +136,9 @@ int main(int argc, char *argv[]) } - // get the coordinate transformations - autoPtr fromCsys; - autoPtr toCsys; + // The coordinate transformations (must be cartesian) + autoPtr fromCsys; + autoPtr toCsys; if (args.found("from") || args.found("to")) { @@ -162,45 +163,47 @@ int main(int argc, char *argv[]) << exit(FatalError); } - coordinateSystems csLst(ioCsys); + coordinateSystems globalCoords(ioCsys); if (args.found("from")) { - const word csName = args["from"]; + const word csName(args["from"]); + const auto* csPtr = globalCoords.lookupPtr(csName); - const label csIndex = csLst.findIndex(csName); - if (csIndex < 0) + if (!csPtr) { FatalErrorInFunction << "Cannot find -from " << csName << nl - << "available coordinateSystems: " << csLst.toc() << nl + << "available coordinateSystems: " + << flatOutput(globalCoords.names()) << nl << exit(FatalError); } - fromCsys.reset(new coordinateSystem(csLst[csIndex])); + fromCsys = autoPtr::New(*csPtr); } if (args.found("to")) { - const word csName = args["to"]; + const word csName(args["to"]); + const auto* csPtr = globalCoords.lookupPtr(csName); - const label csIndex = csLst.findIndex(csName); - if (csIndex < 0) + if (!csPtr) { FatalErrorInFunction << "Cannot find -to " << csName << nl - << "available coordinateSystems: " << csLst.toc() << nl + << "available coordinateSystems: " + << flatOutput(globalCoords.names()) << nl << exit(FatalError); } - toCsys.reset(new coordinateSystem(csLst[csIndex])); + toCsys = autoPtr::New(*csPtr); } - - // maybe fix this later - if (fromCsys.valid() && toCsys.valid()) + // Maybe fix this later + if (fromCsys && toCsys) { FatalErrorInFunction + << "Only allowed '-from' or '-to' option at the moment." << exit(FatalError); } } @@ -233,28 +236,30 @@ int main(int argc, char *argv[]) scalar scaleIn = 0; if (args.readIfPresent("scaleIn", scaleIn) && scaleIn > 0) { - Info<< " -scaleIn " << scaleIn << endl; + Info<< "scale input " << scaleIn << endl; surf.scalePoints(scaleIn); } if (fromCsys.valid()) { - Info<< " -from " << fromCsys().name() << endl; - tmp tpf = fromCsys().localPosition(surf.points()); + Info<< "move points from coordinate system: " + << fromCsys->name() << endl; + tmp tpf = fromCsys->localPosition(surf.points()); surf.movePoints(tpf()); } if (toCsys.valid()) { - Info<< " -to " << toCsys().name() << endl; - tmp tpf = toCsys().globalPosition(surf.points()); + Info<< "move points to coordinate system: " + << toCsys->name() << endl; + tmp tpf = toCsys->globalPosition(surf.points()); surf.movePoints(tpf()); } scalar scaleOut = 0; if (args.readIfPresent("scaleOut", scaleOut) && scaleOut > 0) { - Info<< " -scaleOut " << scaleOut << endl; + Info<< "scale output " << scaleOut << endl; surf.scalePoints(scaleOut); } diff --git a/applications/utilities/surface/surfaceMeshImport/surfaceMeshImport.C b/applications/utilities/surface/surfaceMeshImport/surfaceMeshImport.C index 48b29a2118..eb233b30e3 100644 --- a/applications/utilities/surface/surfaceMeshImport/surfaceMeshImport.C +++ b/applications/utilities/surface/surfaceMeshImport/surfaceMeshImport.C @@ -67,6 +67,7 @@ Note #include "MeshedSurfaces.H" #include "coordinateSystems.H" +#include "cartesianCS.H" using namespace Foam; @@ -148,9 +149,9 @@ int main(int argc, char *argv[]) } - // get the coordinate transformations - autoPtr fromCsys; - autoPtr toCsys; + // The coordinate transformations (must be cartesian) + autoPtr fromCsys; + autoPtr toCsys; if (args.found("from") || args.found("to")) { @@ -175,51 +176,52 @@ int main(int argc, char *argv[]) << exit(FatalError); } - coordinateSystems csLst(ioCsys); + coordinateSystems globalCoords(ioCsys); if (args.found("from")) { - const word csName = args["from"]; + const word csName(args["from"]); + const auto* csPtr = globalCoords.lookupPtr(csName); - const label csIndex = csLst.findIndex(csName); - if (csIndex < 0) + if (!csPtr) { FatalErrorInFunction << "Cannot find -from " << csName << nl - << "available coordinateSystems: " << csLst.toc() << nl + << "available coordinateSystems: " + << flatOutput(globalCoords.names()) << nl << exit(FatalError); } - fromCsys.reset(new coordinateSystem(csLst[csIndex])); + fromCsys = autoPtr::New(*csPtr); } if (args.found("to")) { - const word csName = args["to"]; + const word csName(args["to"]); + const auto* csPtr = globalCoords.lookupPtr(csName); - const label csIndex = csLst.findIndex(csName); - if (csIndex < 0) + if (!csPtr) { FatalErrorInFunction << "Cannot find -to " << csName << nl - << "available coordinateSystems: " << csLst.toc() << nl + << "available coordinateSystems: " + << flatOutput(globalCoords.names()) << nl << exit(FatalError); } - toCsys.reset(new coordinateSystem(csLst[csIndex])); + toCsys = autoPtr::New(*csPtr); } - - // maybe fix this later - if (fromCsys.valid() && toCsys.valid()) + // Maybe fix this later + if (fromCsys && toCsys) { FatalErrorInFunction + << "Only allowed '-from' or '-to' option at the moment." << exit(FatalError); } } - MeshedSurface surf(importName); if (args.found("clean")) @@ -231,28 +233,30 @@ int main(int argc, char *argv[]) scalar scaleIn = 0; if (args.readIfPresent("scaleIn", scaleIn) && scaleIn > 0) { - Info<< " -scaleIn " << scaleIn << endl; + Info<< "scale input " << scaleIn << endl; surf.scalePoints(scaleIn); } - if (fromCsys.valid()) + if (fromCsys) { - Info<< " -from " << fromCsys().name() << endl; - tmp tpf = fromCsys().localPosition(surf.points()); + Info<< "move points from coordinate system: " + << fromCsys->name() << endl; + tmp tpf = fromCsys->localPosition(surf.points()); surf.movePoints(tpf()); } - if (toCsys.valid()) + if (toCsys) { - Info<< " -to " << toCsys().name() << endl; - tmp tpf = toCsys().globalPosition(surf.points()); + Info<< "move points to coordinate system: " + << toCsys->name() << endl; + tmp tpf = toCsys->globalPosition(surf.points()); surf.movePoints(tpf()); } scalar scaleOut = 0; if (args.readIfPresent("scaleOut", scaleOut) && scaleOut > 0) { - Info<< " -scaleOut " << scaleOut << endl; + Info<< "scale output " << scaleOut << endl; surf.scalePoints(scaleOut); } diff --git a/src/meshTools/searchableSurfaces/searchableRotatedBox/searchableRotatedBox.C b/src/meshTools/searchableSurfaces/searchableRotatedBox/searchableRotatedBox.C index bf66177ced..62355837e1 100644 --- a/src/meshTools/searchableSurfaces/searchableRotatedBox/searchableRotatedBox.C +++ b/src/meshTools/searchableSurfaces/searchableRotatedBox/searchableRotatedBox.C @@ -72,7 +72,6 @@ Foam::searchableRotatedBox::searchableRotatedBox ), transform_ ( - "rotation", dict.get("origin"), dict.get("e3"), dict.get("e1") diff --git a/src/meshTools/searchableSurfaces/searchableRotatedBox/searchableRotatedBox.H b/src/meshTools/searchableSurfaces/searchableRotatedBox/searchableRotatedBox.H index cb28c26c29..3065fb00ec 100644 --- a/src/meshTools/searchableSurfaces/searchableRotatedBox/searchableRotatedBox.H +++ b/src/meshTools/searchableSurfaces/searchableRotatedBox/searchableRotatedBox.H @@ -32,6 +32,7 @@ Description E.g. box with sides 1 1 1 rotated 45 degrees around z-axis at origin (0.5 0.5 0.5) + \verbatim span (1 1 1); origin (0.5 0.5 0.5); @@ -58,8 +59,8 @@ SourceFiles #define searchableRotatedBox_H #include "searchableSurface.H" -#include "coordinateSystem.H" #include "searchableBox.H" +#include "cartesianCS.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -82,7 +83,7 @@ private: searchableBox box_; //- Transformation from local to global coordinates - coordinateSystem transform_; + coordSystem::cartesian transform_; //- The (global) corner points (in treeBoundBox order) pointField points_; diff --git a/src/meshTools/searchableSurfaces/searchableSurfaceCollection/searchableSurfaceCollection.C b/src/meshTools/searchableSurfaces/searchableSurfaceCollection/searchableSurfaceCollection.C index dce9041d3f..a55e2c37ff 100644 --- a/src/meshTools/searchableSurfaces/searchableSurfaceCollection/searchableSurfaceCollection.C +++ b/src/meshTools/searchableSurfaces/searchableSurfaceCollection/searchableSurfaceCollection.C @@ -199,11 +199,7 @@ Foam::searchableSurfaceCollection::searchableSurfaceCollection transform_.set ( surfI, - coordinateSystem::New - ( - subDict, - "transform" - ) + new coordSystem::cartesian(subDict, "transform") ); const word subGeomName(subDict.get("surface")); @@ -716,10 +712,7 @@ void Foam::searchableSurfaceCollection::distribute // pointField bbPoints = // cmptDivide // ( - // transform_[surfI].localPosition - // ( - // bbs[i].points() - // ), + // transform_[surfI].localPosition(bbs[i].points()), // scale_[surfI] // ); // treeBoundBox newBb(bbPoints); diff --git a/src/meshTools/searchableSurfaces/searchableSurfaceCollection/searchableSurfaceCollection.H b/src/meshTools/searchableSurfaces/searchableSurfaceCollection/searchableSurfaceCollection.H index f35b64d3f7..e178dbaa2d 100644 --- a/src/meshTools/searchableSurfaces/searchableSurfaceCollection/searchableSurfaceCollection.H +++ b/src/meshTools/searchableSurfaces/searchableSurfaceCollection/searchableSurfaceCollection.H @@ -45,7 +45,7 @@ SourceFiles #include "searchableSurface.H" #include "treeBoundBox.H" -#include "coordinateSystem.H" +#include "cartesianCS.H" #include "UPtrList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -71,8 +71,8 @@ class searchableSurfaceCollection //- Scaling vector vectorField scale_; - //- transformation - PtrList transform_; + //- Coordinate transformation + PtrList transform_; UPtrList subGeom_; @@ -159,13 +159,13 @@ public: } //- Coordinate system per subsurface - const PtrList& transform() const + const PtrList& transform() const { return transform_; } //- Coordinate system per subsurface - PtrList& transform() + PtrList& transform() { return transform_; } diff --git a/src/meshTools/triSurface/triSurfaceTools/pointToPointPlanarInterpolation.C b/src/meshTools/triSurface/triSurfaceTools/pointToPointPlanarInterpolation.C index ac28865272..6c16efd3eb 100644 --- a/src/meshTools/triSurface/triSurfaceTools/pointToPointPlanarInterpolation.C +++ b/src/meshTools/triSurface/triSurfaceTools/pointToPointPlanarInterpolation.C @@ -43,7 +43,7 @@ namespace Foam // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // -Foam::coordinateSystem +Foam::coordSystem::cartesian Foam::pointToPointPlanarInterpolation::calcCoordinateSystem ( const pointField& points @@ -117,9 +117,8 @@ Foam::pointToPointPlanarInterpolation::calcCoordinateSystem << " to define coordinate system with normal " << n << endl; } - return coordinateSystem + return coordSystem::cartesian ( - "reference", p0, // origin n, // normal e1 // 0-axis @@ -192,11 +191,8 @@ void Foam::pointToPointPlanarInterpolation::calcWeights } else { - tmp tlocalVertices - ( - referenceCS_.localPosition(sourcePoints) - ); - vectorField& localVertices = tlocalVertices.ref(); + auto tlocalVertices = referenceCS_.localPosition(sourcePoints); + auto& localVertices = tlocalVertices.ref(); const boundBox bb(localVertices, true); const point bbMid(bb.midpoint()); @@ -228,13 +224,7 @@ void Foam::pointToPointPlanarInterpolation::calcWeights triSurface s(triSurfaceTools::delaunay2D(localVertices2D)); - tmp tlocalFaceCentres - ( - referenceCS_.localPosition - ( - destPoints - ) - ); + auto tlocalFaceCentres = referenceCS_.localPosition(destPoints); const pointField& localFaceCentres = tlocalFaceCentres(); if (debug) @@ -324,12 +314,13 @@ Foam::pointToPointPlanarInterpolation::pointToPointPlanarInterpolation : perturb_(perturb), nearestOnly_(nearestOnly), - referenceCS_ - ( - nearestOnly ? coordinateSystem() : calcCoordinateSystem(sourcePoints) - ), + referenceCS_(), nPoints_(sourcePoints.size()) { + if (!nearestOnly) + { + referenceCS_ = calcCoordinateSystem(sourcePoints); + } calcWeights(sourcePoints, destPoints); } diff --git a/src/meshTools/triSurface/triSurfaceTools/pointToPointPlanarInterpolation.H b/src/meshTools/triSurface/triSurfaceTools/pointToPointPlanarInterpolation.H index 2d0df6a8ea..36adb7e4b8 100644 --- a/src/meshTools/triSurface/triSurfaceTools/pointToPointPlanarInterpolation.H +++ b/src/meshTools/triSurface/triSurfaceTools/pointToPointPlanarInterpolation.H @@ -37,8 +37,8 @@ SourceFiles #define pointToPointPlanarInterpolation_H #include "FixedList.H" -#include "coordinateSystem.H" #include "instantList.H" +#include "cartesianCS.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -59,8 +59,8 @@ class pointToPointPlanarInterpolation //- Whether to use nearest point only (avoids triangulation, projection) const bool nearestOnly_; - //- Coordinate system - coordinateSystem referenceCS_; + //- Cartesian reference coordinate system + coordSystem::cartesian referenceCS_; //- Number of source points (for checking) label nPoints_; @@ -77,7 +77,7 @@ class pointToPointPlanarInterpolation // Private Member Functions //- Calculate a local coordinate system from set of points - coordinateSystem calcCoordinateSystem(const pointField&) const; + coordSystem::cartesian calcCoordinateSystem(const pointField&) const; //- Calculate addressing and weights void calcWeights @@ -145,8 +145,8 @@ public: return nearestOnly_; } - //- Return the coordinateSystem - const coordinateSystem& referenceCS() const + //- Return the Cartesian reference coordinate system + const coordSystem::cartesian& referenceCS() const { return referenceCS_; } diff --git a/src/sampling/sampledSurface/sampledPlane/sampledPlane.C b/src/sampling/sampledSurface/sampledPlane/sampledPlane.C index 663d31f7cd..32720169cf 100644 --- a/src/sampling/sampledSurface/sampledPlane/sampledPlane.C +++ b/src/sampling/sampledSurface/sampledPlane/sampledPlane.C @@ -27,7 +27,7 @@ License #include "dictionary.H" #include "polyMesh.H" #include "volFields.H" -#include "coordinateSystem.H" +#include "cartesianCS.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -117,10 +117,12 @@ Foam::sampledPlane::sampledPlane // Make plane relative to the coordinateSystem (Cartesian) // allow lookup from global coordinate systems - if (dict.found("coordinateSystem")) + if (dict.found(coordinateSystem::typeName_())) { - auto csysPtr = coordinateSystem::New(mesh, dict, "coordinateSystem"); - const auto& cs = *csysPtr; + coordSystem::cartesian cs + ( + coordinateSystem::New(mesh, dict, coordinateSystem::typeName_()) + ); plane& pln = planeDesc(); const point orig = cs.globalPosition(pln.origin()); diff --git a/src/sampling/surfMeshSample/plane/surfMeshSamplePlane.C b/src/sampling/surfMeshSample/plane/surfMeshSamplePlane.C index b9e0a57040..59eb7d33b9 100644 --- a/src/sampling/surfMeshSample/plane/surfMeshSamplePlane.C +++ b/src/sampling/surfMeshSample/plane/surfMeshSamplePlane.C @@ -27,7 +27,7 @@ License #include "dictionary.H" #include "polyMesh.H" #include "volFields.H" -#include "coordinateSystem.H" +#include "cartesianCS.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -117,10 +117,12 @@ Foam::surfMeshSamplePlane::surfMeshSamplePlane // Make plane relative to the coordinateSystem (Cartesian) // allow lookup from global coordinate systems - if (dict.found("coordinateSystem")) + if (dict.found(coordinateSystem::typeName_())) { - auto csysPtr = coordinateSystem::New(mesh, dict, "coordinateSystem"); - const auto& cs = *csysPtr; + coordSystem::cartesian cs + ( + coordinateSystem::New(mesh, dict, coordinateSystem::typeName_()) + ); plane& pln = planeDesc(); const point orig = cs.globalPosition(pln.origin());