![]() |
|
00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2005 OpenCFD Ltd. 00006 \\/ M anipulation | 00007 ------------------------------------------------------------------------------- 00008 License 00009 This file is part of OpenFOAM. 00010 00011 OpenFOAM is free software; you can redistribute it and/or modify it 00012 under the terms of the GNU General Public License as published by the 00013 Free Software Foundation; either version 2 of the License, or (at your 00014 option) any later version. 00015 00016 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00018 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00019 for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with OpenFOAM; if not, write to the Free Software Foundation, 00023 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00024 00025 Class 00026 triFace 00027 00028 Description 00029 A tetrahedral cell primitive used for tetra FEM and post-processing 00030 00031 SourceFiles 00032 triFaceI.H 00033 00034 \*---------------------------------------------------------------------------*/ 00035 00036 #ifndef triFace_H 00037 #define triFace_H 00038 00039 #include "FixedList.H" 00040 #include "edgeList.H" 00041 #include "pointHit.H" 00042 #include "intersection.H" 00043 #include "pointField.H" 00044 #include "triPointRef.H" 00045 00046 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00047 00048 namespace Foam 00049 { 00050 00051 class face; 00052 00053 /*---------------------------------------------------------------------------*\ 00054 class triFace Declaration 00055 \*---------------------------------------------------------------------------*/ 00056 00057 class triFace 00058 : 00059 public FixedList<label, 3> 00060 { 00061 00062 public: 00063 00064 // Constructors 00065 00066 //- Construct null 00067 inline triFace(); 00068 00069 //- Construct from three point labels 00070 inline triFace 00071 ( 00072 const label a, 00073 const label b, 00074 const label c 00075 ); 00076 00077 //- Construct from Istream 00078 inline triFace(Istream&); 00079 00080 00081 // Member Functions 00082 00083 // Properties 00084 00085 //- Return the points corresponding to this face 00086 inline pointField points(const pointField& points) const; 00087 00088 //- Return triagle as a face 00089 inline face triFaceFace() const; 00090 00091 //- Return number of edges 00092 inline label nEdges() const; 00093 00094 //- Return edges 00095 inline edgeList edges() const; 00096 00097 //- Return centre (centroid) 00098 inline point centre(const pointField&) const; 00099 00100 //- Return scalar magnitude 00101 inline scalar mag(const pointField&) const; 00102 00103 //- Return vector normal 00104 inline vector normal(const pointField&) const; 00105 00106 //- Return swept-volume 00107 inline scalar sweptVol 00108 ( 00109 const pointField& oldPoints, 00110 const pointField& newPoints 00111 ) const; 00112 00113 //- Return point intersection with a ray starting at p, with 00114 // direction n. 00115 inline pointHit ray 00116 ( 00117 const point& p, 00118 const vector& q, 00119 const pointField& points, 00120 const intersection::algorithm = intersection::FULL_RAY, 00121 const intersection::direction dir = intersection::VECTOR 00122 ) const; 00123 00124 //- Return the tetrahedron 00125 inline triPointRef tri(const pointField&) const; 00126 00127 00128 // Friend Operators 00129 00130 inline friend bool operator==(const triFace&, const triFace&); 00131 inline friend bool operator!=(const triFace&, const triFace&); 00132 }; 00133 00134 00135 //- Hash<triFace> specialisation 00136 // Simple commutative hash. 00137 template<> 00138 inline label Hash<triFace>::operator()(const triFace& t) const 00139 { 00140 return (t[0]*t[1]*t[2] + t[0]+t[1]+t[2]); 00141 } 00142 00143 00144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00145 00146 } // End namespace Foam 00147 00148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00149 00150 #include "triFaceI.H" 00151 00152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00153 00154 #endif 00155 00156 // ************************************************************************* //