edgeInterpolation.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | www.openfoam.com
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8  Copyright (C) 2016-2017 Wikki Ltd
9 -------------------------------------------------------------------------------
10 License
11  This file is part of OpenFOAM.
12 
13  OpenFOAM is free software: you can redistribute it and/or modify it
14  under the terms of the GNU General Public License as published by
15  the Free Software Foundation, either version 3 of the License, or
16  (at your option) any later version.
17 
18  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21  for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25 
26 Class
27  Foam::edgeInterpolation
28 
29 Description
30  Face to edge interpolation scheme. Included in faMesh.
31 
32 Author
33  Zeljko Tukovic, FMENA
34  Hrvoje Jasak, Wikki Ltd.
35 
36 SourceFiles
37  edgeInterpolation.C
38 
39 \*---------------------------------------------------------------------------*/
40 
41 #ifndef edgeInterpolation_H
42 #define edgeInterpolation_H
43 
44 #include "tmp.H"
45 #include "scalar.H"
46 #include "areaFieldsFwd.H"
47 #include "edgeFieldsFwd.H"
48 #include "className.H"
49 
50 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
51 
52 namespace Foam
53 {
54 
55 class polyMesh;
56 
57 /*---------------------------------------------------------------------------*\
58  Class edgeInterpolation Declaration
59 \*---------------------------------------------------------------------------*/
60 
62 {
63  // Private data
64 
65  // Reference to faMesh
66  const faMesh& faMesh_;
67 
68 
69  // Demand-driven data
70 
71  //- Geodesic distance between centroids of neighbour finite areas
72  mutable edgeScalarField* lPN_;
73 
74  //- Central-differencing weighting factors
75  mutable edgeScalarField* weightingFactors_;
76 
77  //- Face-gradient difference factors
78  mutable edgeScalarField* differenceFactors_;
79 
80  //- Is mesh orthogonal
81  mutable bool orthogonal_;
82 
83  //- Non-orthogonality correction vectors
84  mutable edgeVectorField* correctionVectors_;
85 
86  //- Is mesh skew
87  mutable bool skew_;
88 
89  //- Skew correction vectors
90  mutable edgeVectorField* skewCorrectionVectors_;
91 
92 
93  // Private member functions
94 
95  //- Construct geodesic distance between P and N
96  void makeLPN() const;
97 
98  //- Construct central-differencing weighting factors
99  void makeWeights() const;
100 
101  //- Construct face-gradient difference factors
102  void makeDeltaCoeffs() const;
103 
104  //- Construct non-orthogonality correction vectors
105  void makeCorrectionVectors() const;
106 
107  //- Construct skewness correction vectors
108  void makeSkewCorrectionVectors() const;
109 
110 // //- Construct Least-squares gradient vectors
111 // void makeLeastSquareVectors() const;
112 
113 
114 protected:
115 
116  // Protected member functions
117 
118  // Storage management
119 
120  //- Clear all geometry and addressing
121  void clearOut();
122 
123 
124 public:
125 
126  // Declare name of the class and it's debug switch
127  ClassName("edgeInterpolation");
128 
129 
130  // Constructors
131 
132  //- Construct given an faMesh
133  explicit edgeInterpolation(const faMesh&);
134 
135 
136  //- Destructor
138 
139 
140  // Member functions
141 
142  //- Return mesh reference
143  const faMesh& mesh() const
144  {
145  return faMesh_;
146  }
147 
148  //- Return reference to PN geodesic distance
149  const edgeScalarField& lPN() const;
150 
151  //- Return reference to weighting factors array
152  const edgeScalarField& weights() const;
153 
154  //- Return reference to difference factors array
155  const edgeScalarField& deltaCoeffs() const;
156 
157  //- Return whether mesh is orthogonal or not
158  bool orthogonal() const;
159 
160  //- Return reference to non-orthogonality correction vectors array
161  const edgeVectorField& correctionVectors() const;
162 
163  //- Return whether mesh is skew or not
164  bool skew() const;
165 
166  //- Return reference to skew vectors array
167  const edgeVectorField& skewCorrectionVectors() const;
168 
169 
170  //- Do what is necessary if the mesh has moved
171  bool movePoints() const;
172 };
173 
174 
175 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
176 
177 } // End namespace Foam
178 
179 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180 
181 #endif
182 
183 // ************************************************************************* //
Foam::edgeInterpolation::skew
bool skew() const
Return whether mesh is skew or not.
Definition: edgeInterpolation.C:136
Foam::edgeInterpolation::skewCorrectionVectors
const edgeVectorField & skewCorrectionVectors() const
Return reference to skew vectors array.
Definition: edgeInterpolation.C:148
Foam::edgeInterpolation::deltaCoeffs
const edgeScalarField & deltaCoeffs() const
Return reference to difference factors array.
Definition: edgeInterpolation.C:101
Foam::edgeInterpolation::~edgeInterpolation
~edgeInterpolation()
Destructor.
Definition: edgeInterpolation.C:71
Foam::edgeInterpolation::clearOut
void clearOut()
Clear all geometry and addressing.
Definition: edgeInterpolation.C:44
areaFieldsFwd.H
Forwards and collection of common area field types.
Foam::edgeInterpolation::lPN
const edgeScalarField & lPN() const
Return reference to PN geodesic distance.
Definition: edgeInterpolation.C:79
className.H
Macro definitions for declaring ClassName(), NamespaceName(), etc.
Foam::edgeInterpolation::orthogonal
bool orthogonal() const
Return whether mesh is orthogonal or not.
Definition: edgeInterpolation.C:112
scalar.H
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::edgeInterpolation::movePoints
bool movePoints() const
Do what is necessary if the mesh has moved.
Definition: edgeInterpolation.C:161
Foam::edgeInterpolation::weights
const edgeScalarField & weights() const
Return reference to weighting factors array.
Definition: edgeInterpolation.C:90
Foam::edgeInterpolation::correctionVectors
const edgeVectorField & correctionVectors() const
Return reference to non-orthogonality correction vectors array.
Definition: edgeInterpolation.C:123
tmp.H
Foam::faMesh
Finite area mesh. Used for 2-D non-Euclidian finite area method.
Definition: faMesh.H:82
Foam::edgeInterpolation::edgeInterpolation
edgeInterpolation(const faMesh &)
Construct given an faMesh.
Definition: edgeInterpolation.C:56
Foam::GeometricField< scalar, faePatchField, edgeMesh >
edgeFieldsFwd.H
Forwards for edge field types.
Foam::edgeInterpolation::ClassName
ClassName("edgeInterpolation")
Foam::edgeInterpolation
Face to edge interpolation scheme. Included in faMesh.
Definition: edgeInterpolation.H:60
Foam::edgeInterpolation::mesh
const faMesh & mesh() const
Return mesh reference.
Definition: edgeInterpolation.H:142