OpenFOAM logo
Open Source CFD Toolkit

edgeInterpolation.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-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     edgeInterpolation
00027 
00028 Description
00029     Cell to edge interpolation scheme. Included in faMesh.
00030 
00031 SourceFiles
00032     edgeInterpolation.C
00033 
00034 \*---------------------------------------------------------------------------*/
00035 
00036 #ifndef edgeInterpolation_H
00037 #define edgeInterpolation_H
00038 
00039 #include "tmp.H"
00040 #include "scalar.H"
00041 #include "faSchemes.H"
00042 #include "faSolution.H"
00043 #include "areaFieldsFwd.H"
00044 #include "edgeFieldsFwd.H"
00045 #include "className.H"
00046 
00047 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00048 
00049 namespace Foam
00050 {
00051 
00052 class polyMesh;
00053 
00054 /*---------------------------------------------------------------------------*\
00055                      Class edgeInterpolation Declaration
00056 \*---------------------------------------------------------------------------*/
00057 
00058 class edgeInterpolation
00059 :
00060     public faSchemes,
00061     public faSolution
00062 {
00063     // private data
00064 
00065         // Reference to faMesh
00066         const faMesh& mesh_;
00067 
00068         //- Geodesic distance between centroides of neighbour finite areas
00069         mutable edgeScalarField* lPN_;
00070 
00071         //- Cenral-differencing weighting factors
00072         mutable edgeScalarField* weightingFactors_;
00073 
00074         //- Face-gradient difference factors
00075         mutable edgeScalarField* differenceFactors_;
00076 
00077         //- Is mesh orthogonal
00078         mutable bool orthogonal_;
00079 
00080         //- Non-orthogonality correction vectors
00081         mutable edgeVectorField* correctionVectors_;
00082 
00083         //- Is mesh skew
00084         mutable bool skew_;
00085 
00086         //- Skew correction vectors
00087         mutable edgeVectorField* skewCorrectionVectors_;
00088 
00089 //         //- Least-squares gradient vectors
00090 //         mutable edgeVectorField* leastSquarePvectors_;
00091 //         mutable edgeVectorField* leastSquareNvectors_;
00092 
00093 
00094     // Private member functions
00095 
00096         //- Construct geodesic distance between P and N
00097         void makeLPN() const;
00098 
00099         //- Construct central-differencing weighting factors
00100         void makeWeights() const;
00101 
00102         //- Construct face-gradient difference factors
00103         void makeDeltaCoeffs() const;
00104 
00105         //- Construct non-orthogonality correction vectors
00106         void makeCorrectionVectors() const;
00107 
00108         //- Construct skewness correction vectors
00109         void makeSkewCorrectionVectors() const;
00110 
00111 //         //- Construct Least-squares gradient vectors
00112 //         void makeLeastSquareVectors() const;
00113 
00114 
00115 protected:
00116 
00117     // Protected member functions
00118 
00119         // Storage management
00120 
00121             //- Clear all geometry and addressing
00122             void clearOut();
00123 
00124 
00125 public:
00126 
00127     // Declare name of the class and it's debug switch
00128     ClassName("edgeInterpolation");
00129 
00130 
00131     // Constructors
00132 
00133         //- Construct given an faMesh
00134         edgeInterpolation(const faMesh&, const polyMesh&);
00135 
00136 
00137     // Destructor
00138 
00139         ~edgeInterpolation();
00140 
00141 
00142     // Member functions
00143 
00144         //- Return mesh reference
00145         const faMesh& mesh() const
00146         {
00147             return mesh_;
00148         }
00149 
00150         //- Return reference to PN geodesic distance
00151         const edgeScalarField& lPN() const;
00152 
00153         //- Return reference to weighting factors array
00154         const edgeScalarField& weights() const;
00155 
00156         //- Return reference to difference factors array
00157         const edgeScalarField& deltaCoeffs() const;
00158 
00159         //- Return whether mesh is orthogonal or not
00160         bool orthogonal() const;
00161 
00162         //- Return reference to non-orthogonality correction vectors array
00163         const edgeVectorField& correctionVectors() const;
00164 
00165         //- Return whether mesh is skew or not
00166         bool skew() const;
00167 
00168         //- Return reference to skew vectors array
00169         const edgeVectorField& skewCorrectionVectors() const;
00170 
00171 //         //- Return reference to owner least square vectors
00172 //         const edgeVectorField& leastSquarePvectors() const;
00173 
00174 //         //- Return reference to neighbour least square vectors
00175 //         const edgeVectorField& leastSquareNvectors() const;
00176 
00177         //- Do what is neccessary if the mesh has moved
00178         bool movePoints();
00179 };
00180 
00181 
00182 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00183 
00184 } // End namespace Foam
00185 
00186 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00187 
00188 #endif
00189 
00190 // ************************************************************************* //
For further information go to www.openfoam.org