surfaceInterpolation.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) 2011 OpenFOAM Foundation
9 Copyright (C) 2020-2022 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Class
28 Foam::surfaceInterpolation
29
30Description
31 Cell to surface interpolation scheme. Included in fvMesh.
32
33SourceFiles
34 surfaceInterpolation.C
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef Foam_surfaceInterpolation_H
39#define Foam_surfaceInterpolation_H
40
41#include "tmp.H"
42#include "scalar.H"
43#include "volFieldsFwd.H"
44#include "surfaceFieldsFwd.H"
45#include "className.H"
46
47// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48
49namespace Foam
50{
51
52// Forward Declarations
53class fvMesh;
54class fvGeometryScheme;
55class mapPolyMesh;
56
57/*---------------------------------------------------------------------------*\
58 Class surfaceInterpolation Declaration
59\*---------------------------------------------------------------------------*/
62{
63 // Private Data
64
65 // Reference to fvMesh
66 const fvMesh& mesh_;
67
68
69 // Demand-driven data
70
71 //- Geometry calculation
72 mutable tmp<fvGeometryScheme> geometryPtr_;
73
74 //- Linear difference weighting factors
75 mutable autoPtr<surfaceScalarField> weights_;
76
77 //- Cell-centre difference coefficients
78 mutable autoPtr<surfaceScalarField> deltaCoeffs_;
79
80 //- Non-orthogonal cell-centre difference coefficients
81 mutable autoPtr<surfaceScalarField> nonOrthDeltaCoeffs_;
82
83 //- Non-orthogonality correction vectors
84 mutable autoPtr<surfaceVectorField> nonOrthCorrectionVectors_;
85
86
87protected:
88
89 // Protected Member Functions
90
91 // Storage management
92
93 //- Clear all geometry and addressing
94 void clearOut();
95
96
97public:
98
99 // Declare name of the class and its debug switch
100 ClassName("surfaceInterpolation");
101
102
103 // Constructors
104
105 //- Construct given an fvMesh
106 explicit surfaceInterpolation(const fvMesh&);
107
108
109 //- Destructor
110 virtual ~surfaceInterpolation();
111
112
113 // Member Functions
114
115 //- Return reference to geometry calculation scheme
116 virtual const fvGeometryScheme& geometry() const;
117
118 //- Set geometry calculation scheme
120
121 //- Return reference to linear difference weighting factors
122 virtual const surfaceScalarField& weights() const;
123
124 //- Return reference to cell-centre difference coefficients
125 virtual const surfaceScalarField& deltaCoeffs() const;
126
127 //- Return reference to non-orthogonal cell-centre difference
128 // coefficients
129 virtual const surfaceScalarField& nonOrthDeltaCoeffs() const;
130
131 //- Return reference to non-orthogonality correction vectors
132 virtual const surfaceVectorField& nonOrthCorrectionVectors() const;
133
134 //- Do what is necessary if the mesh has moved
135 virtual bool movePoints();
136
137 //- Update all geometric data
138 virtual void updateGeom();
139
140
141 // Storage Management
142
143 //- Has weights
144 bool hasWeights() const noexcept { return bool(weights_); }
145
146 //- Update mesh for topology changes
147 virtual void updateMesh(const mapPolyMesh& mpm);
148};
149
150
151// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
152
153} // End namespace Foam
154
155// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156
157#endif
158
159// ************************************************************************* //
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
Abstract base class for geometry calculation schemes.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Class containing mesh-to-mesh mapping information after a change in polyMesh topology.
Definition: mapPolyMesh.H:162
Cell to surface interpolation scheme. Included in fvMesh.
virtual bool movePoints()
Do what is necessary if the mesh has moved.
virtual const fvGeometryScheme & geometry() const
Return reference to geometry calculation scheme.
ClassName("surfaceInterpolation")
virtual const surfaceVectorField & nonOrthCorrectionVectors() const
Return reference to non-orthogonality correction vectors.
virtual void updateMesh(const mapPolyMesh &mpm)
Update mesh for topology changes.
virtual const surfaceScalarField & weights() const
Return reference to linear difference weighting factors.
virtual const surfaceScalarField & deltaCoeffs() const
Return reference to cell-centre difference coefficients.
virtual const surfaceScalarField & nonOrthDeltaCoeffs() const
Return reference to non-orthogonal cell-centre difference.
bool hasWeights() const noexcept
Has weights.
void clearOut()
Clear all geometry and addressing.
virtual ~surfaceInterpolation()
Destructor.
virtual void updateGeom()
Update all geometric data.
A class for managing temporary objects.
Definition: tmp.H:65
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
Namespace for OpenFOAM.
const direction noexcept
Definition: Scalar.H:223