| 1 | // AeroElement.hxx -- Mesh element for the computation of a wing wake. |
| 2 | // |
| 3 | // Written by Bertrand Coconnier, started March 2017. |
| 4 | // |
| 5 | // Copyright (C) 2017 Bertrand Coconnier - [email protected] |
| 6 | // |
| 7 | // This program is free software; you can redistribute it and/or modify it under |
| 8 | // the terms of the GNU General Public License as published by the Free Software |
| 9 | // Foundation; either version 2 of the License, or (at your option) any later |
| 10 | // version. |
| 11 | // |
| 12 | // This program is distributed in the hope that it will be useful, but WITHOUT |
| 13 | // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
| 14 | // FOR A PARTICULAR PURPOSE. See the GNU General Public License for more |
| 15 | // details. |
| 16 | // |
| 17 | // You should have received a copy of the GNU General Public License along with |
| 18 | // this program; if not, write to the Free Software Foundation, Inc., 51 |
| 19 | // Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 20 | // |
| 21 | // $Id$ |
| 22 | |
| 23 | #ifndef _FG_AEROELEMENT_HXX |
| 24 | #define _FG_AEROELEMENT_HXX |
| 25 | |
| 26 | #include <simgear/math/SGMathFwd.hxx> |
| 27 | |
| 28 | |
| 29 | class AeroElement : public SGReferenced { |
| 30 | public: |
| 31 | AeroElement(const SGVec3d& n1, const SGVec3d& n2, const SGVec3d& n3, |
| 32 | const SGVec3d& n4); |
| 33 | const SGVec3d& getNormal(void) const { return normal; } |
| 34 | const SGVec3d& getCollocationPoint(void) const { return collocationPt; } |
| 35 | SGVec3d getBoundVortex(void) const { return p2 - p1; } |
| 36 | SGVec3d getBoundVortexMidPoint(void) const { return 0.5*(p1+p2); } |
| 37 | SGVec3d getInducedVelocity(const SGVec3d& p) const; |
| 38 | private: |
| 39 | SGVec3d vortexInducedVel(const SGVec3d& p, const SGVec3d& n1, |
| 40 | const SGVec3d& n2) const; |
| 41 | SGVec3d semiInfVortexInducedVel(const SGVec3d& point, const SGVec3d& vEnd, |
| 42 | const SGVec3d& vDir) const; |
| 43 | SGVec3d p1, p2, normal, collocationPt; |
| 44 | }; |
| 45 | |
| 46 | typedef SGSharedPtr<AeroElement> AeroElement_ptr; |
| 47 | |
| 48 | #endif |