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-------------------------------------------------------------------------------
10License
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
26Class
27 Foam::edgeInterpolation
28
29Description
30 Face to edge interpolation scheme. Included in faMesh.
31
32Author
33 Zeljko Tukovic, FMENA
34 Hrvoje Jasak, Wikki Ltd.
35
36SourceFiles
37 edgeInterpolation.C
38
39\*---------------------------------------------------------------------------*/
40
41#ifndef Foam_edgeInterpolation_H
42#define Foam_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
52namespace Foam
53{
54
55// Forward Declarations
56class polyMesh;
57
58/*---------------------------------------------------------------------------*\
59 Class edgeInterpolation Declaration
60\*---------------------------------------------------------------------------*/
63{
64 // Private Data
65
66 // Reference to faMesh
67 const faMesh& faMesh_;
68
69
70 // Demand-driven data
71
72 //- Geodesic distance between centroids of neighbour finite areas
73 mutable edgeScalarField* lPN_;
74
75 //- Central-differencing weighting factors
76 mutable edgeScalarField* weightingFactors_;
77
78 //- Face-gradient difference factors
79 mutable edgeScalarField* differenceFactors_;
80
81 //- Non-orthogonality correction vectors
82 mutable edgeVectorField* correctionVectors_;
83
84 //- Skew correction vectors
85 mutable edgeVectorField* skewCorrectionVectors_;
86
87 //- Is mesh orthogonal
88 mutable bool orthogonal_;
89
90 //- Is mesh skew
91 mutable bool skew_;
92
93
94 // Private Member Functions
95
96 //- Construct geodesic distance between P and N
97 void makeLPN() const;
98
99 //- Construct central-differencing weighting factors
100 void makeWeights() const;
101
102 //- Construct face-gradient difference factors
103 void makeDeltaCoeffs() const;
104
105 //- Construct non-orthogonality correction vectors
106 void makeCorrectionVectors() const;
107
108 //- Construct skewness correction vectors
109 void makeSkewCorrectionVectors() const;
110
111
112protected:
113
114 // Protected Member Functions
115
116 // Storage Management
117
118 //- Clear all geometry and addressing
119 void clearOut();
120
121
122public:
123
124 // Declare name of the class and it's debug switch
125 ClassName("edgeInterpolation");
126
127
128 // Constructors
129
130 //- Construct given an faMesh
131 explicit edgeInterpolation(const faMesh&);
132
133
134 //- Destructor
136
137
138 // Member Functions
139
140 //- Return mesh reference
141 const faMesh& mesh() const noexcept
142 {
143 return faMesh_;
144 }
145
146 //- Return reference to PN geodesic distance
147 const edgeScalarField& lPN() const;
148
149 //- Return reference to weighting factors array
150 const edgeScalarField& weights() const;
151
152 //- Return reference to difference factors array
153 const edgeScalarField& deltaCoeffs() const;
154
155 //- Return reference to non-orthogonality correction vectors array
156 const edgeVectorField& correctionVectors() const;
157
158 //- Return reference to skew vectors array
160
161 //- Return whether mesh is orthogonal or not
162 bool orthogonal() const;
163
164 //- Return whether mesh is skew or not
165 bool skew() const;
166
167
168 // Mesh Motion
169
170 //- Do what is necessary if the mesh has moved
171 bool movePoints() const;
172
173
174 // Storage Management
175
176 //- True if weights exist
177 bool hasWeights() const noexcept { return bool(weightingFactors_); }
178};
179
180
181// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182
183} // End namespace Foam
184
185// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
186
187#endif
188
189// ************************************************************************* //
Forwards and collection of common area field types.
Face to edge interpolation scheme. Included in faMesh.
bool movePoints() const
Do what is necessary if the mesh has moved.
const faMesh & mesh() const noexcept
Return mesh reference.
const edgeScalarField & deltaCoeffs() const
Return reference to difference factors array.
const edgeVectorField & correctionVectors() const
Return reference to non-orthogonality correction vectors array.
bool orthogonal() const
Return whether mesh is orthogonal or not.
const edgeScalarField & lPN() const
Return reference to PN geodesic distance.
ClassName("edgeInterpolation")
const edgeScalarField & weights() const
Return reference to weighting factors array.
bool skew() const
Return whether mesh is skew or not.
bool hasWeights() const noexcept
True if weights exist.
void clearOut()
Clear all geometry and addressing.
const edgeVectorField & skewCorrectionVectors() const
Return reference to skew vectors array.
Finite area mesh (used for 2-D non-Euclidian finite area method) defined using a patch of faces on a ...
Definition: faMesh.H:100
Macro definitions for declaring ClassName(), NamespaceName(), etc.
#define ClassName(TypeNameString)
Add typeName information from argument TypeNameString to a class.
Definition: className.H:67
bool
Definition: EEqn.H:20
Forwards for edge field types.
Namespace for OpenFOAM.
const direction noexcept
Definition: Scalar.H:223