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 -------------------------------------------------------------------------------
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 
28 Class
29  Foam::pointVolInterpolation
30 
31 Description
32 
33 SourceFiles
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 
53 namespace Foam
54 {
55 
56 // Forward Declarations
57 class fvMesh;
58 class pointMesh;
59 
60 /*---------------------------------------------------------------------------*\
61  Class pointVolInterpolation Declaration
62 \*---------------------------------------------------------------------------*/
63 
65 {
66  // Private Data
67 
68  const pointMesh& pointMesh_;
69  const fvMesh& fvMesh_;
70 
71  //- Interpolation scheme weighting factor array.
72  mutable FieldField<Field, scalar>* volWeightsPtr_;
73 
74  //- Primitive patch interpolators
75  mutable PtrList<primitivePatchInterpolation>* patchInterpolatorsPtr_;
76 
77 
78  // Private member functions
79 
80  //- Return patch interpolators
81  const PtrList<primitivePatchInterpolation>& patchInterpolators() const;
82 
83  //- Construct point weighting factors
84  void makeWeights() const;
85 
86  //- Clear addressing
87  void clearAddressing() const;
88 
89  //- Clear geometry
90  void clearGeom() const;
91 
92 
93 protected:
94 
95  const pointMesh& pMesh() const
96  {
97  return pointMesh_;
98  }
99 
100  const fvMesh& vMesh() const
101  {
102  return fvMesh_;
103  }
104 
105 
106 public:
108  // Declare name of the class and it's debug switch
109  ClassName("pointVolInterpolation");
110 
111 
112  // Constructors
113 
114  //- Construct given pointMesh and fvMesh.
115  pointVolInterpolation(const pointMesh&, const fvMesh&);
116 
117 
118  //- Destructor
120 
121 
122  // Member functions
123 
124  // Access
125 
126  //- Return reference to weights arrays.
127  // This also constructs the weighting factors if necessary.
128  const FieldField<Field, scalar>& volWeights() const;
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 // ************************************************************************* //
Forwards and collection of common volume field types.
Forwards and collection of common point field types.
A field of fields is a PtrList of fields with reference counting.
Definition: FieldField.H:51
Mesh representing a set of points created from polyMesh.
Definition: pointMesh.H:45
void updateTopology()
Update mesh topology using the morph engine.
Forward declarations of the specialisations of Field<T> for scalar, vector and tensor.
ClassName("pointVolInterpolation")
const FieldField< Field, scalar > & volWeights() const
Return reference to weights arrays.
pointVolInterpolation(const pointMesh &, const fvMesh &)
Construct given pointMesh and fvMesh.
void interpolate(const GeometricField< Type, pointPatchField, pointMesh > &, GeometricField< Type, fvPatchField, volMesh > &) const
Interpolate from pointField to volField.
bool movePoints()
Correct weighting factors for moving mesh.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
Definition: List.H:55
Macro definitions for declaring ClassName(), NamespaceName(), etc.
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:78
A class for managing temporary objects.
Definition: HashPtrTable.H:50
Namespace for OpenFOAM.
const pointMesh & pMesh() const