From d7fc5f6f665c355318a3f73377ee41d526f01f4c Mon Sep 17 00:00:00 2001 From: Mark Olesen Date: Thu, 8 Nov 2018 13:12:23 +0100 Subject: [PATCH] ENH: construct cylindrical from origin, axis (issue #863) --- .../coordinate/systems/cylindricalCS.C | 29 ++++++++++++++++++- .../coordinate/systems/cylindricalCS.H | 10 +++++-- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/src/meshTools/coordinate/systems/cylindricalCS.C b/src/meshTools/coordinate/systems/cylindricalCS.C index 26c049b63c..60682ea3e3 100644 --- a/src/meshTools/coordinate/systems/cylindricalCS.C +++ b/src/meshTools/coordinate/systems/cylindricalCS.C @@ -24,6 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "cylindricalCS.H" +#include "cylindricalRotation.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -111,6 +112,32 @@ Foam::coordSystem::cylindrical::cylindrical {} +Foam::coordSystem::cylindrical::cylindrical +( + const point& origin, + const vector& axis +) +: + cylindrical(word::null, origin, axis) +{} + + +Foam::coordSystem::cylindrical::cylindrical +( + const word& name, + const point& origin, + const vector& axis +) +: + coordinateSystem + ( + name, + origin, + coordinateRotations::cylindrical(axis) + ) +{} + + Foam::coordSystem::cylindrical::cylindrical ( const point& origin, @@ -118,7 +145,7 @@ Foam::coordSystem::cylindrical::cylindrical const vector& dirn ) : - coordinateSystem(origin, axis, dirn) + cylindrical(word::null, origin, axis, dirn) {} diff --git a/src/meshTools/coordinate/systems/cylindricalCS.H b/src/meshTools/coordinate/systems/cylindricalCS.H index 53c7349260..6a982b723f 100644 --- a/src/meshTools/coordinate/systems/cylindricalCS.H +++ b/src/meshTools/coordinate/systems/cylindricalCS.H @@ -126,7 +126,13 @@ public: //- Construct from origin and rotation cylindrical(const point& origin, const coordinateRotation& crot); - //- Construct from origin and 2 axes + //- Construct from origin and single axis + cylindrical(const point& origin, const vector& axis); + + //- Construct from origin and single axis + cylindrical(const word& name, const point& origin, const vector& axis); + + //- Construct from origin and two axes cylindrical ( const point& origin, @@ -134,7 +140,7 @@ public: const vector& dirn ); - //- Construct from origin and 2 axes + //- Construct from origin and two axes cylindrical ( const word& name,