arcEdge.H 5.9 KB
 OpenFOAM-admin committed Apr 15, 2008 1 2 3 4 /*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration |  OpenFOAM bot committed Oct 31, 2019 5  \\ / A nd | www.openfoam.com  OpenFOAM bot committed Feb 06, 2019 6 7  \\/ M anipulation | -------------------------------------------------------------------------------  OpenFOAM bot committed Oct 31, 2019 8  Copyright (C) 2011-2016 OpenFOAM Foundation  Mark Olesen committed Oct 05, 2020 9  Copyright (C) 2017-2020 OpenCFD Ltd.  OpenFOAM-admin committed Apr 15, 2008 10 11 12 13 ------------------------------------------------------------------------------- License This file is part of OpenFOAM.  Mark Olesen committed Mar 29, 2010 14 15 16 17  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-admin committed Apr 15, 2008 18 19 20 21 22 23 24  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  Mark Olesen committed Mar 29, 2010 25  along with OpenFOAM. If not, see .  OpenFOAM-admin committed Apr 15, 2008 26 27  Class  28  Foam::blockEdges::arcEdge  OpenFOAM-admin committed Apr 15, 2008 29 30  Description  Mark Olesen committed Oct 05, 2020 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56  A blockEdge defined as an arc of a circle. The arc is normally defined by its endpoints and a point on its circumference, typically a midpoint. For example, \verbatim points ((1 0 0) (0 1 0)); arc 0 1 (0.707107 0.707107 0); \endverbatim The arc can enclose an angle greater than 0 and less than 360 degrees. The arc will frequently enclose an angle less than 180 degrees. For the case, it is possible to define the arc by its endpoints and its centre (origin) point. For example, \verbatim arc 0 1 origin (0 0 0); \endverbatim When defined in the way, any discrepancy in the arc radius for the endpoints is resolved by adjusting the origin to ensure that the average radius is satisfied. It is also possible to define a \em flatness factor as a multiplier of the calculated radius. For example, \verbatim arc 0 1 origin 1.1 (0 0 0); \endverbatim  OpenFOAM-admin committed Apr 15, 2008 57 58 59 60 61 62  SourceFiles arcEdge.C \*---------------------------------------------------------------------------*/  63 64 #ifndef blockEdges_arcEdge_H #define blockEdges_arcEdge_H  OpenFOAM-admin committed Apr 15, 2008 65   Henry Weller committed Oct 08, 2016 66 #include "blockEdge.H"  OpenFOAM-admin committed Apr 15, 2008 67 68 69 70 71 72 #include "cylindricalCS.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam {  73 74 namespace blockEdges {  OpenFOAM-admin committed Apr 15, 2008 75 76 77 78 79 80 81  /*---------------------------------------------------------------------------*\ Class arcEdge Declaration \*---------------------------------------------------------------------------*/ class arcEdge :  Henry Weller committed Oct 08, 2016 82  public blockEdge  OpenFOAM-admin committed Apr 15, 2008 83 {  Mark Olesen committed Oct 05, 2020 84  // Private Data  Mark Olesen committed Sep 19, 2018 85 86  //- The arc radius  OpenFOAM-admin committed Apr 15, 2008 87  scalar radius_;  Mark Olesen committed Sep 19, 2018 88   Mark Olesen committed Oct 05, 2020 89 90 91  //- The arc angle (radians) scalar angle_;  Mark Olesen committed Sep 24, 2018 92  //- The local cylindrical coordinate system  Mark Olesen committed Oct 01, 2018 93  coordSystem::cylindrical cs_;  OpenFOAM-admin committed Apr 15, 2008 94   Andrew Heather committed Oct 26, 2016 95   Mark Olesen committed Oct 08, 2009 96 97  // Private Member Functions  Mark Olesen committed Oct 05, 2020 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118  //- Calculate angle, radius, cylindrical coordinate system //- from end points and the given point on the circumference void calcFromMidPoint ( const point& p1, //!< Start point const point& p3, //!< End point const point& p2 //!< Point on circumference ); //- Calculate angle, radius, cylindrical coordinate system //- from end points and the given origin. // Optionally adjust centre to accommodate deviations in the // effective radius to the end-points void calcFromCentre ( const point& p1, //!< Start point const point& p3, //!< End point const point& centre, //!< Centre bool adjustCentre = false, //!< Adjust centre scalar rMultiplier = 1 //!< Adjust radius by this factor );  Mark Olesen committed Nov 29, 2009 119   Mark Olesen committed May 30, 2018 120 121  //- No copy construct arcEdge(const arcEdge&) = delete;  Mark Olesen committed Oct 08, 2009 122   Mark Olesen committed May 30, 2018 123 124  //- No copy assignment void operator=(const arcEdge&) = delete;  Mark Olesen committed Oct 08, 2009 125   126   OpenFOAM-admin committed Apr 15, 2008 127 128 129 130 131 132 133 134 public: //- Runtime type information TypeName("arc"); // Constructors  Mark Olesen committed Oct 05, 2020 135 136 137 138 139 140 141 142 143 144  //- Construct from components, given the origin of the circle arcEdge ( const pointField& points, //!< Referenced point field const point& origin, //!< The origin of the circle const label start, //!< Start point in referenced point field const label end //!< End point in referenced point field ); //- Construct from components, using a point on the circumference  OpenFOAM-admin committed Apr 15, 2008 145 146  arcEdge (  Mark Olesen committed Oct 05, 2020 147 148 149 150  const pointField& points, //!< Referenced point field const label start, //!< Start point in referenced point field const label end, //!< End point in referenced point field const point& midPoint //!< A point on the circumference  OpenFOAM-admin committed Apr 15, 2008 151 152  );  Mark Olesen committed Oct 05, 2020 153 154 155  //- Construct from Istream and point field. // The Istream can specify either a point on the circumference, // or with a tag to specify the origin.  156 157  arcEdge (  Henry Weller committed Oct 31, 2016 158 159  const dictionary& dict, const label index,  Mark Olesen committed Oct 05, 2020 160 161 162  const searchableSurfaces& geometry, // unsed const pointField& points, //!< Referenced point field Istream& is  163  );  OpenFOAM-admin committed Apr 15, 2008 164 165   Mark Olesen committed Apr 12, 2010 166  //- Destructor  Mark Olesen committed Sep 19, 2018 167  virtual ~arcEdge() = default;  OpenFOAM-admin committed Apr 15, 2008 168 169 170 171  // Member Functions  Mark Olesen committed Sep 19, 2018 172 173  //- The point corresponding to the curve parameter [0-1] point position(const scalar lambda) const;  OpenFOAM-admin committed Apr 15, 2008 174   Mark Olesen committed Sep 19, 2018 175  //- The length of the curve  Mark Olesen committed Oct 05, 2020 176  scalar length() const noexcept;  OpenFOAM-admin committed Apr 15, 2008 177 178 179 180 181 }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //  Mark Olesen committed Apr 27, 2018 182 } // End namespace blockEdges  OpenFOAM-admin committed Apr 15, 2008 183 184 185 186 187 188 189 } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif // ************************************************************************* //