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 class fvMesh;
57 class pointMesh;
58 
59 /*---------------------------------------------------------------------------*\
60  Class pointVolInterpolation Declaration
61 \*---------------------------------------------------------------------------*/
62 
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 
92 protected:
93 
94  const pointMesh& pMesh() const
95  {
96  return pointMesh_;
97  }
98 
99  const fvMesh& vMesh() const
100  {
101  return fvMesh_;
102  }
103 
104 
105 public:
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.
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 // ************************************************************************* //
volFieldsFwd.H
primitiveFieldsFwd.H
Forward declarations of the specialisations of Field<T> for scalar, vector and tensor.
Foam::FieldField
A field of fields is a PtrList of fields with reference counting.
Definition: FieldField.H:53
Foam::pointVolInterpolation::updateTopology
void updateTopology()
Update mesh topology using the morph engine.
Definition: pointVolInterpolation.C:209
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
FieldFields.H
primitivePatchInterpolation.H
Foam::pointVolInterpolation::vMesh
const fvMesh & vMesh() const
Definition: pointVolInterpolation.H:98
Foam::pointVolInterpolation::movePoints
bool movePoints()
Correct weighting factors for moving mesh.
Definition: pointVolInterpolation.C:217
scalarList.H
Foam::pointVolInterpolation::volWeights
const FieldField< Field, scalar > & volWeights() const
Return reference to weights arrays.
Definition: pointVolInterpolation.C:196
Foam::pointVolInterpolation::interpolate
void interpolate(const GeometricField< Type, pointPatchField, pointMesh > &, GeometricField< Type, fvPatchField, volMesh > &) const
Interpolate from pointField to volField.
Definition: pointVolInterpolate.C:40
Foam::pointVolInterpolation
Definition: pointVolInterpolation.H:62
className.H
Macro definitions for declaring ClassName(), NamespaceName(), etc.
Foam::pointVolInterpolation::~pointVolInterpolation
~pointVolInterpolation()
Definition: pointVolInterpolation.C:185
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:59
Foam::fvMesh
Mesh data needed to do the Finite Volume discretisation.
Definition: fvMesh.H:85
Foam::pointVolInterpolation::ClassName
ClassName("pointVolInterpolation")
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::pointMesh
Mesh representing a set of points created from polyMesh.
Definition: pointMesh.H:51
Foam::pointVolInterpolation::pointVolInterpolation
pointVolInterpolation(const pointMesh &, const fvMesh &)
Constructor given pointMesh and fvMesh.
Definition: pointVolInterpolation.C:171
tmp.H
pointVolInterpolate.C
Foam::pointVolInterpolation::pMesh
const pointMesh & pMesh() const
Definition: pointVolInterpolation.H:93
pointFieldsFwd.H
Forwards and collection of common point field types.
Foam::GeometricField
Generic GeometricField class.
Definition: areaFieldsFwd.H:53