FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

cellPointWeight.H

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2010 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
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your 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, see <http://www.gnu.org/licenses/>.
00023 
00024 Class
00025     Foam::cellPointWeight
00026 
00027 Description
00028     Foam::cellPointWeight
00029 
00030 SourceFiles
00031     cellPointWeight.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef cellPointWeight_H
00036 #define cellPointWeight_H
00037 
00038 #include <OpenFOAM/vector.H>
00039 
00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00041 
00042 namespace Foam
00043 {
00044 
00045 class polyMesh;
00046 
00047 /*---------------------------------------------------------------------------*\
00048                            Class cellPointWeight Declaration
00049 \*---------------------------------------------------------------------------*/
00050 
00051 class cellPointWeight
00052 {
00053 protected:
00054 
00055     // Protected data
00056 
00057        //- Cell index
00058        const label cellIndex_;
00059 
00060        //- Weights applied to tet vertices
00061        FixedList<scalar, 4> weights_;
00062 
00063        //- Face vertex indices
00064        FixedList<label, 3> faceVertices_;
00065 
00066 
00067     // Protected Member Functions
00068 
00069         void findTetrahedron
00070         (
00071             const polyMesh& mesh,
00072             const vector& position,
00073             const label cellIndex
00074         );
00075 
00076         void findTriangle
00077         (
00078             const polyMesh& mesh,
00079             const vector& position,
00080             const label faceIndex
00081         );
00082 
00083 
00084 public:
00085 
00086     //- Debug switch
00087     static int debug;
00088 
00089     //- Tolerance used in calculating barycentric co-ordinates
00090     //  (applied to normalised values)
00091     static scalar tol;
00092 
00093 
00094     // Constructors
00095 
00096         //- Construct from components
00097         cellPointWeight
00098         (
00099             const polyMesh& mesh,
00100             const vector& position,
00101             const label nCell,
00102             const label facei = -1
00103         );
00104 
00105 
00106     // Member Functions
00107 
00108         //- Cell index
00109         inline label cell() const
00110         {
00111             return cellIndex_;
00112         }
00113 
00114         //- interpolation weights
00115         inline const FixedList<scalar, 4>& weights() const
00116         {
00117             return weights_;
00118         }
00119 
00120         //- interpolation addressing for points on face
00121         inline const FixedList<label, 3>& faceVertices() const
00122         {
00123             return faceVertices_;
00124         }
00125 };
00126 
00127 
00128 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00129 
00130 } // End namespace Foam
00131 
00132 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00133 
00134 #endif
00135 
00136 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines