pointVolInterpolation.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) Wikki Ltd
9 Copyright (C) 2019 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
27
28Class
29 Foam::pointVolInterpolation
30
31Description
32
33SourceFiles
34 pointVolInterpolation.C
35 pointVolInterpolate.C
36
37\*---------------------------------------------------------------------------*/
38
39#ifndef pointVolInterpolation_H
40#define pointVolInterpolation_H
41
42#include "primitiveFieldsFwd.H"
44#include "volFieldsFwd.H"
45#include "pointFieldsFwd.H"
46#include "scalarList.H"
47#include "tmp.H"
48#include "className.H"
49#include "FieldFields.H"
50
51// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52
53namespace Foam
54{
55
56class fvMesh;
57class pointMesh;
58
59/*---------------------------------------------------------------------------*\
60 Class pointVolInterpolation Declaration
61\*---------------------------------------------------------------------------*/
64{
65 // Private data
66
67 const pointMesh& pointMesh_;
68 const fvMesh& fvMesh_;
69
70 //- Interpolation scheme weighting factor array.
71 mutable FieldField<Field, scalar>* volWeightsPtr_;
72
73 //- Primitive patch interpolators
74 mutable PtrList<primitivePatchInterpolation>* patchInterpolatorsPtr_;
75
76
77 // Private member functions
78
79 //- Return patch interpolators
80 const PtrList<primitivePatchInterpolation>& patchInterpolators() const;
81
82 //- Construct point weighting factors
83 void makeWeights() const;
84
85 //- Clear addressing
86 void clearAddressing() const;
87
88 //- Clear geometry
89 void clearGeom() const;
90
91
92protected:
94 const pointMesh& pMesh() const
95 {
96 return pointMesh_;
97 }
99 const fvMesh& vMesh() const
100 {
101 return fvMesh_;
102 }
103
104
105public:
106
107 // Declare name of the class and it's debug switch
108 ClassName("pointVolInterpolation");
109
110
111 // Constructors
112
113 //- Constructor given pointMesh and fvMesh.
114 pointVolInterpolation(const pointMesh&, const fvMesh&);
115
116
117 // Destructor
118
120
121
122 // Member functions
123
124 // Access
125
126 //- Return reference to weights arrays.
127 // This also constructs the weighting factors if necessary.
129
130
131 // Edit
132
133 //- Update mesh topology using the morph engine
134 void updateTopology();
135
136 //- Correct weighting factors for moving mesh.
137 bool movePoints();
138
139
140 // Interpolation functions
141
142 //- Interpolate from pointField to volField
143 // using inverse distance weighting
144 template<class Type>
145 void interpolate
146 (
149 ) const;
150
151 //- Interpolate pointField returning volField
152 // using inverse distance weighting
153 template<class Type>
155 (
157 ) const;
158
159 //- Interpolate tmp<pointField> returning volField
160 // using inverse distance weighting
161 template<class Type>
163 (
165 ) const;
166};
167
168
169// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
170
171} // End namespace Foam
172
173// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
174
175#ifdef NoRepository
176# include "pointVolInterpolate.C"
177#endif
178
179// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
180
181#endif
182
183// ************************************************************************* //
A field of fields is a PtrList of fields with reference counting.
Definition: FieldField.H:80
Generic GeometricField class.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: PtrList.H:73
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:91
Mesh representing a set of points created from polyMesh.
Definition: pointMesh.H:55
bool movePoints()
Correct weighting factors for moving mesh.
const FieldField< Field, scalar > & volWeights() const
Return reference to weights arrays.
ClassName("pointVolInterpolation")
tmp< GeometricField< Type, fvPatchField, volMesh > > interpolate(const GeometricField< Type, pointPatchField, pointMesh > &) const
Interpolate pointField returning volField.
const fvMesh & vMesh() const
void interpolate(const GeometricField< Type, pointPatchField, pointMesh > &, GeometricField< Type, fvPatchField, volMesh > &) const
Interpolate from pointField to volField.
const pointMesh & pMesh() const
void updateTopology()
Update mesh topology using the morph engine.
tmp< GeometricField< Type, fvPatchField, volMesh > > interpolate(const tmp< GeometricField< Type, pointPatchField, pointMesh > > &) const
Interpolate tmp<pointField> returning volField.
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
Namespace for OpenFOAM.
Forwards and collection of common point field types.
Forward declarations of the specialisations of Field<T> for scalar, vector and tensor.