1 /*---------------------------------------------------------------------------*\
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 -------------------------------------------------------------------------------
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/>.
28 Cell to edge interpolation scheme. Included in faMesh.
33 \*---------------------------------------------------------------------------*/
35 #ifndef edgeInterpolation_H
36 #define edgeInterpolation_H
40 #include "faSchemes.H"
41 #include "faSolution.H"
42 #include "areaFieldsFwd.H"
43 #include "edgeFieldsFwd.H"
44 #include "className.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 /*---------------------------------------------------------------------------*\
54 Class edgeInterpolation Declaration
55 \*---------------------------------------------------------------------------*/
57 class edgeInterpolation
61 // Reference to faMesh
62 const faMesh& faMesh_;
64 //- Discretisation schemes
65 faSchemes schemesDict_;
68 faSolution solutionDict_;
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_;
91 //- Skew correction vectors
92 mutable edgeVectorField* skewCorrectionVectors_;
95 // Private member functions
97 //- Construct geodesic distance between P and N
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;
118 // Protected member functions
120 // Storage management
122 //- Clear all geometry and addressing
128 // Declare name of the class and it's debug switch
129 ClassName("edgeInterpolation");
134 //- Construct given an faMesh
135 edgeInterpolation(const faMesh&);
140 ~edgeInterpolation();
145 //- Return mesh reference
146 const faMesh& mesh() const
152 const faSchemes& schemesDict() const
157 //- Return access to schemes
158 faSchemes& schemesDict()
163 //- Return solver settings
164 const faSolution& solutionDict() const
166 return solutionDict_;
169 //- Return access to solver settings
170 faSolution& solutionDict()
172 return solutionDict_;
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
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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
210 // ************************************************************************* //