Forward compatibility: flex
[foam-extend-3.2.git] / src / finiteArea / interpolation / edgeInterpolation / edgeInterpolation.H
blob637c92124e2623cbed6a3e805b038ba6c5c5b46e
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | foam-extend: Open Source CFD
4    \\    /   O peration     | Version:     3.2
5     \\  /    A nd           | Web:         http://www.foam-extend.org
6      \\/     M anipulation  | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
8 License
9     This file is part of foam-extend.
11     foam-extend is free software: you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation, either version 3 of the License, or (at your
14     option) any later version.
16     foam-extend is distributed in the hope that it will be useful, but
17     WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19     General Public License for more details.
21     You should have received a copy of the GNU General Public License
22     along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.
24 Class
25     edgeInterpolation
27 Description
28     Cell to edge interpolation scheme. Included in faMesh.
30 SourceFiles
31     edgeInterpolation.C
33 \*---------------------------------------------------------------------------*/
35 #ifndef edgeInterpolation_H
36 #define edgeInterpolation_H
38 #include "tmp.H"
39 #include "scalar.H"
40 #include "faSchemes.H"
41 #include "faSolution.H"
42 #include "areaFieldsFwd.H"
43 #include "edgeFieldsFwd.H"
44 #include "className.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 namespace Foam
51 class polyMesh;
53 /*---------------------------------------------------------------------------*\
54                         Class edgeInterpolation Declaration
55 \*---------------------------------------------------------------------------*/
57 class edgeInterpolation
59     // Private data
61         // Reference to faMesh
62         const faMesh& faMesh_;
64         //- Discretisation schemes
65         faSchemes schemesDict_;
67         //- Solver settings
68         faSolution solutionDict_;
71         // Demand-driven data
73             //- Geodesic distance between centroides of neighbour finite areas
74             mutable edgeScalarField* lPN_;
76             //- Cenral-differencing weighting factors
77             mutable edgeScalarField* weightingFactors_;
79             //- Face-gradient difference factors
80             mutable edgeScalarField* differenceFactors_;
82             //- Is mesh orthogonal
83             mutable bool orthogonal_;
85             //- Non-orthogonality correction vectors
86             mutable edgeVectorField* correctionVectors_;
88             //- Is mesh skew
89             mutable bool skew_;
91             //- Skew correction vectors
92             mutable edgeVectorField* skewCorrectionVectors_;
95     // Private member functions
97         //- Construct geodesic distance between P and N
98         void makeLPN() const;
100         //- Construct central-differencing weighting factors
101         void makeWeights() const;
103         //- Construct face-gradient difference factors
104         void makeDeltaCoeffs() const;
106         //- Construct non-orthogonality correction vectors
107         void makeCorrectionVectors() const;
109         //- Construct skewness correction vectors
110         void makeSkewCorrectionVectors() const;
112 //         //- Construct Least-squares gradient vectors
113 //         void makeLeastSquareVectors() const;
116 protected:
118     // Protected member functions
120         // Storage management
122             //- Clear all geometry and addressing
123             void clearOut();
126 public:
128     // Declare name of the class and it's debug switch
129     ClassName("edgeInterpolation");
132     // Constructors
134         //- Construct given an faMesh
135         edgeInterpolation(const faMesh&);
138     // Destructor
140         ~edgeInterpolation();
143     // Member functions
145         //- Return mesh reference
146         const faMesh& mesh() const
147         {
148             return faMesh_;
149         }
151         //- Return schemes
152         const faSchemes& schemesDict() const
153         {
154             return schemesDict_;
155         }
157         //- Return access to schemes
158         faSchemes& schemesDict()
159         {
160             return schemesDict_;
161         }
163         //- Return solver settings
164         const faSolution& solutionDict() const
165         {
166             return solutionDict_;
167         }
169         //- Return access to solver settings
170         faSolution& solutionDict()
171         {
172             return solutionDict_;
173         }
175         //- Return reference to PN geodesic distance
176         const edgeScalarField& lPN() const;
178         //- Return reference to weighting factors array
179         const edgeScalarField& weights() const;
181         //- Return reference to difference factors array
182         const edgeScalarField& deltaCoeffs() const;
184         //- Return whether mesh is orthogonal or not
185         bool orthogonal() const;
187         //- Return reference to non-orthogonality correction vectors array
188         const edgeVectorField& correctionVectors() const;
190         //- Return whether mesh is skew or not
191         bool skew() const;
193         //- Return reference to skew vectors array
194         const edgeVectorField& skewCorrectionVectors() const;
197         //- Do what is neccessary if the mesh has moved
198         bool movePoints() const;
202 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
204 } // End namespace Foam
206 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
208 #endif
210 // ************************************************************************* //