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 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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 
27 Class
28  Foam::surfaceInterpolation
29 
30 Description
31  Cell to surface interpolation scheme. Included in fvMesh.
32 
33 SourceFiles
34  surfaceInterpolation.C
35 
36 \*---------------------------------------------------------------------------*/
37 
38 #ifndef surfaceInterpolation_H
39 #define 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 
49 namespace Foam
50 {
51 
52 class fvMesh;
53 class fvGeometryScheme;
54 
55 /*---------------------------------------------------------------------------*\
56  Class surfaceInterpolation Declaration
57 \*---------------------------------------------------------------------------*/
58 
60 {
61  // Private data
62 
63  // Reference to fvMesh
64  const fvMesh& mesh_;
65 
66 
67  // Demand-driven data
68 
69  //- Geometry calculation
70  mutable tmp<fvGeometryScheme> geometryPtr_;
71 
72  //- Linear difference weighting factors
73  mutable autoPtr<surfaceScalarField> weights_;
74 
75  //- Cell-centre difference coefficients
76  mutable autoPtr<surfaceScalarField> deltaCoeffs_;
77 
78  //- Non-orthogonal cell-centre difference coefficients
79  mutable autoPtr<surfaceScalarField> nonOrthDeltaCoeffs_;
80 
81  //- Non-orthogonality correction vectors
82  mutable autoPtr<surfaceVectorField> nonOrthCorrectionVectors_;
83 
84 
85 protected:
86 
87  // Protected Member Functions
88 
89  // Storage management
90 
91  //- Clear all geometry and addressing
92  void clearOut();
93 
94 
95 public:
96 
97  // Declare name of the class and its debug switch
98  ClassName("surfaceInterpolation");
99 
100 
101  // Constructors
102 
103  //- Construct given an fvMesh
104  explicit surfaceInterpolation(const fvMesh&);
105 
106 
107  //- Destructor
108  virtual ~surfaceInterpolation();
109 
110 
111  // Member functions
112 
113  //- Return reference to geometry calculation scheme
114  virtual const fvGeometryScheme& geometry() const;
115 
116  //- Set geometry calculation scheme
118 
119  //- Return reference to linear difference weighting factors
120  virtual const surfaceScalarField& weights() const;
121 
122  //- Return reference to cell-centre difference coefficients
123  virtual const surfaceScalarField& deltaCoeffs() const;
124 
125  //- Return reference to non-orthogonal cell-centre difference
126  // coefficients
127  virtual const surfaceScalarField& nonOrthDeltaCoeffs() const;
128 
129  //- Return reference to non-orthogonality correction vectors
130  virtual const surfaceVectorField& nonOrthCorrectionVectors() const;
131 
132  //- Do what is necessary if the mesh has moved
133  virtual bool movePoints();
134 
135  //- Update all geometric data
136  virtual void updateGeom();
137 };
138 
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 } // End namespace Foam
143 
144 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
145 
146 #endif
147 
148 // ************************************************************************* //
Foam::surfaceInterpolation::clearOut
void clearOut()
Clear all geometry and addressing.
Definition: surfaceInterpolation.C:49
volFieldsFwd.H
Foam::surfaceInterpolation::nonOrthDeltaCoeffs
virtual const surfaceScalarField & nonOrthDeltaCoeffs() const
Return reference to non-orthogonal cell-centre difference.
Definition: surfaceInterpolation.C:125
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
Foam::surfaceInterpolation::geometry
virtual const fvGeometryScheme & geometry() const
Return reference to geometry calculation scheme.
Definition: surfaceInterpolation.C:80
Foam::surfaceInterpolation::deltaCoeffs
virtual const surfaceScalarField & deltaCoeffs() const
Return reference to cell-centre difference coefficients.
Definition: surfaceInterpolation.C:113
Foam::surfaceInterpolation::ClassName
ClassName("surfaceInterpolation")
Foam::fvGeometryScheme
Abstract base class for geometry calculation schemes.
Definition: fvGeometryScheme.H:56
className.H
Macro definitions for declaring ClassName(), NamespaceName(), etc.
scalar.H
Foam::surfaceInterpolation::movePoints
virtual bool movePoints()
Do what is necessary if the mesh has moved.
Definition: surfaceInterpolation.C:151
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::surfaceInterpolation::nonOrthCorrectionVectors
virtual const surfaceVectorField & nonOrthCorrectionVectors() const
Return reference to non-orthogonality correction vectors.
Definition: surfaceInterpolation.C:137
tmp.H
Foam::surfaceInterpolation::weights
virtual const surfaceScalarField & weights() const
Return reference to linear difference weighting factors.
Definition: surfaceInterpolation.C:102
surfaceFieldsFwd.H
Foam::surfaceInterpolation::updateGeom
virtual void updateGeom()
Update all geometric data.
Definition: surfaceInterpolation.C:172
Foam::surfaceInterpolation
Cell to surface interpolation scheme. Included in fvMesh.
Definition: surfaceInterpolation.H:58
Foam::surfaceInterpolation::surfaceInterpolation
surfaceInterpolation(const fvMesh &)
Construct given an fvMesh.
Definition: surfaceInterpolation.C:60
Foam::surfaceInterpolation::~surfaceInterpolation
virtual ~surfaceInterpolation()
Destructor.
Definition: surfaceInterpolation.C:72
Foam::GeometricField< scalar, fvsPatchField, surfaceMesh >