OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

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-2009 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     Foam::cellPointWeight
00027 
00028 Description
00029     Foam::cellPointWeight
00030 
00031 SourceFiles
00032     cellPointWeight.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef cellPointWeight_H
00037 #define cellPointWeight_H
00038 
00039 #include "vector.H"
00040 
00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00042 
00043 namespace Foam
00044 {
00045 
00046 class polyMesh;
00047 
00048 /*---------------------------------------------------------------------------*\
00049                            Class cellPointWeight Declaration
00050 \*---------------------------------------------------------------------------*/
00051 
00052 class cellPointWeight
00053 {
00054 protected:
00055 
00056     // Protected data
00057 
00058        //- Cell index
00059        const label cellIndex_;
00060 
00061        //- Weights applied to tet vertices
00062        FixedList<scalar, 4> weights_;
00063 
00064        //- Face vertex indices
00065        FixedList<label, 3> faceVertices_;
00066 
00067 
00068     // Protected Member Functions
00069 
00070         void findTetrahedron
00071         (
00072             const polyMesh& mesh,
00073             const vector& position,
00074             const label cellIndex
00075         );
00076 
00077         void findTriangle
00078         (
00079             const polyMesh& mesh,
00080             const vector& position,
00081             const label faceIndex
00082         );
00083 
00084 
00085 public:
00086 
00087     //- Debug switch
00088     static int debug;
00089 
00090     //- Tolerance used in calculating barycentric co-ordinates
00091     //  (applied to normailised values)
00092     static scalar tol;
00093 
00094 
00095     // Constructors
00096 
00097         //- Construct from components
00098         cellPointWeight
00099         (
00100             const polyMesh& mesh,
00101             const vector& position,
00102             const label nCell,
00103             const label facei = -1
00104         );
00105 
00106 
00107     // Member Functions
00108 
00109         //- Cell index
00110         inline label cell() const
00111         {
00112             return cellIndex_;
00113         }
00114 
00115         //- interpolation weights
00116         inline const FixedList<scalar, 4>& weights() const
00117         {
00118             return weights_;
00119         }
00120 
00121         //- interpolation addressing for points on face
00122         inline const FixedList<label, 3>& faceVertices() const
00123         {
00124             return faceVertices_;
00125         }
00126 };
00127 
00128 
00129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00130 
00131 } // End namespace Foam
00132 
00133 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00134 
00135 #endif
00136 
00137 // ************************************************************************* //
Copyright © 2000-2009 OpenCFD Ltd